text
stringlengths
8
6.12M
function [hdr, data] = datread(filename, channels) fid = fopen(filename, 'r'); header_length = fread(fid, 1, 'int16=>int16'); jsonraw = fread(fid, header_length, 'char=>char'); hdr = jsondecode(jsonraw); if nargin < 2 || isempty(channels) channels = 1:length(hdr.labels); end if isa(channels, 'double')...
%%Testing the animate function with different initial conditions here: clc; clear; clf; close all; q0 = [pi/6;-pi/3;-pi/10]; dq0 = [0;0;10]; num_steps = 10; sln = solve_eqns(q0,dq0,num_steps); animate(sln);
function add_entry_log(message,value) %ADD_ENTRY_LOG adds a message, a descriptor and writes a log if exist('../outputFigures/log_results.mat') load('../outputFigures/log_results.mat'); %Get length of the log record_number=size(log_results,1); else log_results={}; record_number=0; end log_re...
% ---------------------------% % Código para o trabalho 3 1 % % ------------------------- % close all clc clear [ha, pos] = tight_subplot(9,3,[.01 .03],[.1 .01],[.01 .01]); filtros = {'average','disk','gaussian', 'laplacian', 'log','motion','prewitt','sobel'}; imagesNames = {'berlindes','floresFruta','fruta zoom'};...
%DEMO_BESSELWAVE_FIGS Bessel wave system is solved as a two-parameter % eigenvalue problem with Chebyshev collocation and eigenmodes are plotted % % This example reconstructs eigenmodes in % Lew Yan Voon & Willatzen, Helmholtz equation in parabolic rotational % coordinates: application to wave problems in quantum m...
con = [c1;c2;c3;c4;c5;c6;c7;c8;c9;c10]; con2 = zeros(1,19) for i=1:size(con,1) con2(con(i,1)) = con2(con(i,1))+1; end [out,idx] = sort(con2,2,'descend') %3,6,11,12,8
clear all, close all N = 200; x = 10*(rand(N, 1)-.5); x = sort(x); y = sinc(x) + randn(N, 1)*.1; S = {}; for i = 1:length(x) dnew = [x(i) y(i)]; thres = .01; N = 15; kernel_pars = [.4, .2]; [S, update, ix_update] = incr_online_sparsification(dnew, thres, N, kernel_pars, S, 0); end hyp = log([.4, 1, .1]); options...
%% all two-prime sums ps = primes(100); n_ps = length(ps); sums = []; for ii = 1:n_ps for jj = (ii+1):n_ps sums(end+1) = ps(ii) + ps(jj); end end %% all_sums = 4:1:198; sums_dedup = unique(sums); sums_dedup = [sums_dedup, 199]; % find jumps in sums_dedup diff_sums_dedup = diff(sums_dedup)...
function [xFullData, yFullData, xFit, yFit, xIsoResponseContrast, yIsoResponseContrast, ... phaseDegs, peakModulation, baserate] = ... fitCosineToLMplaneResponses(LMresponseMagnitude, LMangles, isoResponseLevelPercentOfMax) x = LMresponseMagnitude .* cosd(LMangles(:)); y = LMresponseMagnitude .* sind(L...
function A4_Gain_Matrix % Subtract Bias (Offset, which can be different for various blocks/sessies % This removes noise (artificial variation when data is combined, e.g. in % one set you start from +10 and another time you start at +3, when % combining sets, the responses will be distributed largely. But when the...
% --------------------Hirerichal Clustering ERP data ------------------ % The ERP data has well structure for clustering time sammples and % channnels 500x58 we applied Matlab clustering function on this dataset function [H_ERP]=Hierarchical_GAERP(x,k) % x is grand average data e.g. 4800 (observation )x30 (fea...
function [ SpectralCrestVec ] = SpectralCrest(samples, blockSize, hopSize ) %This function calculates the Spectral Crest for each block and returns %a row vector. L = length(samples); n = 1; SpectralCrestVec = []; index = []; for n=1:hopSize:L-blockSize currentBlock = samples(n:n+blockSize-1); fftCurre...
function plotISegment(p, i, j, map) % plot the jth segment from a segmented point-set % INPUT: % p: segmented point-set; columns 1:3 correspond to point coordinates % column 4 corresponds to the label; size is N x 4 % j: index to the segment to be plotted % i: index of the point in p max_index = max(p(:,...
function pc = Find_Landings_MultipleFrameIntervals(InputTrace,MultipleFrameIntervals,UpThreshold,DownThreshold,MinUpFrames,MinDownFrames) % %function Find_Landings_MultipleFrameIntervals((InputTrace,MultipleFrameIntervals,UpThreshold,DownThreshold,MinUpFrames,MinDownFrames) % % Will delineate high and low intervals in ...
function [target, R0, t0 , error]= align(iter, source, ts, tole) numP = size(source,1); R0 = eye(size(source,2)); t0 = zeros(1,size(source,2)); target = ts; for i = 1 : iter p = selectSubsetFromSource(source, numP); q = findCloestPairs(p, target); ...
function [phis, cdf, phiplot, cdfplot] = samplecdf(thetas, resolution) % [phis, cdf, phiplot, cdfplot] = circ.samplecdf(thetas, resolution) % % Helper function for circ.kuipertest. % Evaluates CDF of sample in thetas. % % Input: % thetas sample (in radians) % resolution resolution at which the...
function [bool]=verificacionSalSIL(x,y) [x1 y1 x2 y2 x3 y3]=cteSalSIL; bool=triangulo(x1,y1,x2,y2,x3,y3,x,y); end
%% Creating C++ Shared Libraries and DLLs % Guest blogger % <http://www.mathworks.com/matlabcentral/fileexchange/authors/4660 Peter Webb> % returns with another in an % <http://blogs.mathworks.com/loren/category/deployment/ occasional series> % of postings about application deployment. %% % A previous post demons...
function index_subnet = gen_subnetwork(G,k); %input G = adjacent matrix representing network; %k = size of subnetwork ( number of nodes in subnetwork) %G = [1,0,0,0,0,1,1,0;0,0,0,0,0,1,1,0;0,0,0,0,0,1,1,0;0,0,0,0,0,1,1,0;0,0,0,0,0,1,1,0;1,1,1,1,1,1,1,1;1,1,1,1,1,1,1,1;0,0,0,0,0,1,1,0;] %G = [0,1,1,0,0,0; 1,0,0,0,0,1;1...
alpha = 0; cl = VarName4/(cos(alpha))^2; projectionLength = 1; % flowSpeed = 5.85e-2; flowSpeed = 0.15*cos(alpha); dt = 0.02; % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% time = Forcecoefficients; %%%% relNums = cl; %%%% ...
function visualize_point_process(data_matrix, vis_args) if nargin < 2 vis_args = struct(); end plot_data = []; [num_streams, data_length, num_trials] = size(data_matrix); for tidx = 1:num_trials data_one = data_matrix(:, :, tidx); data_pp = point_process2interval(data_one', 1); for ppidx = 1:le...
column = length(tr_x(1,:)); features = []; warning('off','all'); training_total_accu = zeros(10,1); test_total_accu = zeros(10,1); for choices = 1:10 bestaccu = 0; bestchoice = 0; for i = 1:column if sum(features == i) == 0 fc = [features,i]; b = glmfit(tr_x(:,fc),trainsurviv...
function x=menounotriangsup(b) n=length(b); x=zeros(n,1); x(n)=b(n); sum=0; for i=n-1:-1:1 x(i)=b(i)+x(i+1)+sum; sum=x(i+1)+sum; end end
function xor_example % Toy example of the solution of the XOR problem using kernels and SVMs addpath('../libsvm/'), addpath('../simpleR/'), rng(1); C = 0.1; % Complexity parameter sigma = 0.5; % Kernel parameter c = [ 1 -1 -1 1 ; 1 -1 1 -1 ]; % Centers of the 4 clusters % Generation of 400 datapoints x = [ repma...
function coeffMatrix = d2fdx2FiniteDifferencePeriodicMatrix(f,h,dim) %D2FDX2FINITEDIFFERENCEPERIODICMATRIX finds the coeff matrix for the second finite difference on a periodic uniform grid. % COEFFMATRIX = D2FDX2FINITEDIFFERENCEPERIODICMATRIX(F, H, DIM) % Creates the coefficient matrix, COEFFMATRIX which is sparse, to...
%Import data to table & format T = readtable('Canada_CO2_Emissions_per_Capita.xlsx','Range','C51:D219'); header = {'Year','Canada CO2 Emissions per Capita'}; T.Properties.VariableNames = header; %Create and fill the variables required year = T{:,1}; emissions = T{:,2}; %Determine the training and test size trainingSz =...
clear clc prefix = '/home/pzhang/chen/move-bed/'; middle = 'test_move'; color = {'b*','k*','r*'}; for iii=1:3 for i = 1:84 name = strcat(prefix,middle,num2str(iii),'_',num2str(i,'%04d'),'.h5'); pos = h5read(name,'/Pposition'); nx = h5read(name,'/Nx'); ny = h5read(name,'/Ny'); Np = numel(pos)/6; ...
function cps = energyflow_set(cpsin) % ====================================================================== % Syntax: cps = energyflow(cpsin) % Description: sets energy .w according to planned power .p and efficiency .eta in cps struct-array and resets planned power to zero % % IN: cpsin: structure array...
function f = pow(x,n) %Calcola x^n z=x; for i=2:n z=z*x; end f=z; end
function [D D_MOE Pop] = LoadCtyxCty(fname, FIPS) N = size(FIPS,1); D = zeros(N,N); D_MOE = zeros(N,N); Pop = NaN(N,1); fid = fopen(fname,'r','n','ISO-8859-1'); l = fgetl(fid); i = 0; disp('Loading flow matrix...'); while ischar(l) if (mod(i,1000)==0) disp([' ' num2str(i/275829*100) '%...']); end ...
% imOut = GAUSSIANCONV(image_path, sigma_x, sigma_y) % % Convolves an image with a gaussian in the x and y direction. % Uses the GAUSSIAN function to the create the gaussians and uses % the CONV2 function to convolve the image with the 'same' parameter. % % The image is converted to a gray image. % % Parameters are: % ...
clear; clc; close all; plotDefaults; getPaths; % if input('Clear previous runs?: '); rmdir([rootPath '/stim/'],'s'); rmdir([rootPath '/log/'],'s'); rmdir([rootPath '/resp/'],'s'); rmdir([secondaryPath '/resp/'],'s'); rmdir([secondaryPath '/stim/'],'s'); mkdir([rootPath '/stim/']); mkdir([ro...
classdef PulseTrainRIB2 < FormatRIB2 & PulseTrain % PulseTrainRIB2 < FormatRIB2 & PulseTrain % % Single-electrode pulse train class for MedEl devices, using RIB2 software. % % Triggering: There is the option to send a TTL trigger before each pulse, % before first pulse, or to never send a trigger. ...
syms x y(x) eq=diff(y,3)-diff(y,2)/x; y=dsolve(eq==0)
NC=length(data); Qdim=8; dim=1; D=24; %obsTypes{1}.idx=[15,16]; %obsTypes{1}.dist='mvn'; obsTypes{1}.idx=[1:24]; obsTypes{1}.dist='poisson'; %obsTypes{2}.idx=9; %obsTypes{2}.dist='gamma'; % obsTypes{1}.idx=13; % obsTypes{1}.dist='gamma'; % obsTypes{2}.idx=14; % obsTypes{2}.dist='normal'; model = mixHHMM(NC,Qdim,dim,D,...
function guiVisualiseAnalysis(pts, face_Mask, nose_FaceMask, ... prn_FaceMask, n_FaceMask, sn_FaceMask, lal_FaceMask, ral_FaceMask) %Wizualizuje wyniki analizy obrazu twarzy. hold on; xlabel('x [mm]'); ylabel('y [mm]'); zlabel('z [mm]'); try guiDraw3d( pts(~face_Mask,:), 1, 'k'); catch end; ...
function y = callback_active_contour(x, options) % callback_active_contour - callback for conjugate gradient % % y = callback_active_contour(x, options); % % Copytight (c) 2007 Gabriel Peyre % norm of gradient dt = options.dt; n = options.n; d = options.d; x = reshape(x,n,n); y = divgrad( divgrad(x,options)./r...
%% ========= test data analysis ======== %% %% Initialization clear ; close all; clc; % Loading data for analyisis fprintf('Reading train.csv ... \n'); [X, Xlab, y]=loadData; %number of examples m=size(X,1); %number of features nf = size(X,2); % id = X(:,1); % %y = [ raw{[2:m],mf} ]; % %% plot a histogram of the price...
%{ Description: The EM Algorithm Inputs: seg : The segmented image img : The original corrupted image mask : The background mask k : The number of classes mu : The class means sigma: The class std devs beta : The tunable penalty value eps_EM : Specifies the stopping con...
hold on; plot(1.3,3.3,'Marker','h','MarkerEdgeColor','b','MarkerFaceColor','w','MarkerSize',13,'LineWidth',2) plot(1.5,1.8,'Marker','h','MarkerEdgeColor','b','MarkerFaceColor','w','MarkerSize',13,'LineWidth',2) plot(8.2,7.8,'Marker','h','MarkerEdgeColor','b','MarkerFaceColor','w','MarkerSize',13,'LineWidth',2) % pl...
function [analyses,params] = correlations_distance_count_2(analyses,params) corr_edges = -1:0.2:1; dist_edges = 0:50:500; %um params.corr_edges = corr_edges; params.dist_edges = dist_edges; num_perm = 250; normal = 'probability'; % upper_part = triu(ones(params.numROIs,params.numROIs),1); % upper_part(upper_part==0) ...
function y=rect(t) y = ( sign(t+0.5) - sign(t-0.5) >0); endfunction
function xls_text() CSV = { 'Subject', 'Sentence Order', 'Noun', 'Adjective', 'Stimulus File Name', 'Button press?', 'Reaction Time' }; CSV(size(CSV,1)+1,3) = { 'R'} ; CSV(size(CSV,1),6) = {'yes for beginning of reverse' }; ix=cellfun('isempty',CSV); CSV(ix)={' '}; %xlswrite(strcat('data_','.xls'),char(CSV)) %does no...
%%%% mex -output Chemostat_gmam_mex gmam.c Chemostat.c Chemostat_gmam_mex.c %% Model parameters alpha1 = 2.0; alpha2 = 3.0; ey = 1e-3; pars = [alpha1, alpha2, ey]; %% fixed points xfp = alpha1*(alpha2 - 1/(alpha1 - 1)); yfp = 1/(alpha1 - 1); xS1 = 0; yS1 = alpha2; %% GMAM parameters Npnts = 500; % number of (interior...
function [x,y,z]=cell_basis(obj,j1,j2,j3) a0=0.5431/sqrt(2); x=a0.*[1; 0; 0]; y=a0.*[0; 1; 0]; z=a0.*[0; 0; 1]; X=(j1.*x+j2.*y+j3.*z)/obj.arrays_sizes; x=X(1)-obj.coord_limits(1)-obj.coord_stps; y=X(2)-obj.coord_limits(1)-obj.coord_stps; z=X(3)-obj.coord_limits(1)-obj.coord_stps;
clear all; close all; clc; addpath(genpath('../../eval_package')); addpath(genpath('../../TSC')); addpath(genpath('../../mexIncrementalClustering')); %% evaluate script dataset = '/home/yzhang/Videos/Dataset_CMUMAD'; % subject = 1:20; subject = 5; feature = 'FV2'; method_set = {'ACA'}; for mm = 1:length(method_set)...
function [wlx whx Yscale]=dtwavexfm3(X,nlevels) %does a 3-D DTCWT global xa ya h0o h1o g0o g1o h0a h1a g0a g1a yscale % load3D_xa('sphere'); xa=X; ya={}; yscale=cell(nlevels,1); if any(rem(size(xa),2^nlevels)) ext_mode = 8; % 8 means ...
function H = SRD_dynamics_derive_JSIM(varargin) Parser = inputParser; Parser.FunctionName = 'SRD_dynamics_derive_JSIM'; Parser.addOptional('SymbolicEngine', []); % Parser.addOptional('Symbolic_UseParallelizedSimplification', false); Parser.parse(varargin{:}); if isempty(Parser.Results.SymbolicEngine) error('Pleas...
function [ b ] = b_cont( obs, miu, sigmas, c ) % b(s, t) - the density for a HMM % with continuous density functions = mixture of normals; % for a given set of observations; for state s at time t % miu - matrix of means: % [(means for dim d, comp_k)_state1, (means for dim d, comp_ks)_state2 ...()_state_s...] % ...
% mpDecay.m N0 = 1e5; % initial number of atoms lambda1 = 0.0001; %decays/s lambda2 = 0.00005; dt = 100; % time step (in seconds) M = 1500; % total number of time steps t = 0:dt:(M-1)*dt; % time series p1 = lambda1*dt; % probability of having a decay in the time dt p2 = lambda2*dt; % Define the array that will be po...
function AMPX_get_plane_angle_hist(data_out) l_angle = data_out.lg.power.stats.theta; lr_angle = data_out.lg_ran.power.stats.theta; h_angle = data_out.hg.power.stats.theta; hr_angle = data_out.hg_ran.power.stats.theta; [n1, p1] = hist(l_angle, 25); [n2, p2] = hist(lr_angle, 25); [n3, p3] = hist(h_angle, 25); [n4, p...
function ProjectCode() global SAMPLE_PERIOD PEAK_THRESHOLD VOLUME_THRESHOLD SUBDIVISIONS ... BEAT1_THRESHOLD DECAY BEAT_LENGTH SHEET_MUSIC; SAMPLE_PERIOD = 0.1; % Length of time that frequency is sampled over PEAK_THRESHOLD = 0.06; % Cutoff amplitude for peak detection VOLUME_THRESHOLD = 300; % ...
%MIT License %Copyright (c) 2019 Sherman Lo %SCRIPT: PLOTTING LOG LIKELIHOOD %Plots the log likelihood as a function of alpha and beta for fixed lambda clearvars; close all; %random seed rng(uint32(3270361853),'twister'); n = 100; lambda = 1; alpha = 1; beta = 1; [X,~] = CompoundPoisson.simulate(n,lambda,alpha,bet...
function d=getDilatedcalP2X7(y) d=y(:,7)+y(:,8)+y(:,24)+y(:,23); end
function cp_ptp = cal_cp_ptp(cp_name, ts, l1, l2) % CP + PTP Trajectory Calculation % % [Inputs] % cp_name : CP trajectory name ('circle', 'spiral', 'smile', 'ml_logo') % ts : sample rate [msec] % l1 : link1 length [m] % l2 : link2 length [m] % [Outputs] % cp_ptp : CP + PTP t...
% --- Executes on button press in pushbutton_addFilter. function pushbutton_addFilter_Callback(hObject, eventdata, handles) % hObject handle to pushbutton_addFilter (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) list_entr...
%% plot phase portrait of the FollowerStopper on 2D plane (d_rel, v_rel) clear all clc %% d_rel = 0:1:50; v_rel = -10:1:10; [XX,YY] = meshgrid(d_rel,v_rel); vec_x = zeros(size(XX,1),size(XX,2)); %\dot{v_{rel}} vec_y = zeros(size(XX,1),size(XX,2)); %\dot{d_{rel}} vehicle_speed = 15; accel_lead = 0; r = 30; uMa...
function node = Dir4Node(S,D,area,Property,Property_2,energy_level,flag) load Net; % current start node Source = zeros(5,1); Source(1,1) = S; Source(2,1) = Net(S,1); Source(3,1) = Net(S,2); Source(4,1) = Net(S,3); Source(5,1) = Net(S,4); if (Source(2,1)-area)<=Net(D,1) && (Source(3,1)+area)>=Net(D,2) && flag ==1 ...
function [funcMatrix_ctx, funcLabels_ctx, funcMatrix_sctx, funcLabels_sctx] = load_fc() % % Usage: % [funcMatrix_ctx, funcLabels_ctx, funcMatrix_sctx, funcLabels_sctx] = load_fc() % % Description: % Load functional connectivity data parcellated using Desikan Killiany (author: @saratheriver) % % Outputs: % funcMa...
m = inline(input("data: \n", "s"), "t") t = [0*pi:0.1:4*pi]; f_t = m(t); figure(1); subplot(3,1,1); plot(t,f_t,"-b"); xlabel('t'); ylabel('x(t)'); title('F original dominio tiempo'); grid; f_w = fftshift(abs(fft( m(t) ))); subplot(3,1,2); plot(t,f_w,"-g"); xlabel('\omega'); ylabel('A'); title('F dominio \omega'...
function tripletFileRename(folderName,fileExtensions,tripletNamekeepIndices,tripletNameEndIndex,tripletNameCombineIndex,runOption) %%REMOVE COMMENTING FOR DEBUGGING: % clear all; close all; clc; % % fileExtensions={'.PAR','.REC'}; % folderName='C:\Users\kmmoerman\Desktop\temp'; % tripletNamekeepIndices=[1:5 7];...
function hor800meV_script demo_dir=pwd; %demo_dir=fileparts(which('demo_script')); %================================================================================================== % Unzip the data contained in the demo folder, and copy demo %==========================================================================...
close( 'all' ) clear all %erwthma 1,2% filenames = { }; for i = 1:9 filenames{end+1} = [ num2str(i) 'A.wav' ]; filenames{end+1} = [ num2str(i) 'B.wav' ]; end filenames{end+1} = [ 'OA.wav' ]; filenames{end+1} = [ 'OB.wav' ]; filenames{end+1} = [ 'ZA.wav' ]; filenames{end+1} = [ 'ZB.wav' ]; fo...
function svhn_crop_frames(in_images_dir, out_root_dir, vars) % crop frames of all images using sliding window % Params: % in_images_dir - input dir containing images to process % out_root_dir - output dir to save frames norm_height = vars.norm_height; % normalize image height win_wid = vars...
function trfshow(a,b,k); b=poldel(b,k); na=length(a); nb=length(b); n=max(na,nb); a=[a zeros(1,n-na)]; b=[b zeros(1,n-nb)]; tf(b,a,1)
function [X,Y,reasons]=varyRt1d%(NNsector,tvec)%(NNsector,X,tvec)%(c,tvec)% %months=[1 32 61 92 122 153 183 214 245 275 306 336]; %tvec=[t0,months(4:11)];%Fit tvec(1)=t0 %NNsector=[334594,3467837,2332332,7383886,1340524,1300949,373380,4031981,9741730,1828106,33704681]'; rt=(1:.02:1.1); ...
function [allCorrect,pYttSave]=findInOutTol(devt,ytt,varYtt,tol,cutoff) % points set to zero by cutoff pYtt =1-cdf('Normal',tol,ytt,sqrt(varYtt))+... cdf('Normal',-tol,ytt,sqrt(varYtt)); pYttSave = pYtt; pYtt(pYtt<cutoff) =0; pYtt(pYtt>=cutoff) =1; % Keep the order, else the logic changes devTol =zeros(...
%% not trustworthy bag_id = [1:size(bags_data,1)]'; dataset_bag = prdataset(bag_id,bags_label); error = cell(2,100); for j = 1:size(error,2) j [train_bag,test_bag,train_bag_id,test_bag_id] = gendat(dataset_bag,0.75); [~,test_bag,~,test_bag_id] = gendat(dataset_bag,0); train_instance_id = []; test_...
function link_table = citation_explorer(orig_string,varargin) % citation_explorer Explore citations and references at multiple depths % % This function uses Europe PubMed Central to extract references or % citations from a given paper and recursively find reference/citations % within those. The relevant papers at each ...
function [prob_c, free_energy_e, likelihood_e] = q5_GM_Expectation(X, mus, sigmas, priors) % Executes the Expectation-step for the learning of a GMM. % % INPUT: % X: [m x n] matrix, where each row is an n-dimensional input example % mus: [n x K] matrix containing the n-dimensional means of the K Gaussians % sigmas: ...
counts = 0; for i = 1:10^7 if length(factor(i)) == length(factor(i+1)) counts = counts + 1; end end
function config = configuration_smallsat %Constants and configuration definitions for the satellite config.name = 'smallsat'; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%% Model Properties %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Body properties config.m...
function v = FLUID_TYPE_PURE() persistent vInitialized; if isempty(vInitialized) vInitialized = CoolProp_wrap(0, 90); end v = vInitialized; end
function [ FOREST, C, BOW_matrix_cars, BOW_matrix_faces]=SPM %UNTITLED Summary of this function goes here % Detailed explanation goes here addpath('./scripts'); addpath('C:/Users/sunny/Documents/MATLAB/vlfeat-0.9.20/toolbox/misc'); run('C:/Users/sunny/Documents/MATLAB/vlfeat-0.9.20/toolbox/vl_setup'); facesIn...
clearvars -except hl_global hl hl_fused glwd glwd_fused dcs close all numperdecade = 5; %% Load in the data load('D:\GoogleDrive\Research\Lake distributions\LakeDatabases.mat','hl_fused'); addpath('power_law_scripts/'); %% Look at the HydroLakes Dataset disp('Extracting the HL Dataset'); HL_area = extractfield(hl_...
function rate=getrate2(dis,radius,ismacro) p=1e2; a=3; pmacro=1e4; noise=1e-9*1e4; % rate=floor(15./dis);%+ % %rateind=(rate>0); % %rate=rate+rateind.*rand(size(dis)); rate=zeros(size(dis)); for cell=1:size(dis,1) if(ismacro(cell)==0) rate(cell,:)=log2(1+p./noise./(dis(cell,:).^a)); else ...
function p = effective_prior(p_targ,cmiss,cfa); % p = EFFECTIVE_PRIOR(p_targ,cmiss,cfa) % % This function adjusts a given prior probability of target p_targ, % to incorporate the effects of a cost of miss, cmiss, and a cost of false-alarm, cfa. % In particular note: % EFFECTIVE_PRIOR(EFFECTIVE_PRIOR(p,cmiss,c...
function fireValve(TTLIOPort,Feeder) pulseDuration = 200; % in ms if (PelletCount ~= 0) % nonzero number [succeeded, cheetahReply] = NlxSendCommand(cat(2,'-SetDigitalIOPulseDuration AcqSystem1_0 ',num2str(TTLIOPort), ' ' ,num2str(pulseDuration))); if succeeded == 0 disp 'FAILED to Set duration' ...
% RGP function (random graph generation process) % INPUTS: Number of vertices n, Property T % OUTPUTS: adjacency matrix G, time elapsed function [G, time] = RGP(n,T) % RGP Function Matrix = zeros (n,n); time = 0; switch (T) case 1 Property = isMinDegreeOne(Matrix); case 2 ...
% % Read_CT_DICOM % % Purpose: Read GE PET Dicom data into 4D matrix, and header structure % % Author: Jan Axelsson, Anna Ringheim (based on her method for Matlab Webserver) % % Input: - directoryPath % % Output: - 4D matrix [X x Y x M * T] with image size X x Y with M slices ...
function [ x_new,P_new ] = updateKalman(x_hat,u,y,P ) global R; global Q; global Ts_kalman; %x_k+1=f(x_k)+vk %y_k=h(x_k)=C*x_k F=Jacobi_fk(x_hat,Ts_kalman); %jacobian of f evaluated at x_hat %Jacobian of h(x) C=[1 0 0 0 0 0 0 0;0 1 0 0 0 0 0 0]; H=C; %kalman update P_new=F*P*F'+Q; %predicted covariance y_hat=y-C*x...
function [T,I,Y]=perfusionResponseP2X4Inact2(y0,ton,toff,Ttot) ode=modelODEP2X4Inact2(ton,toff); [T,Y]=ode15s(ode,[0 Ttot],y0,odeset('NonNegative',1:34)); I=getTotalCurrentP2X4Inact2(Y); end
function [neighbors selMask] = getNeighbours(pt, distance, pts) % Finds neigbor points. % Parameters: % pt - center point % distance - max distance to neighbor % pts - points to be tested set % Returns: % neighbors - neigbor points % selMask - binary map of selected points selMask = getDistances(pt, p...
% edp.m % Constructing the Electrical Density Profile(EDP) from exp. diff. data. % INPUT var % N ------ highest order % L ------ long period obtained from first order peak position of exp. data % vi ------ a vector, containing phase angle of each order diff. % x ------ the distance between current post...
clusCount = 0; for iChan = 1:32%1:length(clustersToKeep) sp_ind = []; sp_mean = []; for iClus = clustersToKeep{iChan} clusCount = clusCount+1; cluster(clusCount,:) = [iChan, iClus]; sp_ind = find(spikes_clusters{iChan} == iClus); sp_mean = mean(spikes_waveforms{iChan}(...
% testing matlab code for github laptop_again = 1:10
function randomize(obj) % Should start calling the object's support function unifRand function % instead - the support set might not be rectangular L = obj.L; % Get bounding box; L = [a,b;c,d] for [a,b]x[c,d] or L = [a,b;c,d;e,f] for % ...
function hdl = click(I, varargin) % % click help text = ''; if nargin == 2 text = varargin{1}; end hdl = figure; h1 = subplot('position',[0.1 0.2 0.88 0.67]); if (isfloat(I)) if (max(I(:)) <= 1) I = 255*I; end I = uint8(imnorm(I, [0 255])); end imagesc(I); axis off; axis i...
%% Housekeeping addpath('ximu_matlab_library'); % include x-IMU MATLAB library addpath('quaternion_library'); % include quatenrion library addpath('data_pengukuran'); % include quatenrion library close all; % close all figures clear; % clear all variables clc; ...
% $Id: crwea_gui.m 70 2013-08-19 12:48:53Z rdj $ % function varargout = crwea_gui(varargin) % CRWEA_GUI M-file for crwea_gui.fig % CRWEA_GUI, by itself, creates a new CRWEA_GUI or raises the existing % singleton*. % % H = CRWEA_GUI returns the handle to a new CRWEA_GUI or the handle to % the existin...
function values = getnodevalues(inputvalues, mapping, identifier) % values = getnodevalues(inputvalues, mapping, identifier) row = find(mapping == identifier); switch length(row) case 0, error('Identifier not found') case 1, values=inputvalues(row,:); otherwise, error('Only one ide...
classdef SmartSample < handle %SMARTSAMPLE Tracks visited positions in real space and diamond space. % Functionality to move across sample given diamond space % coordinates. Image positions are interpreted from QR codes. % % The stage position will be used to give a confidence score of the ...
function deep_gp_sample_1d % % Plot the latent coordinates that points are mapped to by a deep function % % David Duvenaud % Sept 2013 % Options: connected = false; % true; Does the input connect to every layer seed=0; layers = 20; sample_resolution = 500; % 500 n_1d = 15000; % 15000 points savefig...
function [A, activation_cache]=sigmoid(Z) A=1./(1+exp(-Z)); activation_cache=Z; end
function test(rounds) files = dir('Data/Raw/*.mat'); files_names = {files.name}; corr = 0; for i = 1:rounds rnd = unidrnd(length(files_names)); %testTone = getTestTone(); targetName = strcat('Data/Raw/',files_names{rnd}); targetFile = load(targetName); len = lengt...
%========================================================== function varargout = curlim(varargin) %========================================================== %check to see if element values are within limit %varargin contains arrays %1. delta (change in currents) COMPRESSED %2 act (actual curre...
% caculator PR % NX: the upbound of x =5 % NY: the upbound of y =5 % MAXD: the upbound of demand, MAXD =5 % x: St % y: how much order % K: the fixed fee of placing order % r: the selling price per unit % c: ordering price % h: holding cost per unit % s: shortage cost per unit % u: demand-propability matrix...
% Ensemble Searchlight electrode analysis, which analyses each electrode % separately (as in the Mat % GV 18th May 2018 % So far only does whole timecourse classification close all clear all % SOME FLAGS TO SET: doSearchlight = 0; % 1 = do RSA using the following flags; 0 = just load in the specified file and plot s...
function dump_cofw_rcpr_fids(path) % addpath(genpath('/home/mallikarjun/src/piotr_toolbox/toolbox')); addpath(genpath('./../')); load([path '/cofw_data/facemap.mat']); % LOAD PRE-TRAINED RCPR model load('../models/rcpr_COFW.mat','regModel','regPrm','prunePrm'); nfids=87/3; % ...
function word=OCR_main(image) clc, % image = imread('TEST_1.jpg'); if size(image,3)== 3 g_image = rgb2gray(image); else g_image = image; end t = graythresh(g_image); bw_image = ~im2bw(g_image,t); imwrite(bw_image,'binary_image.jpg'); bw_image = bwareaopen(bw_image,30); imwrite(bw_image,'noise_removed_image....