text
stringlengths
8
6.12M
%% mouse visual cortex workspace % rt = '/groups/betzig/betziglab/Ved/Data/20170613_ExM/VisualYFPmbpcaspr/Stitch_Igor/restitching-incremental/decon-export/'; s = GU_calcGaussianIntegral(1, [3.2 3.2 3.2]); GU_ExM_calcPunctaDensityVol(data.framePaths{1}{3}, data.framePaths{1}{1},... 'FindLocalMaxima', false, 'Verbo...
function scan_data = dk2rd(ufilename,plotmode,verbose) %DK2RD - read Dektak IIA surface profilometer data file % % SCAN_DATA = DK2RD(UFILENAME,PLOTMODE,VERBOSE) % %DK2RD reads the data from file UFILENAME.txt, and returns a 2-column % array SCAN_DATA: % (:,1) is the horizontal position data in microns % (:,2)...
function mjd=date_mjd(year,month,day,hour,mm,ss); % convert a date given as integers - year,month,day,hour,mm,ss % to Modified Julian Days (mjd) % usage: mjd=date_mjd(year,month,day,hour,mm,ss); % last arguments are optional mjd0=48622;d0=datenum(1992,1,1,0,0,0); % Jan 1, 1992 00:00 GMT is 48622mjd % switch na...
function bass = singlebass(path, isdebug, isplot, minheight, mindist, minprom) %%%% detect a single bass %%%% bass = []; [song,fs] = audioread(path); % playback the audio for debugging if isdebug player = audioplayer(song, fs); playblocking(player); end % normalize...
clear all format compact type = 2; m = 100; eps = 1.0e-1; k = 5; n = 5*[64 128 256 512 1024]; for i = 1:length(n) if type == 1 s = floor(8*i); A = 10*rand(m, n(i)); else s = floor(8*i); m=1024; n=1024; k=504; l=k+8; ...
function kno_pet_figure2_slicebrain_new % KNO_PET_FIGURE2 % % Produce figure 2 % L.V. Straatman1, M.M. van Wanrooij1,2, L.F. de Geus-Oei3, E.P. Visser3, A.F.M. Snik1, J.J.S. Mulder1 % %% Cleansing close all clear all p = 'E:\Backup\Nifti\'; cd(p) [N,T,R] = xlsread('subjectdates.xlsx'); % keyboar...
close all REINIT_ALL_TOKAMAK_DATA=1; if REINIT_ALL_TOKAMAK_DATA==1 clear all initialize_folder_names; initialize_collapse_map_calculation_context rescaling_to_XZsmall_maps DT_INTERPOLATION_METHOD='quadratic' % by default CALCULATE_VD_DATA_FILE=0; end CALCULATE_VD_DATA_FILE=1; % load('../...
% Defines a covariance function product of the children. % All children must inherit tacopig.covfn.CovFn % % Usage: tacopig.covfn.Product(child1, child2, ...) % % Example instantiation: % GP.CovFn = tacopig.covfn.Product(tacopig.covfn.SqExp(),tacopig.covfn.Mat3()); % Instantiates a Product covariance function (as a p...
% %Generar señal PBRS de [0,1] de período máximo % a_k=[1 0 0 1]'; %coeficientes para n=4 % s=ones(Pmax,1); % for k=2:Pmax % if (k<=n) % s(k)=mod(sum(s(1:k-1).*a_k(1:k-1)),2); % else % s(k)=mod(sum(s(k-n:k-1).*a_k),2); % end % end % % u=zeros(Ns*Pmax,1); % for k=1:Pmax % u((k-1)*Ns+1:k*Ns...
function [im] = pboverlay(im,pb,channel,faint) % function [im] = pboverlay(im,pb,channel,faint) % % Overlay the pb onto an image. % % INPUTS % im Grayscale or RGB image, values in [0,1]. % pb Boundary map, values in [0,1]. % [channel=2] Row vector of channels into which to % put the pb, in [1,3]. % [faint=0.4] M...
function [V_flat,cutMesh,flattener]=flatten_sphere(V,T,inds,orbifold_type,varargin) p = inputParser; p.addParameter('CutMesh',[]) p.addParameter('classic',false) p.addParameter('verbose',true,@islogical) p.addParameter('minimize_conformal',false,@islogical); orbifold_type=uint32(orbifold_type); %the cone structure of ...
function varargout = makeMorphingContinuumGUI(varargin) % MAKEMORPHINGCONTINUUMGUI M-file for makeMorphingContinuumGUI.fig % MAKEMORPHINGCONTINUUMGUI, by itself, creates a new MAKEMORPHINGCONTINUUMGUI or raises the existing % singleton*. % % H = MAKEMORPHINGCONTINUUMGUI returns the handle to a new MAKEMO...
clear all; clc; % initialize random generator %rng('default') %% Add the utility's functions folder addpath('Utils') %% VARIABLES %declare global variabless global abs_value_x; % N array, being the absolute x position of each robot global abs_value_y; % N array, being the absolute y position of each robot global cou...
%% Post-processing function % Removes intermediate densities function post_process(x,nelx,nely,volfrac) [Y,I] = sort(x(:), 'descend'); vt = floor(((volfrac - 0.001) * nelx * nely) / (1 - 0.001)); xd(I(1:vt)) = 1; xd(I(vt+1:end)) = 0.001; xd = reshape(xd, nely, nelx); colormap(gray); imagesc(-xd); axis equ...
% Example: % % Visual perception of gray regions II % % Computer Vision Course % (c) Domingo Mery (2014) - http://dmery.ing.puc.cl close all i = input('background? 1: black, 2: white, 3: degrade: '); switch i case 1 Io = zeros(180,512); case 2 Io = 255*ones(180,512); case 3 Io = on...
function userdata_saveY(Yint,data_dir,data_id,data_type,pstep) filename = rawdata_getFileName(data_dir,data_id,data_type,pstep); save(filename,'Yint'); end
% % constructor of class RP2 % % number: number of unit function [module error] = RP2(number,circuit) error = 0; module = actxcontrol('RPco.x',[1 1 1 1]); connect = module.ConnectRP2('GB',number); if (connect) module.reset; load = module.LoadCOF(circuit); if (load) ...
% Shannon's summary of function descriptions from Monty's Keck toolbox % (inputs in parenthesi are optional input args) % % gstrfmodel: fitting STRF by Gabor functions % inputs: STRF,taxis,faxis,PP,Tresh,TreshType,Method,display % outputs: STRFm,STRFam,STRFbm,STRFcm,x0,w,sf0,spectrop,t0,c,tf0,q,k,belta,SIs,SIt,SI,E...
% ----------------------------------------------------------------- % % Matlab Programs included the Appendix B in the book: % % Xin-She Yang, Engineering Optimization: An Introduction % % with Metaheuristic Applications % % Published by John Wiley & Son...
% plotTitle Generate title for multi-panel figure. % % This function adds a title to the top of a figure. It is intended to be % used with multi-panel figures. % % Inputs: % titleStr Main figure title % subtitleStr Sub-title % % @ Alan Degenhart -- alan.degenhart@gmail.com function plotTitle(titleStr...
%This programme is about buzzer function buzzer(a,delay,pin) pinMode(a,pin,'OUTPUT'); digitalWrite(a,pin,1); pause(delay); digitalWrite(a,pin,0); return
%******************************************************************** %% gendata: internal use only. Use gendata2 instead %% %% Author: Tillmann Weisser %%******************************************************************** function sdp = gendata(pop,d,k,algotag) if nargin < 4 if strcmp(k,'SPUT') k=0; ...
function [L_hat,S_hat,L_star,W_k,cnt,obj_func_k]=CGRMSL(X,Phi,lambda,gamma,lambda_v) eta=0.00000001; % 0.000001 p=size(X,1); n=size(X,2); M=size(X,3); lambda_sum=sum(lambda_v); L_k=rand(p,n,M); W_k=rand(p,n,M); W_kp1=zeros(p,n,M); % W_kp1=randn(p,n,M); S_k=rand(p,n,M); L_star_k=rand(p,n); for m=1:M ...
function [Tri] = Vert_Neibp(faces,Nv,Nf); % % Syntax : % [Tri] = Vert_Neibp(faces,Nv,Nf); % % Computes the neighbor points for an specific point. This function is just to % call Vert_Neibp.mex* % % Input Parameters: % faces : Mesh faces. % Nv : Number of vertices. % Nf : Number of faces. % % Output Para...
function [SSGF] = calc_OS_SGF(U10,r) % r in microns U10_fm_paper = [36 40.5 45 49.5 54]; if ~(ismember(U10,U10_fm_paper)) error(' U10 must be one of 36 40.5 45 49.5 54 for Ortiz-Suslow') elseif any(r<86) error('radii must be > 86 microns for OrtizSuslow 2016') end Table1_data = [... 36 -2.1984 7.1125 -...
%E = Numero de entradas %Ce = Numero de camadas escondidas %S = Numero de saidas %Ta = Taxa de aprendizado %epoca = Numero de iterações %MSEmin = Erro Minimo E = 3; Ce = 10; S = 2; Ta = 5; alfa = 0.00000000001; epoca = 25000; MSEmin = 1e-10; %X = Matriz com os valores de entrada %D = Matriz com os valores de saida ...
function derivs = del_log_det_B(hyps, cov_func, n, n_class, X, y, approxF) % a function evaluating d log.det B d theta_i % by Mark Norrish, 2011 % hyps: as a vector; [ h_class1 ; ... ; h_class_c ] % Modifed by ebonilla 09/11/2012 derivs = zeros(size(hyps)); if 0 % comment [f, F, bigK, W, p, P, bigP, sigma_noise, di...
% min_freq = 2*pi/1000 max_freq = 2*pi/10 w = 10*2*pi % Values sim_time = 500 refine_factor = 1; r = 0.55; p=2; k1 = 1.5; k2 = 3.0; %optimal input u_star = r*p/2 % Initial Conditions x1_0 = 0.1; x2_0 = 0.1; % input u = 0.1; out = sim('non_linear_tank_Test_Dither') plot(out.x1.Time,out.x1.Data,out.x2.Time,out.x2....
function [gamma,armijo_steps,objFunc] = func_armijo(objFuncValue,ii,namestr,gradmag,params) % backtracking search (Armijo method) % modified from 2010 m.bangert@dkfz.de (https://www.mathworks.com/matlabcentral/fileexchange/34835-optimization-tutorial?s_tid=prof_contriblnk) % objFuncValue - current objective function v...
StoreVariables ExportUntouched % I do not want recalculation of model for whole matrix, on Export. model_name = 'No Model'; imlook4d_current_handles.model.functionHandle = []; Import ClearVariables setModelsCheckbox()
% Nonparametric Belief Propagation (NBP)
% absrelfel % Kör programmet genom att skriva absrelfel i kommandofönstret. % Programmet visar absolut repektive relativt fel disp(' ') disp('Du ska nu mata in två tal,') disp('där vi ska uppfatta det ena som ett korrekt värde') disp('och det andra som ett närmevärde till rätta värdet.') disp(' '); korr = input('Vilk...
function df = gradient_rob_mat(sigma,f,dX) % Compute the gradient of a matrix field f % We must have size(f) = [d1 d d_{2+1} ... d_{2+d}] % where d_{2+1} ... d_{2+d} are the space dimensions of R^d. % The result will be of size [ d1 d2 d_{2+1} ... d_{2+d} d] % if sigma ==0 df = gradient_mat(f,dX); elseif sigma == ...
%% Colony Redness - measures the redness of the colony % Matlab Colony Analyzer Toolkit % Gordon Bean, June 2013 % % Usage % ------------------------------------------------------------------------ % colsize = ColonyRedness().quantify(plate, grid, position) % OR % colsize = ColonyRedness().quantify(colony_box, binary_c...
clear; close all; load face.mat; width = 56; height = 46; num_classes = 52; class_size = 10; train_examples = 7; test_examples = class_size - train_examples; PCA_DIM = 100; use_pca = 0; %Training features and labels x_train = zeros(width*height, train_examples*num_classes); x_test = zeros(width*height, test_example...
[feature3_ordered_benign_tr12,feature3_ordered_malignant_tr12,PCA_coeff,index]=gen_feature_three_tr(feature3_tr12_benign,feature3_tr12_malignant); [feature3_ordered_benign_val1,feature3_ordered_malignant_val1]=gen_feature_three_val(feature3_val1_benign,feature3_val1_malignant,PCA_coeff,index); figure; plot3(feature1_tr...
function [ result ] = haplo_divs( data, list ) d = data(:,7:end); inv = 5; count(1:floor(length(d(1,:))/(2*inv)),1:2^inv) = 0; for i = 1:length(list) for j = 1:floor(length(d(list(i),:))/(inv*2)) code = d(list(i),inv*2*(j-1)+1:inv*2*(j-1)+inv*2); de = 1; for k = 1:inv if( cod...
function err = naivePerfusionSSEIntegratorP2X4StackDeMix3(ton,toff,Ttot,amp,T,I) %#codgen; naive=getNaiveP2X4StackDeMix3(); V=-60*10^-3; err=errorIntegratorP2X4StackDeMix3(ton,toff,Ttot,amp,naive,T,I,V); end
%% ADV tools by Ben Strom ... later modded by Danny Sale (8/23/2016) % this code was written to post-process the Vectrino ADV on the gantry % system, in Bamfield flume 2015 % % changes: Danny adds the estimation of turbulent length scale, % formats some figures, adds a sample dataset and testcase, % i...
function gpsa_load_stage % Loads stage functions for GPS: Analysis % % Author: A. Conrad Nied % % Changelog: % 2012.09.21 - Created, based on gpsa_load_subject % 2012.09.27 - Changed completely to reflect hardcoded stage functions and % button presentation % 2012.10.03 - Added gpsa_do callback and fleshed out tag % 201...
% This function will read and parse VRT data function [header digitizer receiver extension data trailer] = readWSAVRT(wsaHandle, sampleSize) % add VRT packet classes to path [mFilePath, ~, ~] = fileparts(mfilename('fullpath')); addpath(fullfile(mFilePath, '/', 'vrt')); % initialize VRT packet cla...
function [a, b, H12] = fixed_transmitter_side_beamformer(H1, H2) a = zeros(length(H1), 1); %rows, 1 column!!! b = zeros(length(H2), 1); H12 = zeros(length(H2), 1); for i = 1:length(H1) H12(i) = sqrt(H1(i)*H1(i)'+H2(i)*H2(i)'); a(i) = H1(i)'/H12(i); b(i) = H2(i)'/H12(i); end k = linspace(1,length(H1), ...
function fig=makeFig(number,width,height) % Builds a figure with the specified width and height (in pixels). % It is designed to put the figures in the corners of a 1920x1080 screen % started in the top left and then going to the sequential corners up to 4. fig=figure(number); if nargin<2 width=500; height=500;...
%{ # Session session_id: int --- -> Lab.Subject -> Lab.Rig %} classdef Session < dj.Manual end
function grid = establishGroup(grid, group) % establishGroup - ensure all particles reference the same group. % inputs: % grid - the grid the group is establishing itself within. % group - the group being established. % outputs: % grid - the grid with the corresponding particles in the group % notified of...
function sthlm3_visualizeFeaturePlot(inputfilename,filenamelist,labellist) % sthlm3_visualizeFeaturePlot - Plot PCA or t-SNE plot. % % sthlm3_visualizeFeaturePlot(inputfilename) % % Plots PCA or t-SNE plot based on precomputed values. % % Required parameters: % 'inputfilename' - Full path to the .mat file containing t...
% cemDiff01.m % 19 march 2016 % Ian Cooper % School of Physics, University of Sydney % http://www.physics.usyd.edu.au/teach_res/mp/mphome.htm % Numerical differentation % 1st derivative dy/dx forward backward central difference methods % 2nd derivative d2/dx2 close all clear all clc tic %...
clear clc close all %% Part B -- Given Solution Run rmin = 1.; rmax = 2.; smin = 0.; smax = pi/2; Nr = 40; Ns = 40; nu = 1; iOption = 0; iTZ = 0; [r, s, x, y, u, ~] = steadyHeat2D( ... Nr, rmin, rmax, Ns, smin, smax, nu, iOption, iTZ); %% Part B -- Given Solution Plotting figure surf(x, y, u, 'EdgeColor', 'none')...
function max_flat_FIR = lowpass_FIR(order, cutoff_frequency, sampling_frequency) % LOWPASS_FIR Returns a discrete-time filter object. % FIR maximally flat Lowpass filter designed using the MAXFLAT function. % All frequency values are in Hz. Fs = sampling_frequency; % Sampling Frequency N = order; % Order Fc = cu...
function [H] = homographyEstimate(X1,Y1,X2,Y2,npoints) M2 = [X2 Y2]; B = reshape(M2',[8,1]); A = zeros(2*npoints); for i=1:npoints A(2*i-1,:) = [X1(i,1), Y1(i,1), 1,0,0,0, -X1(i,1)*X2(i,1), -X2(i,1)*Y1(i,1)]; A(2*i,:) = [0, 0, 0, X1(i,1), Y1(i,1), 1, -X1(i,1)*Y2(i,1), -Y1(i,1)*Y2(i,1)]; end H = [A\B;1]; %%H...
function [ validLimitTest, resultsDiffPP, resultsDiffType, resultsDiffGeneral, resultsMinLim, resultsMaxLim, maxDiffPP, maxDiffType, maxDiffGnrl, MinBnd, MaxBnd, AGCaveragePP, MinMaxBndPlt ] = limAGC(fidLog, CT, posCSV, pathConfig, LoggedData) %determines if all agc values are within limits %initialize return paramet...
function bbox = select_bbox_from_image(I, message) %Given an open figure, display an image then ask for a rectangular %selection and return the selection in bbox format, while not %allowing the selection to be too small (area of 50 pixels is minimum) % Tomasz Malisiewicz (tomasz@csail.mit.edu) if ~exist('message','var...
frame_dir = '../../clip_1'; start = 22; % save visualization to file addpath('export_fig'); out_dir = '../../code_data/track_data/clip1_tracks'; % load tracklets load ../../code_data/track_data/tracklets1 tracklets = tracklets1; % for all frames do h = figure('Position',[10 100 840 480]); axes('Position',[0 0 1 1]); ...
function [pairs corrected_viterbi error] ... = generate_consistent_pairs(oblist, viterbi, posterior, posteriorIBD1, ... kinship2ex, range, parameters) error = 0; pairs = []; corrected_viterbi = int8([]); [nmarkers, cols] = size(parameters.sampled_markerlist); if( nmarkers < 1 || cols ~= 2 ) error = 1; ...
%@(#) crdiff.m 1.2 94/02/08 12:31:17 % %function crdiff(fil1,fil2,noplot) %compares the tip-depletion in the files fil1 and fil2 %The difference is taken as fil1-fil2 % %If plotta==0, no distplot is presented, default is plotta=1; function crdiff(fil1,fil2,noplot) if nargin<3, plotta=1;end [crold,mminj]=readdist...
function [FailedID WaitingID SuccessID]=y_ReRunqsireconFailedSubjects(Cfg,WorkingDir,SubjectID) % FORMAT [FailedID WaitingID SuccessID]=y_ReRunqsireconFailedSubjects(Cfg,WorkingDir,SubjectID) % Cfg - the parameters for auto data processing. % WorkingDir - Define the working directory to replace the one defined in ...
function plot_interaction_lfp(pss, varargin) % visualize the results from 'interaction_lfp_dataset.m' % load data here: % load('Z:\Katsuhisa\serotonin_project\LFP_project\Data\pss.mat') if nargin < 1 load('Z:\Katsuhisa\serotonin_project\LFP_project\Data\pss.mat') end if nargin < 2 celltype_flag = 0; cellty...
clear close all clc % load valveLib.mat % labelFontSize = 20; ticksFontSize = 20; lineWidth = 4; % Cv = valveLib.Hoke.s2300.model_2335G4Y.Cv_vs_turns(:,2); app = valveLib.Hoke.s2300.model_2335G4Y.Cv_vs_turns(:,1); % plot(Cv,app,'LineWidth',lineWidth); grid on % xlabel_str = 'Cv'; xlabel(xlabel_str,'Fon...
% This is material illustrating the methods from the book % Financial Modelling - Theory, Implementation and Practice with Matlab % source % Wiley Finance Series % ISBN 978-0-470-74489-5 % % Date: 02.05.2012 % % Authors: Joerg Kienitz % Daniel Wetterau % % Please send comments, suggestions, bugs,...
function cc_LbandHPAttnPhShftControl % CC_APEX - "Compiles" all the APEX applications to run standalone % Starting directory DirStart = pwd; gotocompile('Gun'); % Compile application %cc_standalone('apexlab'); %!rm llrf %pause(.5); cc_standalone('LbandPhaseShAttnControlWindow'); %cc_standalone('machineconfig'); %...
%@(#) crseq.m 1.3 05/12/08 13:18:32 % %Script that writes several patterns to file %function crseq(filvec,outfile) function crseq(filvec,outfile) if nargin==1,outfile='print.txt';end id=size(filvec,1); fid=fopen(outfile,'w'); for i=1:id distfil=remblank(filvec(i,:)); [dist,mminj,konrod,bb,hy,mz,ks,buntyp,bun...
function [delta__fr, delta__fl] = perfectAcker(delta) % ---------------------------------------------------------------- %% Function purpose: compute steering angles for front wheels, with %% perfect Ackerman steering model % ----------------------------------------------------------...
% CROP Interactive cropping tool for Diffraction objects % % Usage: % >> object=crop(object,bound1,bound2); % directly input boundaries of % crop region % >> object=crop(object,'manual'); % interactively select crop region % % See also Xray, Diffraction % % % created Augu...
function sol = solve_expipg(pp,ppv,alg_type) %{ 05/02/2022 Purnanand Elango Input: alg_type{1}: Vectorized ('VEC') De-vectorized ('DVEC') alg_type{2}: MEX ('mex') MATLAB ('m') alg_type{3}: Old infeasibility detection criteria based on ratio of dual error ('old_inf...
function tool_phi_plot_l( r_int,r_ext,phi_int,phi_ext,phi_int_lt,phi_ext_lt,n_th,label_opt,cur_time_i,par_dt ) %TOOL_CPM_PLOT Summary of this function goes here % Detailed explanation goes here [N_int,M]=size(phi_int); [N_ext,~]=size(phi_ext); tP_mx=zeros(M,n_th); dth=2*pi/(n_th-1); theta=0:dth:2*pi; x_int=zeros(n...
% for GTO 1s only function V = two_electron_int(basis_alphas, basis_centers) V = zeros(length(basis_alphas), length(basis_alphas),... length(basis_alphas), length(basis_alphas)); for i = 1:length(basis_alphas) for j = 1:length(basis_alphas) for k = 1:length(basis_alphas) ...
function [positionState,a_hl_n,a_hr_n,a_kl_n,a_kr_n]=gait_normal(gait_length,gait_height) t=0:0.005:2; %采样时间 l1=0.4; l2=0.4;%l1是大腿长度,l2是小腿长度 z=gait_height; %z为步高 s=gait_length; %s为步长 T=2; %T为步态周期长度 v=s/(T/2); sb=s/2; positionState = 'normal'; for i=1:201 xa_n(i)=(-2*s)*t(i)^3+(3*s)*t(i)^2; %xa,ya为右脚位置 ya_n(i)=(z/2)*s...
% Exercise 1 % Bit Plane Slicing % Reading Image I = imread('TestImage.jpg'); fprintf('The Size of RGB Image is : '); disp(size(I)); % RGB to Gray Image Conversion Gray_I = rgb2gray(I); figure imshow(Gray_I); title('Gray Image'); fprintf('The Size of Gray Image is : '); disp(size(Gray_I)); Gray_In = ...
% test 3Hz function start_3Hz(event) % Déclenche dans l'ordre les elements pulsés et le linac tango_command_inout2('BOO/SY/LOCAL.Binj.1', 'Update'); tango_command_inout2('BOO/SY/LOCAL.Bext.1', 'Update'); tango_command_inout2('ANS-C01/SY/LOCAL.Ainj.1', 'Update'); tango_command_inout2('ANS-C01/SY/...
function[G, Z, P, dopt] = POLE_PLACER_BP_MF_S(Amax,Wc1,Wc2,amin_low,amin_high,wstep_low,wstep_high,wi_low,wi_high,NZ,NIN) % % Returns the zeros,poles and scaling constant for a maximally flat passband, bandpass filter. % Dopt is the final distance to the specification in dB. If negative the specification is not met...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Copyright 2012 Analog Devices, Inc. % % Licensed under the Apache License, Version 2.0 (the "License"); % you may not use this file except in compliance with the License. % You may obtain a copy of the License at % % http:/...
function [labels,Exemplars] = sequence_kmeans_grassmann(seqs,N_clusters,max_iter) %%'points/seqs' is a cell of sequences which needs to be clustered points = seqs; Npts = length(points); load('avg_shape.mat'); rand_pts = randperm(Npts); clust_idx = rand_pts(1:N_clusters); dist_Mat = zeros(Npts,N_clusters); ...
%Voice Based Biometric System %By Ambavi K. Patel. function cb=fextr() fs = 16000; % Sampling rate intval = 3; % Recording time interval in seconds % Record Function “wavrecord” is a Matlab function used for recording speech signals choix=menu('Select one option ','1-B...
MakeTraj2 pose = [start 0]; robotCurrentLocation = start; robotGoal = path(end,:);%[13.32 16.11]; controller = robotics.PurePursuit; controller.Waypoints = [path]; controller.DesiredLinearVelocity = 0.3; controller.MaxAngularVelocity = 1; controller.LookaheadDistance = 0.5; goalRadius = 0.1; distanceToGoal = norm(ro...
rec_meth={'SharpIR 3 iterations' 'SharpIR 6 iterations' 'Vue Point HD'}; % Name for reconstruction methods epsilon_vector=[0.3; 0.275; 0.35]; psf_data= [1.48, 2.01; 1.37, 2.03; 3.15, 2.58];
function [trainingSetAndTestSet] = getTrainingSetAndTestSet(testNumber, BaseData) % 划分测试集和训练集,将原记录编号顺序随机置乱,前部分记录作训练集,前部分记录作测试集 [N, ~] = size(BaseData); trainingSetAndTestSet = zeros(testNumber,N); for i = 1 : testNumber X = randperm(N); % 置乱 ...
%% Search set limited to maxRSSIbeacon neighboring grids + maxReference [N,NA]=max(refmeans,[],2); for j=1:length(readData) [M,MA]=max(readData(j,:)); A=find(NA==MA); switch MA case 1 B=gridFormat(1:2,1:2); C=unique([reshape(B,[],1);A]); for i=1:length(b) [M,MI]=min(abs(readData(j,i...
function reassignments = sort_assignments(assignments) % UltraMegaSort2000 by Hill DN, Mehta SB, & Kleinfeld D - 07/08/2010 % % sort_assignments - renumber cluster identities based on size of cluster % % Usage: % reassignments = sort_assignments(assignments) % % Description: % Takes a list of assignment numbers an...
%% List Reader %% Startup DIR1 = './Text Files'; DIR2 = genpath('./util'); addpath(DIR1,DIR2); fName = 'Lesson3List.txt'; %% Read File fid = fopen(fName,'r','n','Shift_JIS'); fgetl(fid); % Ignore First line kanjiList = KanjiVar.empty; kanjiCount = 0; % don't forget to include the newline in fscanf [kanji,readFiel...
function [ K ] = periodicKernel( phi, sigma ) %PERIODICKERNEL von Mises distribution kappa=1/sigma^2; const=2*pi*besseli(0, kappa); K = exp(kappa*cos(phi)) / const; end
function sigma2sum = sigma2sum(m,delta) % Compute sum of sigma2(m-1/m+1(delta),p1,p2,q1,q2) for all p1,p2,q1,q2. max = 0; if delta == 0 max = m - 1; elseif delta == 2 max = m + 1; end sigma2sum = 0; for p1 = 1:(max-1) for p2 = (p1+1):max for q1 = 0:(p2-p1-1) for q2 = 0:(max-p2) ...
function [cin, ceq, delta_Vf_r] = return_impulse_nonlcon(X, xOrb_epoch_t0_Ast, ratio, destination) UC = get_Univers_Constants(); % Univers constants % icur = 1; t0_r = X(icur) ; icur = icur + 1; % initial time for the impulse return manoeuver dt1_r = X(icur) ; icur = i...
figure u1 = unifrnd(0,1,1,10); u2 = unifrnd(0,1,1,10); X = (-2*log(u1)).^(1/2) .* cos(2*pi*u2); [y,x] = ksdensity(X); plot(x,y, 'r--') hold on plot(x, normpdf(x)) figure u1 = unifrnd(0,1,1,100); u2 = unifrnd(0,1,1,100); X = (-2*log(u1)).^(1/2) .* cos(2*pi*u2); [y,x] = ksdensity(X); plot(x,y, 'r--') hold...
function f = atmosphere(CdFunct,m,h0,t,y) h = h0 - y(1); [Cd,S] = CdFunct(h,t); G = 6.67*10^-11; M = 5.9723*10^24; re = 6371000; R = 287.058; f(1,1) = y(2); f(2,1) = G*M/((re + h)^2) - .5*Cd*S*(y(2)^2)*rho(h)/m; %f(3,1) = G*M/((re + h)^2) - .5*Cd*S*(y(3)^2)*pressure(h)/(R*temp(h))/m; %Previous formula end
function produceVThresholdGraphs(collectData) % This code computes and produces Figure 2 - Vaccination coverage required % for herd immunity - and related version which are presented in the SI %% Computation of threshold for herd immunity and allocations which achieve it if collectData display('Collecting data');[...
%% Perform Barnes-Hut t-SNE on mouse gene data clear variables close all addpath('../bh-tsne'); ids = {'9861','10021','12876','14380','15496','15697'}; nbrains = length(ids); outdir = 'results_human_average_MDS/'; %% Load data for bnr = 1%2:nbrains id = ids{bnr}; datadir = ['/home/mvandegiessen/data/tSNE_ABA/...
function plot_mathieu_mode(g,f,eta,xi,h,ver) %PLOT_MATHIEU_MODE plots an eigenmode of an elliptical membrane, which was % obtained by the method ellipse_eigs. See ellipse_eigs for additional information. % % See also: ELLIPSE_EIGS, DEMO_MATHIEU % Reference: C. I. Gheorghiu, M. E. Hochstenbach, B. Plestenjak, J. Romm...
function status = DAQmxStopTask(task) [status]=calllib('mynidaqmx','DAQmxStopTask',task);
function [Low_tracks_out] = TrackletsMergeTiny_V1(Low_tracks_in,ObjN,ThreSeg,ThreSegRatio) % find and delete tiny tracklets % Low_tracks_in | input tracelets % ObjN | number of objects % ThreSeg | distance threshold % ThreSegRatio(1,2) | % ----------------------------------------- % ThreSegRatio=[1...
%@(#) plottobas.m 1.1 05/07/13 10:29:36 % % function [cpil,hcpil]=plottobas(kedja,mminj,hcpil,cpil) hmain=gcf; userdata=get(hmain,'userdata'); startpos=userdata(105); delked=kedja(startpos:length(kedja),1); ldelked=length(delked); [right,left]=knumhalf(mminj); for i=1:ldelked, temp=find(right==delked(i)); ...
function ret = array2ihex (filename, x, word_size, offset) % TODO test with other word size % TODO more than 1 word per line if (nargin < 4) offset = 0; end if (nargin < 3) word_size = 4; end file = fopen (filename, 'w'); if (file == -1) ret = -1; return; end ret = 0; x = x(:); b = zeros (word_size, 1); ...
function [V,I] = readNODE(filename) % READNODE Read vertex positions from .node file, .node files are used by % Stellar and Triangle % % V = readNODE(filename) % % Input: % filename path to .node file % % Output: % V list of vertex positions % I list of indices (first tells whether 0 or 1 in...
function [eta_E2O, calc_res] = get_E2O_eta_lowP(res) % calculate E2O efficiency % res is a struct with everything from the saved mat file % % WTJ, 20190805 % %% data_narrowFSW_E2O= res.data_narrowFSW_E2O; P_twoTone = res.P_twoTone; % fswconfig = res.fswconfig; % wrong! not queried from FSW! fswconfi...
clc; clear all; close all; imaqreset; colorImg_save_path = 'live_demo_data\colorImg_live.mat'; metadata_save_path = 'live_demo_data\metadata_live.mat'; joints_positions_save_path = 'live_demo_data\live_data.txt'; colorVid = videoinput('kinect', 1) depthVid = videoinput('kinect', 2) depthSource = getselectedsource(de...
%% display_speed.m % % TODO: write short description of function % %% Help % % *USE* % % TODO: write longer description of function % % *INPUT VARIABLES* % % * |obj|: TODO: write description and info on variable % * |parenth|: TODO: write description and info on variable % % *OUTPUT VARIABLES* % % * |h_fig|: TODO: writ...
%% compute the expected reward with the Q learning rule %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % given: act_next predicted Q value % s_cur current state (input) % r_cur current actual reward % taskDone if the task is terminated % return: d...
function y=Recovery(I,T,A) [H W D]=size(T); for k=1:3 for i=1:H for j=1:W I2(i,j,k)=(I(i,j,k)-A)/max(0.1,T(i,j))+A; end end end y=I2;
function foo = draw_grid(hF,hA,Grid) gridSize = size(Grid); figure(hF); cla(hA); axes(hA); set(hF, 'CurrentAxes', hA); % set(hA, 'Color', [0 0 0]) %set(gca, 'Color', [0 0 0]); %set(hF, 'Color', [0 0 0]); %set(subplot(1,1,1), 'Color', [0 0 0]); surf(Grid, ... 'FaceColor...
function header = generate_header(pf, gf, mf) p = parse_header(pf); g = parse_header(gf); m = parse_header(mf); len1 = length(p); if( len1 <= 3 ) sp = ['P', p]; else sp = ['P',p(len1-2:len1)]; end len2 = length(g); if( len2 <= 3 ) sg = ['G', g]; else sg = ['G', g(len2-2:len2)]; end len3 = length(m); i...
function y=maxpat(x); % MAXPAT - Maximo de un conjunto de patrones % Copyright (c) Pedro L. Galindo (1998) if size(x,2)==1, y=x; else, y = max(x')'; end;