text
stringlengths
8
6.12M
% lats is a cell array, each item is a vector of latitudes for a given % path. Similarly for longs. % The route files were taken from .shp files from the Department % of Transport, converted to KML (e.g. in ArcMap). Only lines with % <coordinates> tags were kept, the tags were then removed and the Z % coordinates remov...
%This one requires running data from Non Learning condition cd('/home/raleman/Documents/internship/26') cd(nFF{3}) run('newest_load_data_nl.m') %ran=randi(length(p),100,1); sig1_nl=cell(7,1); sig1_nl{1}=Mono17_nl; sig1_nl{2}=Bip17_nl; sig1_nl{3}=Mono12_nl; sig1_nl{4}=Bip12_nl; sig1_nl{5}=Mono9_nl; sig1_nl{6}=Bip9_n...
function model = make_ref_model_slice_beam(za,az,pol,tilemodelboresightgain) model = zeros(length(za),1); phioffset = 0; if strcmp(pol,'ns') phioffset = pi/2; end for i=1:length(za) model(i) = 10*log10((1-sin(za(i))^2*sin(az(i)+phioffset)^2)*ground_screen_power_beam(za(i),...
function boundaries = importBoundaries(filename, varargin) persistent ip if isempty(ip) ip = inputParser; ip.FunctionName = mfilename; ip.addOptional('bbox' ,[429936,92169; 628999,280605],@(x) isnumeric(x) && isequal(size(x), [2,2])); end parse(ip,varargin{:}) bbox = ip.Results.bbox; % Load try [~,ma...
% fig2C: best clusters/cells? for an array of stim/motor regressors, GUI function hfig = figure; InitializeAppData(hfig); ResetDisplayParams(hfig); i_fish = 8; LoadSingleFishDefault(i_fish,hfig); %% regression with all regs % ResetDisplayParams(hfig,i_fish); setappdata(hfig,'stimrange',1:2); UpdateTimeIndex(hfig); i...
function ShowWielHoff() % function ShowWielHoff() % The Wielandt-Hoffman theorem. % GVL4: Theorem 8.1.4 clc fprintf('Wielandt-Hoffman Theorem\n\n') fprintf(' ||E||_F eig(A+E) \n') fprintf('-----------------------------------------------------------------------------------\...
%% heat maps 'heatmaps' clear close all load data filename variables_to_include pvalue % condition={'Acid','BHI','CSP','H2O2','O2','Paraquat','thermal'}; % for k=condition eval(['load ' filename '_tnorm.mat tnorm cdf']); %stoping point work on for loop below for j={'control','Control','wildtype','Wild Type','WT','wt'...
function u = uminus(a) % - Unary minus. % (Quaternion overloading of standard Matlab function.) % Copyright © 2005, 2010 Stephen J. Sangwine and Nicolas Le Bihan. % See the file : Copyright.m for further details. error(nargchk(1, 1, nargin)), error(nargoutchk(0, 1, nargout)) u = a; if ~isempty(u.w) u.w = -u.w;...
function [ns_RESULT, nsEntityInfo] = ns_GetEntityInfo(hFile, EntityID) % ns_GetEntityInfo - Retrieves general entity information and type % % Usage: % [ns_RESULT, nsEntityInfo] = ns_GetEntityInfo(hFile, EntityID) % % Description: % Retrieves general information about the entity, EntityID, from the file % referenced ...
% V es una matriz que en cada fila tiene uno de los individuos (pesos de la red) ordenados con el de mayor fitness primero % F es un vector con los fitness correspondientes a las entradas de V function [R] = r_1(V, F) global pc; global pm; global pbpp; global crossover_counter_total; global mutation_counter_total; glo...
function data_out = PolyExp_pipeline1(indata_src,indata_0_0,indata_0_1) %---------------------- width = 200; %---------------------- persistent rRam ctr; if isempty(rRam) p = fi([],1,72,0); rRam = zeros(1,width,'like',p); % rRam = zeros(1,width); ctr = uint8(1); end %---------------------- % DataTypeMode: Fixed-poi...
function pass = uq_Kriging_selftest(level) % PASS = UQ_KRIGING_SELFTEST(LEVEL): suite of non-regression and consistency % checks for the Kriging module of UQLab % % See also: uq_selftest_uq_metamodel %% initialize test uqlab('-nosplash'); if nargin < 1 level = 'normal'; % TBD: Time that the tests will take en...
function [dd, ds] = getFitData(this) ft = getFitTime(this); tt = nan(size(ft)); for i = 1:length(this.fields) df = this.fields(i); t = df.src.time; idx = ismember(ft, t); if isempty(t) d = ones(size(ft)) * df.curr.val(1); s = ones(size(ft)) * df.curr.std(1); else d = t...
function phclqclistatrw(varargin); % phclqclistatrw( [...] ); % QCL Istat rw h = timeplot({'QCLI_rw'}, ... 'QCL Istat rw', ... 'rw', ... {'QCLI\_rw'}, ... varargin{:} );
function artifactTimes = detectArtifacts(eegTime,eegDat,Fs,varargin) % artfactTimes = detectArtifacts(lfpTime,lfpDat,NAME,VALUE) % detects artifacts by: % a) Bandpass filtering the lfp trace at 50-400Hz, and marking % artifacts as those points >5*st.dev. from the mean artifactBand = ...
function [ Yw ] = generate_weak_learner( Xtrain,Ytrain) %UNTITLED2 Summary of this function goes here % Detailed explanation goes here Yw = ceil(10*rand(size(Xtrain))); Yw = ceil(10*rand(size(Xtrain,1),2000)); % for i = 1:size(Xtrain,2) for i = 1:2000 i kern_poly = @(x,x2) kernel_poly(x,x2,1); ...
function Ind = CoincidenceIndex(STR1, STR2) % Ind = CoincidenceIndex(STR1, STR2) % Inputs: STR1, STR2 = two strings of the same length % Output: Ind = thier incidence of coincidence. Count = sum(STR1==STR2); Ind = Count/length(STR1);
function varargout=calcClosedLoop %CALCCLOSEDLOOP Calculates the closed loop response of a linear system given %data with the modFreq, targetFreq, measured voltages, and times. addpath('..'); % % Load the closed loop data recorded using measureClosedLoopLinear % M = load('Closed loop response'); % % Load open loop pa...
function [hist_handle] = circadian_histogram(event_times, time_res) % function HIST_HANDLE = CIRCADIAN_HISTOGRAM(EVENT_TIMES, TIME_RES) % % Plot a circular histogram of events in time bins around the 24 clock. % % INPUTS: % % EVENT_TIMES: Vector of datetimes specifying event times. % % TIME_RES: Temporal resolution...
function [dest] = rotate_coeff(src, rotation, degree, dl) %%============================================================= %% Project: Spherical Harmonics %% Module: $RCSfile: rotate_coeff.m,v $ %% Language: MATLAB %% Author: $Author: bjian $ %% Date: $Date: 2007/12/27 06:23:36 $ %% Version: $Revi...
function basisobj = basis(fdtype, rangeval, nbasis, params) % BASIS Creates a functional data basis. % Arguments % FDTYPE ... a string indicating the type of basis. This may be one of % 'Fourier', 'fourier', 'Fou', 'fou', % 'Bspline', 'bspline', 'Bsp', 'bsp', % 'pol', 'p...
function [cAssignedEmployee rAssignedEmployee] = locate_employee(conflict,allele) %% LOCATE_EMPLOYEE % % Based on a conflict matrix, this function selects the candidate employee % to be assigned. % % Copyright (C) 2020 % % This program is free software; you can redistribute it and/or % modify it under the terms of the...
function f = Newton(x,y,x0) %求已知数据点的牛顿插值多项式 %已知数据点的x坐标向量:x %已知数据点的y坐标向量:y %插值的x坐标:x0 %求得的牛顿插值多项式或在x0处的插值:f syms t; if(length(x) == length(y)) n = length(x); c(1:n) = 0.0; else disp('x和y的维数不相等!'); return; end f = y(1); y1 = 0; l = 1; for i=1:n-1 for j=i+1:n y1(j) = (y(j)-y(i))/(x(j)-x(i)); ...
classdef al_objectClass %AL_OBJECTCLASS This class definition file specifies the % properties of an object that combines multiple objects % in one object % Properties of the object object % ------------------------------- properties gParam cannon circle keys ...
//hared GPL : Alg+ [Src] [WEIGHTED___] Gtp BASE___ :: MainGpl ; Gtp : DIRECTED___ | UNDIRECTED___ ; Src: Src2 SEARCH___ :: SrcProg; Src2 : BFS___ | DFS___ ; Alg : NUMBER___ | CONNECTED___ | STRONGLYCONNECTED___ | CYCLE___ | MSTPRIM___ | MSTKRUSKAL___ | SHORTEST___ ; %% // constraints NUMBER___ implies (Gtp and Src); ...
Im1=double(imread('test96.bmp')); Im1=imbinarize(Im1); h=[0,1,0;1,1,1;0,1,0]; Im1=imerode(Im1,h); Im1=imopen(Im1,h); [whiteMatrix, n]=bwlabel(Im1); Im2=not(Im1); [blackMatrix, n2]=bwlabel(Im2); figure(1), imshow(whiteMatrix) whiteProperties=regionprops(whiteMatrix,'all'); whiteProperties(1)=[]; blackProperties=regio...
function ss = outer_sum(xx,yy) %function ss = outer_sum(xx,yy) % compute an "outer sum" x + y' % that is analogous to the "outer product" x * y' % in % xx [nx,1] % yy [1,ny] % out % ss [nx,ny] ss(i,j) = xx(i) + yy(j) % Copyright 2001, Jeff Fessler, The University of Michigan if ~nargin, help outer_sum, end xx = xx(:...
function [Q, R] = zhouseqr(A) %compute the QR decomposition of square matrix A % A = Q*R; Q is orthogonal matrix and R is upper trigular matrix [m, n] = size(A); if m ~= n error('support squre matrix only') end temp = A; Q = eye(n); for k=1:n-1 [v, beta] = zhouse(temp(k:end, k)); reflector = eye(m-...
function A_matrix = rolling_constraint_matrix(disk_center_vel, dqdt) % Returns rolling constraint matrix (2 by 5) coeff_velx_dqdt4 = coeffs(disk_center_vel(1),dqdt(4)); coeff_velx_dqdt5 = coeffs(disk_center_vel(1),dqdt(5)); coeff_velx_dqdt6 = coeffs(disk_center_vel(1),dqdt(6)); coeff_vely_...
%----------------------------------------------------------------------- % Job saved on 13-Oct-2014 00:17:23 by cfg_util (rev $Rev: 6134 $) % spm SPM - SPM12 (6225) % cfg_basicio BasicIO - Unknown %----------------------------------------------------------------------- matlabbatch{1}.spm.tools.longit{1}.series.vols = '...
function plusfd = plus(fd1, fd2) % PLUS Sum of two functional data objects having the same basis. % Sum functional data object PLUSFD inherits the fdnames field of the % first argument. % last modified 1 July 1998 if ~(isa_fd(fd1) & isa_fd(fd2)) error('Both arguments are not functional data objects.'); end ...
function centroids = clustering_pc(points, NC) % points = matricea de coordonate a punctelor % NC = numarul de clustere dorite % centroids = centrele de masa ale clusterelor [m n] = size(points); % Se creeaza NC clustere conform regulei din cerinta for i = 1 : NC col = 1; for j = i : NC : m clusters(...
function out = gpuinvfourier(inp) % 1912.12302.B7 global lambda; global beta; b=beta; lb=lambda; n=gpuArray((-lb:lb-1)'); m=gpuArray((1:4*lb)); out=zeros(1,4*lambda,'gpuArray'); ip=inp(lb+1:3*lb); out=ip*exp(-(pi.*1i.*(m-2*lb-1).*(n + 0.5))./lb); %parfor m=1:4*lb % aa= % (m)=aa; %end out=out./b; e...
%%%assign all boutons to unique identification label function [boutonrevised] = placeholderarray(bouton) global CellThresholdParameter; global CellconnectivitySize; global CellSizeLengthParameter; global CellSizeDistance; global CellNumberofImages; global GaussianFilterRadius; global ConnectivitySize; glob...
addpath('..\'); for i =1:100 R(i)=1.7+(i)*0.01; energy(i)=myCO_func(R(i)); end plot(R,energy) %% title('Potential energy surface of CO') xlabel('distance') ylabel('Energy')
function Log_plot_helper2(option,response,no_of_nodes,no_of_paths,fill) global GUI start_time persistent not_ready blanks [current_nodes_states,current_node_activation_status,current_path_states,current_time]=data_decoder2(response,no_of_nodes,no_of_paths); if((option==0)||(not_ready==1))%initialize various his...
phns = ['E:\6-InputData\Calibrate_5_Peg\dvrk_Ground_Right.txt']; phns_IMU = ['E:\6-InputData\Calibrate_5_Peg\dvrk_IMU_Right.txt']; phns = ['E:\6-InputData\Calibrate_4_Range\dvrk_Ground_Right.txt']; phns_IMU = ['E:\6-InputData\Calibrate_4_Range\dvrk_IMU_Right.txt']; phns_Slave = ['E:\6-InputData\Calibrate_4_Range\dvr...
vocab=fileread('merged_vocab.txt'); vocab=strsplit(vocab); load merged_docword.csv x_fmt = merged_docword; % each row is different document. each column represents all possible words [U_svd,S_svd,V_svd] = svds(x_fmt); % svd n_dim = 2; % number of dimensions x_princ = U_svd(:,1:n_dim)*S_svd(1:n_dim,1:n_dim); % get...
function [syn,deltat,estParam,hyper_params]=synapse_xcorr_conv(Tlist,hyper_params) % syn_params(1) = latency % syn_params(2) = time constant % syn_params(3) = weight if isfield(hyper_params,'bin_width') bin_width = hyper_params.bin_width; else bin_width = .00002; end t = linspace(-hyper_params.coupling_times...
function [E,gradEbeta] = Eimage(Sbeta,Sopt,Sprior) I=Sopt.I; % log of image uu=Sopt.uu; vv=Sopt.vv; scalefac=Sopt.scalefac; theta0=Sprior.theta0; theta1=Sprior.theta1; [nrow,ncol]=size(I); C=curve_to_regions(Sbeta.beta,scalefac,nrow,ncol); x0=I(C==0); x1=I(C==1); E=-skewLogisticLikelihood(theta0,x0)-ske...
function output = normalizedCorrelation(image,kernel) kernelNormalized = normalization(kernel); imageSize = size(image); kernelSize = size(kernel); outputSize = imageSize-kernelSize+1; output = zeros(outputSize); for i = 1:outputSize(1) for j = 1:outputSize(2) normalizedImage = normalizatio...
classdef GaitDataForces properties % Force columns stored from the excel Time LGRFX LGRFY LGRFZ ToeOffPercentage end methods function obj = GaitDataForces(csvFileName) % Make sure the file exists here if (exist(csvFi...
function idx_pkts_collapsed = collapsePacketBoundaries(idx_pkts,grace_period) collapsed_start = idx_pkts(1,1); proposed_stop = idx_pkts(1,2); idx_pkts_collapsed = []; jj = 2; numrows = size(idx_pkts,1); while jj <= numrows % next packet within grace period if ( idx_pkts(jj,2) - proposed_stop ) <=...
%DriverBasic_LM function [pars optpars Init xhist error HR_LM] = Func_DriverBasic_LM(data,INDMAP) % clear all %close all %% Get nominal parameter values [pars,low,hi] = load_global(data, INDMAP); %Global parameters ALLPARS = pars; ODE_TOL = 1e-8; DIFF_INC = sqrt(ODE_TOL...
clc; clear; close all; %% Set Seed rng(0); %% Constants % Dimension of signal n = 256; % Number of experiments nexp = 100; %% Initialize Overcomplete Dictionary % DCT matrix dctmat = dctmtx(n); % Over-complete dictionary for cosine + spikes A = [dctmat eye(n)]; %% Varying sigma tic; % Initialize experiment results...
% Limpiamos nuestro ambiente de trabajo clear all clc % 4. Utilice Matlab (software) para graficar las funciones y explique: % a) x[n] = u[n] - 2u[n-1] + u[n-4] % Primero establecemos el número de muestras (tiempo discreto) n = -5:5; % habrá 11 valores discretos de tiempo % Para el primer término x1 = (n>=0); % Par...
function [center] = centroid(pts) % calculates the centroid of an arbitrary number of points % pts is a 1 to 3 - column matrix, where each row represents a new coordinate % column 1 = x, column 2 = y, column 3 = z center = zeros(1,size(pts,2)); % basically, all you do is average the coordinate values fo...
cd('F:\Jacket\data\raw\'); list=dir(); clc clear all close all format bank spike_files=dir('*.txt'); fid = fopen('F:\Jacket\data\euleranglesummary.txt','w'); fprintf( fid, '%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s\n','Applied angle','aX','aY','aZ','bX','bY','bZ','cX','cY','cZ','dX','dY','dZ'); for i = 1:length(spike_...
% function enco = huffman_encoder(sig, dict) clc clear % im = imread('/Users/INNOCENTBOY/Documents/MATLAB/pic/256/4.1.01.tiff'); % im = rgb2gray(im); A = [1,2,3;3,5,9]; B = A(:); %% UNIQUE a1 = A(:).'; a2 = sort(a1); a3 = diff(a2); a4 = a3 ~= 0; a4 = [true, a4]; C = a2(a4); %% BSXFUN , Calculating no of time a pix...
% general ED bose-hubbard code % last cleaned up 9/24/2018 % author: Matthew Rispoli close all clear all clc addpath('functions'); %load('plot_colormaps\alex_cmap.mat'); %cmapAlex=ccs; clear ccs; % tunneling J=38.1911/1000; %8Er tunneling rate; defined in Hz/(2 pi) % disorder strengths NW=10; Ws=li...
function singles = find_singles(celldatas) for cell_i = 1:length(celldatas) singles(cell_i) = ~isempty(strfind(celldatas(cell_i).cell_types,'SINGLE')); end end
function [f_sup]=afc_sup(X_sup,F,l); %USAGE [f_sup]=afc_sup(X_sup,F,l); correspondence analysis %Compute supplementary elements for % Correspondence analysis % need X_sup: the matrix of elements to compute % ALWAYS SUPPOSED TO BE ROWS!!! % F : the coordinates of the other set % (i.e.,...
%% Load and unpack data %Spliced file created in epoch splicing clear close all participant = 'A01'; load("Data/spliced" + participant); %% Getting it ready for classifier % % We need to grab the labels for each trial, multiply them by 3 and prep % % each component % % % % Set num to what kind of spat...
function [pos, neg] = demo2( ) %UNTITLED Summary of this function goes here % Detailed explanation goes here reqToolboxes = {'Computer Vision System Toolbox', 'Image Processing Toolbox'}; if( ~checkToolboxes(reqToolboxes) ) error('detectFaceParts requires: Computer Vision System Toolbox and Image Processing Toolbox....
function [x, NbIter] = romp(y, A, s, varargin) if size(varargin, 2) if iscell(varargin{1}) [checkArgs, MaxNbIter, TolRes] = parse_Varargin(varargin{1}); else disp('USAGE: ''parameter_name'', paramenter_value pairs expected in a cell.'); disp(['Ignoring arguments:...
for ci=1:numel(subj) eval([subj{ci} '_sERP=mean(' subj{ci} '_sEEG,3);']); eval(['X=' subj{ci} '_sERP;']); for ch=1:size(X,1) p=find_chirplets(X(ch,:),1,2,64,0); chirp_param(:,:,ch)=real(p); cEEG(ch,:)=real(chirplets(64,p)); end eval([subj{ci} '_cERP=...
function varm=varmat(mat) % takes a 3d matrix and returns the variance along the % first dimension % usage: varm=varmat(mat) for coln=1:size(mat,2) varm(coln,:)=var(squeeze(mat(:,coln,:))); end
clear all close all plotN = 10; col = jet( plotN )'; col = col*0.95; %% Grandma's soo MAADLAB, yeah! %% What parents expects: %parameters Fs = 44100; T = 4; %generate stuff t = 0:1/Fs:T; s = chirp( t, 50, T, 5000 ); %this is what she expets to hear: %sound( s*0.1, 44100 ); %Turn down for what? Eh ok. %or as a plo...
% HW 4 problem 3 % Last Edited Sept 28 2013 f = [1 -3 -10 27 10 -24]; a = roots(f); fprintf('\nThe roots are %.3f, %.3f, %.3f, %.3f, %.3f\n',a); x = -4:.1:4; plot(x,x.^5-3.*x.^4-10.*x.^3+27.*x.^2+10.*x-24); axis([-4 4 -10 60]); grid on figure(1)
function [ pikovi ] = udarci(treshold,signal_1,signal_2,signal_3,signal_4) %Trazimo odnos prvog signala u odnosu na sve % odnos=[]; for i=1:length(signal_1) odnos(i,1)=i; odnos(i,2)=signal_1(i)/signal_2(i); odnos(i,3)=signal_1(i)/signal_3(i); odnos(i,4)=signal_1(i)/signal_4(i); end pikovi=[]; v=1;...
function res = opdracht_5_versie_3_CHECK(apStudentSol) %%========== PLACE SOLUTION IN COMMENTS HERE % % % % % % % % % % % kniehoekHardloper = [61 9 62 118 87 104 131 46 105 123 61 74 92 66 26 32 58 3 106 9]; % % % % % % % % % % % indKniehoeken = find(kniehoekHardlop...
function y = mat2huff(x) %MAT2HUFF Huffman encodes a matrix. % Y = MAT2HUFF(X) Huffman encodes matrix x using symbol probabilities in % unit-width histogram bins between X's minimum and maximum values. The % encoded data is returned as a structure Y: % Y.code The Huffman.encoded values of X, stored in a uint16 vect...
function indices=strmatch_array(pattern_list,search_list,force_error_on_NotFound) if nargin<3, force_error_on_NotFound=[]; end; if isempty(force_error_on_NotFound), force_error_on_NotFound=true; end; if iscell(pattern_list), N=length(pattern_list); else N=size(pattern_list,1); end; if iscell(search_list),...
function [ output_args ] = SizeLimit( value,min,max ) %SIZELIMIT 此处显示有关此函数的摘要 % 此处显示详细说明 if(value<min) output_args=int32(min); else if(value>max) output_args=int32( max); else output_args=int32(value); end end
%{ load('ex8data1.mat'); [m, n] = size(X); [mu sigma2] = estimateGaussian(X); pval = multivariateGaussian(Xval, mu, sigma2); epsilon = min(pval) + (max(pval) - min(pval)) / 1000; my = pval < epsilon; tp = sum((yval == 1) & (my == 1)); fp = sum((yval == 0) & (my == 1)); fn = sum((yv...
function hourlyClearnessIndexes = synthesiseHourlyClearnessIndexes(time, location, dailyClearnessIndexes, varargin ) % SYNTHESISE_HOURLY_CLEARNESS_INDEXES Synthesises a sequence of hourly clearness % indices (Kt) using the mean daily clearness index and the time-dependent, % autoregressive, Gaussian (TAG) model [1] ...
function [Iout1,param1] = CDLMRI(Img, Q, sigmai,sigma,DLMRIparams) % ========================================================================= % Coupled Dictionary Learning for Multi-contrast MRI Reconstruction % ========================================================================= % %The software is used to ...
function [classifier, classifierLabel] = classifierProcessing(classifierSelect, aggregatorSelect, trainingDataStruct, dimReduct) switch classifierSelect.name case 'kNN' if ~isfield(classifierSelect, 'k') classifierSelect.k = 5; classifierSelect.distanceMetric = '...
function [fitresult, gof] = createFit_LOESS(x1, x2, y) %CREATEFIT1(X1,X2,Y) % Create a fit. % % Data for 'LOESS_fit' fit: % X Input : x1 % Y Input : x2 % Z Output: y % Output: % fitresult : a fit object representing the fit. % gof : structure with goodness-of fit info. % % See a...
% Algoritmo di Cooley-Tukey per il calcolo della FFT (direct call) % % Descrizione: % Calcola la DFT di un vettore x di dimensione n=p^t utilizzando l'algoritmo % di Cooley-Tukey e il metodo della chiamata diretta per il calcolo dei % twiddle factors. % % Uso: % X = dcctfft(x) % % Parametri di ingresso: % x:...
function D = BuildDiffusionMatrix2Periodic(parts,Eta_m,Kappa,kT,boxSize) % coder.extrinsic('bessely'); % coder.extrinsic('besselj'); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Build the full diffusion matrix for all of the paticles %@in parts : Nx2 - particle position array %@in Eta_m me...
PsychRTBox('CloseAll');
function [V, I, S, DeltaPhase, SE] = subsetEPFLdata(NumPMU, MeasIdx, SelectedPhase, PCC, DATA) % Extract a desired subset of data from the preloaded set of EPFL data % % Args: % NumPMU: number of PMU % MeasIdx: indices of measurement to extract % SelectedPhase: phase to extract from the 3-phase data % PCC: inde...
function MUA_population_sizecohere % % PV Halo population % animalids = {'150730', '150731', '150804', '150818', '150820', '150824', '151104'}; % blocks = [4, 3, 4, 3, 3, 3, 5]; % animal = [1, 2, 3, 4, 5, 6, 7]; % cen...
%load data_users [avg_prevalent_freq, std_prevalent_freq] = calculate_prevalent_freq(data, fs); hold on; eixo = 3; %% join dynamic static in group avg_static = 0; std_static = 0; for at = 4:6 avg_static = avg_static + avg_prevalent_freq(at,eixo); std_static = std_static + std_prevalent_freq(at,eixo)^2; end av...
clear all T=readtable('../Summary_Data_800_Gals/PatientInfo07132021.csv'); load('../Summary_Data_800_Gals/summary.mat','uniqueTimes'); hut_possibles=cell(872,1); count=1; c=0; for pt=3:872 T{pt,1}{1} if (isfile(strcat('/Volumes/GoogleDrive/Shared drives/REU shared/LSA/HUT/',T{pt,1}{1},'_HUT_WS.mat')) && an...
function BS = bezierOneSub (B,t) % Opis : beziersub izvede subdivizijo Bezierjeve krivulje %%Definicija : % BS = beziersub (B,t) %%Vhodni podatki : % B matrika kontrolnih tock Bezierjeve krivulje , v % kateri vsaka vrstica predstavlja eno kontrolno % tocko , % t parameter subdivizije Bezierjeve krivulje %%Izhodni podat...
% assinging a vector to A A = [ 4 5 3 7 ]; % assigning empty vectors to B and C B = []; C = []; % loop to find the distance for i = 1 : length(A) % loop to find the distance for each row a number at a time for j = 1 : length(A) C(j) = abs(A(i)-A(j)); end % concatinating C to the next rom of B ...
PRE_Points; k=4; RUNS = 100; NumOfReps = 32; hitCONN = zeros(RUNS,1); NumOfEdgesCONN = zeros(RUNS,1); for run=1:RUNS PRE_Points; RUN_Points(X, 'kmeans+CHL', NumOfReps, false, false, false,'CONN','CostDBIOverLambdaPCA',k); POST_Points; hitCONN(run) = hitrate; NumOfEdgesCONN(run) = NumOfE...
function C = new_center(cluster_n, class_n, data, m, U) %C = zeros(cluster_n,size(data,2)); for i = 1:cluster_n b = zeros(1,size(data,2)); c = 0; for j = 1:class_n a = sum(data((j-1)*32+1:j*32,:)); b = b + (U(i,j)^m)*a; c = c + U(i,j)^m; end C(i,:)...
file_dir = './orl_faces'; w = 92; h = 112; n = 40; data = zeros(n * 10, w * h); k = 1; for i = 1:n for j = 1:10 name = [file_dir, '/s', int2str(i), '/', int2str(j),'.pgm']; pic = imread(name); d = reshape(pic, 1 , w * h); data(k, :) = d; k = k + 1; end end X = zeros(n * 7, w * h); k = 1; for i = 1:n for...
%Read an Image A(Template) A1 = imread('benten.jpg'); %Read the Target Image B1 = imread('watch.jpg'); A = A1(:,:,1); B = B1(:,:,1); normx_corrmap=normxcorr2(B(:,:,1),A(:,:,1)); maxptx = max(normx_corrmap(:)); [x1,y1]=find(normx_corrmap==maxptx); figure, imagesc(A1(x1-size(B,1):x1,y1-size(B,2):y1,:)...
function [Ans] = Flags(NotePos, Staffline, BW) ImageBW = RemoveHorizontalLines(BW,4); imshow(ImageBW) Xpos = round(NotePos(1,1)); Ypos = round(NotePos(1,2)); if(Staffline <=12) SmallBW = ImageBW(Ypos+15:Ypos+25, Xpos-10:Xpos+10); imshow(SmallBW); else S...
% Intrinsic and Extrinsic Camera Parameters % % This script file can be directly executed under Matlab to recover the camera intrinsic and extrinsic parameters. % IMPORTANT: This file contains neither the structure of the calibration objects nor the image coordinates of the calibration points. % All thos...
%% Winer take all classifer for solvable subjects % Combining three classifers. clear; clc; %% First, Find subjects that are solvable for all labels type = 'HF'; solvableSub = find(solvAll(type) == 1); numSub = size(solvableSub,2); %% Computs HIT / FALSE % Get a solvable subject for i = 1: numSub subNum = s...
function out = get_condor_job_text_output(filename, idx, condor_session_obj, tail_num_lines) job_list = kv_get('job_list', condor_session_obj); task_dir = get_parent_dir(job_list{idx}); text_file = [task_dir filesep filename]; if(exist('tail_num_lines','var')) cmds = {'tail -n', num2str(tail_num_lines), text_fil...
# Plot the matrix factorization error versus iterations load 'error.mat' plot(error); title('Matrix approximation error versus # iteration'); print -djpg 'error.jpg';
function x_boot = Get_boot(data, n_boot) %data = imgobj.dFF_s_each(:,:,k) n_data = size(data, 2); x_boot = zeros(n_boot, n_data); %remove NaN resample data parfor i = 1:n_data x = rmmissing(data(:,i)); if length(x) >= 2 x_boot_ = bootstrp(n_boot, @mean, x); else x_boot_ = repmat(max(x), n_...
%Plots cdf of messages fwd per node, for stealth and normal [norm1 norm2 norm3 data1 data2 data3] = normvsstealth(); f = figure('Position', [200 200 658 420]); set(f,'defaultaxesfontsize', 14); nodefwds = [data1.nodefwds; data2.nodefwds; data3.nodefwds]; [y, x] = ecdf(nodefwds); semilogx(x, y, 'k-', 'LineWi...
function [ A,observe,truth ] = makeSBM(n,m,Lam) % [ A,observe,truth ] = makeSBM(n,m,Lam) % makes a realization from stochastic block model % coordinates of (vector) n are number of nonseeds in the blocks % coordinates of (vector) m are number of seeds in the blocks % Lam is the communication matrix % A is adja...
function [isCollided] = isRobotCollided(q, map, robot) % ISROBOTCOLLIDED Detect if a configuration of the Lynx is in collision % with any obstacles on the map. % % INPUTS: % q - a 1x6 configuration of the robot % map - a map strucutre containing axis-aligned-boundary-box obstacles % robot - a structure...
function l=zad3_vapour_heat_Carruth(t,tc,omega) R=8.3144; %Reduced temperature tr=t./tc; %Equation l=R.*tc.*(7.08.*(1-tr).^0.354+10.95.*omega.*(1-tr).^0.456);
%% Plot for force feeback % Position tracking from=1;%7859; to=length(time);%14000; time_fix=time-time(from); hold on; refp = plot(time_fix(from:to),ref(from:to),'r', 'LineWidth',2); currentp = plot(time_fix(from:to),current(from:to),'b'); currentp.Color(4) = 0.4; legend('Referencia','Corriente'); xlabel('Tiempo (s)');...
function [success] = convertInscopixIsxdToHdf5(inputFilePath,varargin) % Converts Inscopix proprietary ISXD to HDF5. % By default all dropped frames are included in the output as a frame full of zeros. % Biafra Ahanonu % started: 2019.01.15 [21:17:45] % inputs % inputMoviePath - char: path to ISXD file. % outpu...
function [A,B,b0] = linear_constraints(model,V,s) [a,b,~,~]=vert2lcon(V); a(abs(a)<1E-6) = 0; b(abs(b)<1E-6) = 0; a = round(a); order = [1 0 0; 0 1 0; 0 0 1; -1 0 0; 0 -1 0; 0 0 -1]; A = zeros(size(a)); B = zeros(size(b)); if isempty(s) b0 = zeros(6,1); else ...
% calculate PDC function pdc = PDC(X, m, fftlen) if ~exist('fftlen','var') fftlen = 1024; end [p, len] = size(X); covz = getcovzpd(X, m); [A2d, D] = ARregressionpd(covz, p); pdc = PDC_A(A2d, D, fftlen);
%%%% This file generates voxels and initial centerline from image %%%% % Input: *.stl format image % Output: VolumePixel % (OUTPUTgrid: 3d binary matrix, where 1: object, 0: background; % gridCOx, gridCOy, gridCOz: x,y,z coordinate) % skeleton (skel: binary matrix, where 1: centreline, 0: other...
% This function is used to calculate (d cosh(alpha))/(d r). function f = dcoshalphadr(R,r,theta) f = 4*R.^2.*r.*(R.^2-r.^2).*sin(theta).^2./(R.^2+r.^2).^3.*(1-(2*R.*r.*sin(theta)./(R.^2+r.^2)).^2).^(-1.5); end
function self=zeros(self,dim,m) assert( isscalar(dim) && isscalar(m) ); assert( dim>0 && m>0 ); self.dim=dim; self.m=m; self.H=cell(m,m); end
function fermi_filter_isodim2_memfix_obj(large_array,w1,w2,bool_2D_mode,output_field) % ------------------------------------------------------------------------- % function fermi_filter_isodim2_memfix_obj(large_array,w1,w2,2D_switch) % kspace_filter(iraw) generates the 3D filtered kspace image. Only filter % function ...