text
stringlengths
8
6.12M
function dumpLatexAutomata(dfa, filename) %DUMPLATEXAUTOMATA Summary of this function goes here % Detailed explanation goes here tm = dfa.TransitionMatrix; fd = fopen(filename, 'w'); fprintf(fd, '%s', '\documentclass[11pt]{article}'); fprintf(fd, '\n'); fprintf(fd, '%s', '\usepackage{tikz}'); ...
function [D] = get_events_SPMformat(filename,eventfile) % Get inputs % ------------------------------------------------------------------------- if nargin<1 || isempty(filename) filename = spm_select; end try D = spm_eeg_load(filename); catch error('Could not load file'); end if nargin<2 || isempty(eventf...
classdef GMCCA_backup methods(Static) function agg_pi=find_matching(options, data) % computes the within graph aided mCCA between X and Y. % returns pi, the permutation that matches samples (rows) of X % with rows of Y. if options.use_single == 1...
function mse_value = MSE(imgx, img1) % MSE palauttaa kuvista lasketun MSE-arvon hyödyntäen kaikkia värikanavia % imgx: referenssikuva, img1: vertailtava kuva imgx = double(imgx); img1 = double(img1); subt = (img1-imgx).^2; [row, col, ~] = size(img1); N = row*col; sumR = (1/N) * sum(sum(subt(:,:,1))); sumG = (1/...
function Roots = LegendreRoots(n) if (n == 0) error('Legendre Polynomial of order 0 has no roots'); elseif IsNotIntegral(n,'+') error('Given order ''n'' must be a strictly positive integer.'); end switch(n) case(1) Roots = 0; case(2) ...
function regionInit = segment_createRegionFromVessel(vessel) plotON = false; regionMask = zeros(size(vessel)); ind1 = floor(0.05*size(vessel,1)); ind2 = ceil(0.95*size(vessel,1)); regionMask(ind1:ind2, ind1:ind2, :) = 1; regionInit = zeros(size(vessel)); regionInit2 = regionInit; regionIni...
%高度標記 clear;clc;clf; [xx,yy,zz]=peaks; cmat=contour(xx,yy,zz); clabel(cmat) %加上高度標記 cmat2=contour(xx,yy,zz,[-5,-3,0,3,5,8]); clabel(cmat2,[-5,0,5,8]) clabel(cmat2,'manual') %利用滑鼠指定欲標記的等高線
function date_vector=parseDateVector(time_string) if not(isempty(findstr('T',time_string))) separator='T'; else separator=' '; end date_and_time=strsplit(time_string,separator); year_month_day=strsplit(date_and_time{1},'-'); hour_min_sec=strsplit(date_and_time{2}(1:8),':'); date_vector=cellfun(@(str) str2doub...
function success = writeFeaturesH5( feats, labels, fn ) % success = writeFeaturesH5( feats, labels, fn ) % % feats - the features (N x P vector (single)) % or a cell array, with one entry per label % labels - the labels( N x 1 vector) % success = false; % list of labels in the dataset if( iscell(feats)) ...
%% %(1) close all M=512; wc=2*pi/3 i=0; for N=[21 101 1001] i=i+1; n=0:(N-1); h=wc/pi*sinc(wc/pi*(n-(N-1)/2)); [H,w]=DTFT(h,512); % figure() subplot(2,3,i) plot(w,abs(H)) ylabel('Magnitud') title(strcat('N=',num2str(N))) xlim([-pi pi]); subplot(2,3,i+3) plot(w,angle(H)) ...
num_tests = 1000; channel1 = [1+0.87i 0.2+0.1i 0.1+0.2i]; channel2 = [0.5i-0.8i -0.2i 0.2+0.1i 0.1+0.2i 0.01i-0.01]; channels1 = zeros(num_tests, length(channel1)); channels2 = zeros(num_tests, length(channel2)); for kk = 1 : num_tests channels1(kk,:) = channel1 + sqrt(0.05/2)*(randn(1,length(channel1)) +...
% Entering volunteer's info Volunteer =input('Volunteer : ','s'); %Asks for volunteer's name Sesion_number=input('Sesion number: ','s'); LogFileName=strcat(Volunteer,' - [',datestr(now,0),']','- EFFORT_PILOT_sesion_',Sesion_number,'.log'); %Indicates name for log file LogFileName = strrep(LogFileName,':','...
function x=hlbrtcrv(X) %input m 2D matrix %output gives vector after doing hilbert scan in a matrix [M,N]=size(X); x=zeros(1,M*N); Y=hilbert(max([M N])); Y=Y(1:M,1:N); Y=Y(1:M*N)'; [s, I]=sort(Y); [R,S]=meshgrid(1:N,1:M); R=R(I); S=S(I); R=R'; S=S'; for i=1:M*N x(i)=X(S(i),R(i)); end ret...
% go back to launcher and launch it if ~exist('launcher.m','file') cd .. end launcher
function methods = setup_methods_ransac_full addpath('/home/alexander/materials/pnpl/pnpl/opnp'); fs = { @(p,l,vp,vl)slv.sego_solver(p,l,vp,vl,false,true),... @(p,l,vp,vl)slv.sego_solver(p,l,vp,vl,true,true),... @(l,p)cvpr10.quat_assf(l,p),.....
function SpecCourse figure('MenuBar','None',... % убирает меню 'Name','Pendulum',... % имя окна 'NumberTitle','Off') % убирает тип окна перед названием uicontrol('Style','PushButton','Units', 'normalized',... %главная кнопка 'String','нарисовать',... %назва...
% Création d'un grid sag adapté à l'exportation dans zemax. clear %Configuration des paramètres run config.m s_max = hfov.*(1-z/f); %Création de la fonction de grandissement G = fun_creation(type_dist,r1,r2,g1,g2); %Calcul du profil de distortion recherché [distortion,P] = calc_dist(G,hfov,1000); figure(1);plot( ...
close all; laenge1 = 30; %Fuer die Weg-Koordinate laenge2 = 45; %Fuer die Zeit-Koordinate %Felder erstellen x = linspace(0,1,laenge1); %laenge2 = laenge1; t = linspace(0.5,0,laenge2); if 1==2 step = abs(t(1)-t(2)); t = [t,linspace(0.7,max(t)+step,laenge2)] laenge2 = 2 * laenge2; %Ergibt einen besseren Plot am St...
close all clear clc last_direction = 1; load('measurement_30_09_2018_sinus_0_3.mat') trim_to_zeros disp(last_direction); t_all = t; position_unfiltered_all = pedal.position_unfiltered; velocity_all = pedal.velocity; load('measurement_30_09_2018_sinus_0_5.mat') trim_to_zeros disp(last_direction); t = t + t_all(end) + ...
function plot_volume_and_non_active_agents(file_path_resolver, file_name_resolver, display_name_resolver, params, save_plot, non_active_agents_range,... volume_range) if ~exist('non_active_agents_range','var') non_active_agents_range = [0 14400]; end if ~exist('volume_range','var') volume_range = [0 14400]; e...
function posit_test(intrinsics, extrinsics) % all this junk ported from http://opencv.willowgarage.com/wiki/Posit %size - corners of a cube s = 10; model_points = [0 0 0; ... s 0 0; ... 0 s 0; ... 0 0 s; ... ]'; %s s 0; ... ...
%% create the base waves x = [-3:.1:3]; norm = normpdf(x,0,1); n1 = [zeros(1,100) norm zeros(1,100)]; n2 = [zeros(1,98) norm zeros(1,102)]; d = (n1-n2)*4; plot(d) %% Analyze a bipolar wave m = zeros(100,length(d)+200); for i = 1:100 m(i,:) = [zeros(1,100-i) d zeros(1,100+i)]; end avg = mean(m,1); repavg = avg...
function n=digit_counter(filename) n=0; fid = fopen(filename,'rt'); if fid < 0 n=-1; return end str = fscanf(fid,'%c'); n = length(regexp(str,'[0-9]')); fclose(fid);
function [] = KMeans() % http://openclassroom.stanford.edu/MainFolder/DocumentPage.php?course=MachineLearning&doc=exercises/ex9/ex9.html % Run K-means % The variables are named according to the equations % Written by Dang Manh Truong (dangmanhtruong@gmail.com) Image = double(imread('bird_small....
function F = giveF(pr,pn,in,rmesh,ti,mi,ai,ji,si,ni,vi,theta,BHCP) % This function returns the function to be solved for the newton solver % Defining funciton in matrix form % Left boundary: P1^(n+1) - BHCP = 0 % Right boundary: flux is zero. Therefore, % PN+1 - PN = 0 % | ( ( 0 0.... 0 | | P1...
%转移矩阵D为时限,K为还要多少个时隙才能传输成功 function[matrix]=prob_input_realnumber(D,realnumber) matrix=zeros(1,3); % matrix(1,2)=floor((realnumber-1)/((D+1)*D))+1; g=mod(realnumber,(D+1)*D); if g~=0 matrix(1,1)=floor((g-1)/(D+1)); g1=mod(g,D+1); if g1~=0 matrix(1,3)=g1-1; else matrix...
Z0 = rand(5,5); [X0,Y0] = meshgrid(1:5,1:5); %figure; %surf(X0,Y0,Z0); [X1,Y1] = meshgrid(1:.1:5,1:.1:5); Z1 = interp2(X0,Y0,Z0,X1,Y1,'cubic'); figure; surf(X1,Y1,Z1); colormap(hsv(128)); shading interp; hold on; contour(X1,Y1,Z1,15); colorbar; caxis([0 1]);
classdef EllipticProblemUpdateConservativeFinalVelocityTest < EllipticProblemMatrixAssembleTest3dNew %ELLIPTICPROBLEMUPDATECONSERVATIVEFINALVELOCITYTEST 此处显示有关此类的摘要 % 此处显示详细说明 properties matfphys end methods function obj = EllipticProblemUpdateConservativeFinalVelocityTes...
function B=localfit(ii,x,y,ve) if isstruct(x) || isstruct(y) || istruct(ve) x_b = []; y_b = []; ve_b = []; for idx = 1:length(ii) x_b = [x_b x(ii(idx)).data]; y_b = [y_b y(ii(idx)).data]; ve_b = [ve_b ve(ii(idx)).data]; end B = linreg(x_b,y_b,ve_b); else B = linreg(x(ii),y(i...
runProcessedData =importdata([fileSave{1} filesep 'runProcessedData.mat']); BCI_params; Data_Anticipation =importdata([fileSave{2} filesep 'Data_Anticipation.mat']); spectrogramData = preprocess_runs_spectrogram(runProcessedData,params.params_spectrogram); SaveProcess = false; try analysis_bandpower; end SaveProc...
clear;clc; img = imread("3096_colorPlane.jpg"); loop = 100; iter = 5000; %KMeans for K = 2:5 Kmeans(img,K,loop); end %EM for K=2:5 X_train5 = flat5d(img); [mu, cov, a] = expec_max(K, iter, X_train5); classifyMAP(img, X_train5, mu, cov, K, a); end %% KMeans function[] = Kmeans(img,K,loop) % Flat...
function [P12_best,P13_best,T_best,matcheper_best]=RANSAC_TFTPoseEstimation(Corresp,CalM) %UNTITLED Summary of this function goes here % Detailed explanation goes here [~,n] = size(Corresp); iter_num = 1000; threshold = 0.01; %% homogenous coordinates % Normalization of the data [x1,Normal1]=Normalize...
%% HA6, PART-II, Use PageRank Algorithm to Rank Websites % This example shows how to use a PageRank algorithm to rank a collection % of websites. Although the PageRank algorithm was originally designed to % rank search engine results, it also can be more broadly applied to the % nodes in many different types of graphs...
function [valid_flash_inds] = cull_flashes(trial, num_dead_flashes) % Use flashes up to target flash, or second to last flash % Set num_dead_flashes to a default value if nargin < 2 num_dead_flashes = 1; end % Test for a target flash zone1 = trial.flash_color==1 & trial.flash_zone==1; zone2 = trial.flash_colo...
function [mov check] = fn_registernd(ref,test,sigma,hp) % function [mov check] = fn_registernd(ref,test,sigma,hp) %--- % register z-stack test to the z-stack ref and returns the distance to move % in pixels % % Input: % - ref ND array % - test ND array, sizes smaller than ref % - sigma nrep*ndim a...
function [p_ed, p_ed_as, p_ed_super] = theor_ped(c_mes_control, m, q) d_h = 10000; for i = 2:size(c_mes_control, 1) d = sum(c_mes_control(i, 1:size(c_mes_control, 2))); if d < d_h d_h = d; end end A_i = zeros(1, size(c_mes_control, 2) - d_h + 1); for i = 2:size(c_mes_control, 1) d = sum(c_mes_c...
function log_errors(opts,varargin) % called when an error is thrown during the project % log error and project information for debug % % Parameters: % opts (Required) : structure % project configurations and information % logfile (Parameter) : string | char array % % Example 1: % try % net = Training.tr...
clear tests = [361 364 367 370 381 382]; rec_filename = '899r02.rec'; for test_num = 1:length(tests) proc_raw(rec_filename, tests(test_num)); end
classdef PPResults %PP Results %UNTITLED2 Summary of this class goes here % Detailed explanation goes here properties (Access = public) Model = []; Case = []; TimeDate = []; end properties (Dependent, SetAccess=private) ...
function make_mesh(setIndex) % X, xL, xR % Load current settings load('settings.mat'); % load in results of reconstruct scandata = load([settings.resDir sprintf('scandata_%02d.mat',setIndex)]); X = scandata.X; xL = scandata.xL; xR = scandata.xR; xColor = scandata.xColor; bbox = settings.bbox; % threshold for prun...
function simulatorMH %2 clc clear all %%%%%Window%%%%% main_window = figure('Name', 'SimulatorMH', 'Units', 'Normalized', 'Position', [0, 0, 0.6, 0.9], 'Visible', 'off', 'MenuBar', 'none', 'Resize', 'on'); datacursormode on; %%%%%GUI features (buttons etc.)%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Network panel%%%%%%...
function P = polyfitM(x, matrixY, n) % [sx1, sx2] = size(x); [sx1, sx2] = size(matrixY); P = zeros(sx1, n+1); % x = matrixX(Index, :); x = x(:); % q = ones(sx2, 1); % V(:, n+1) = q; % for j = n:-1:1 % q = q .* x; % V(:, j) = q; % end V = vander(x); [Q, R] = qr(V, 0); for Index = 1:sx1 y ...
close all; TigerEFP('configTigerEFPMULane60NEmp1cmult.txt', 'MU60NEmp1cmult'); TigerEFP('configTigerEFPMULane60NEmp1energy.txt', 'MU60NEmp1energy'); TigerEFP('configTigerEFPMULane60NEmp1rx.txt', 'MU60NEmp1rx'); TigerEFP('configTigerEFPMULane60NEmp1.5cmult.txt', 'MU60NEmp1.5cmult'); TigerEFP('configTigerEFPMULane60NEm...
function [position,isterminal,direction] = EventsFcn_Tstance_R(t,x,contact_pos,ter_i,k1,L_sp0,m1) g = 9.81; position = [k1*(x(1)-L_sp0)*cos(x(2))-m1*g,... contact_pos(2)+x(1)*cos(x(2)) - Terrain(contact_pos(1)-x(1)*sin(x(2)),ter_i)]; % The value that we want to be zero isterminal = [1, 1]; % Halt integratio...
%% the setting of surface trap Z=1; q=Z*1.60218*10^(-19); %% use yb 171 + the q=1e 元电荷 ee0=8.855*10^(-12); %% coulomb force 介电系数 k_c=q/(4*pi*ee0); % 系数 算电场力 mass=174*1.66*10^(-27); % 质量 x0_um=((Z^2*q^2)/ (4*pi*ee0*mass*Omega_rf^2))^(-1/3); % 长度无量纲化条件 U0=1; %U0=(q/(mass*um^2*(Omega_rf/2)^2)); 电势场无量纲化,这里后来没有加上去...
function obj = removeVirtualConstraint(obj, name) % Remove virtual constraints defined for the system % % Parameters: % name: the name of the constraint @type cellstr assert(ischar(name) || iscellstr(name), ... 'The name must be a character vector or cellstr.'); if ischar(na...
function dev_generate_polynomial_code(fname, genname, Kfun, betafun, opt) % dev_generate_polynomial_code(fname, genname, Kfun, betafun, opt) % % Function used by `dev_generate_basic_kaiser_poly.m` and % `dev_generate_basic_kaiser_poly_deriv.m`. For documentation, % see those files. degs = opt.degs; fid = fopen(fnam...
% analyze new features (half aneurysm + distal/proximal) clear close all load FeatureTable4 Observation = table2array(FeatureTable4(1:26,3:end)); Group = table2array(FeatureTable4(1:26,2)); %% Selecting Features Using a Simple Filter Approach dataG1 = Observation(grp2idx(Group)==1,:); dataG2 = Observation(grp2idx(...
function jasna_summarize_timigs_in_table (cache_dir, sequences, varargin) % JASNA_SUMMARIZE_TIMINGS_IN_TABLE (cache_dir, sequences, varargin) % % Gathers the results of JASNA_EXPERIMENT_AFFINE(), % JASNA_EXPERIMENT_DTU(), and JASNA_EXPERIMENT_WEBCAM(), and summarizes % the (amortized) run-times in ...
filePath = 'C:\Users\User\Desktop\Final Project\Statistics\statistic.mat'; data = load(filePath); statistic = data.statistic; % x = number of optimise % y = number of optimise % z = number of features [x, y, z] = size(statistic); V = zeros(x, z); for i=1:x for k=1:z Vi = 0; for j=...
function status = surfstab_visu_test(in_path) %% Script to visualize things from the test case for the stability pipeline
% University of British Columbia, Vancouver, 2017 % Alex Kyriazis % William Choi % % Extracts cell morphology features from a list of cells that have % undergone process segmentation function [dpcell_list] = feature_analysis( dpcell_list ) % % Handles cell analysis following soma segmentation % length ...
function x = seperateSet() spamList = dir('spam'); nospamList = dir('nospam'); X=[]; y=[]; trainX = []; crossX = []; crossy = []; trainy = []; testX = []; testy = []; for i = 3:length(spamList), file_contents = readFile(strcat('spam\', spamList(i).name)); ...
function [inputTrackingVideo] = createTrackingOverlayVideo(inputTrackingVideo,inputX,inputY,varargin) % Takes tracking data and makes an overlay on a behavioral movie. % Biafra Ahanonu % started: 2014.01.03 [19:13:01] % inputs % inputTrackingVideo - [x y frames] movie or path to AVI file % inputX - [1 frames] v...
classdef TradingRobot < AutoTrader properties AEXDepth CHXDepth end methods function HandleDepthUpdate(aBot, ~, aDepth) % Saves last depth switch aDepth.ISIN case 'AEX_AKZA'; aBot.AEXDepth = aDepth; case 'CHX_AKZA'; aBot.CHXDep...
function clearPlotsBN_prs(obj, evt) thndl = get(gcf, 'Userdata'); cla(thndl.uicontrol.plots.scalpPotential_AX);
function [position, avgCost, commission ] = cut_pos(obj, spotPrice, posCut) %% Reduce open interests by selling or buying to cover posCut contracts at spotPrice. % Return position avgCost and commission after operation. %% % check current unit if obj.currUnit<=0 error('Cannot cut position!'); end totPos = sum(obj....
function photo = photosynthesis(C_at, T, pCO2a, k_p, C_veg0, k_a, k_MM, k_c, K_M, T_0) % Photosynthesis model from (Lenton 2000) Earth System Model %{ Carbon uptake from the atmos. via photosynthesis Variables: C_at = carbon uptake atmos. T = Temperature pCO2a = Mixing ratio...
display('Arq3');
% % Mathematical model of the movement of the ship in the water % with influence of wind, current and waves % % - Wave profile generator % % (c) by Fabian Jenne % DAsoln3; compute the D'Almebert soln for an IVP. % The original disturbance is Gaussian, so we know the % Fourier transform (also a Gaussia...
function [stimTimes,trainTimes] = extract_stimulation_times_TOJ(tact,fsStim,bads) samplesOfPulse = round(2*fsStim/1e3); % build a burst table with the timing of stimuli preStim = round(fsStim*1); [trainTimes] = find(tact(:,8)==1)- preStim; logicalMask = logical(ones(size(trainTimes))); logicalMask(bads) = 0; t...
function comparePosNegPromters(nDir, pDir, minimum) % COMPAREPOSNEGPROMTERS % Authors: Hani Girgis and Alfredo Velasco % The Bioinformatic Toolsmith Laboratory % The University of Tulsa % This function takes in two directories % that represent a tissue and a minimum. % It will go through the w.mat files (the weights %...
%% LIC 5 %Return TRUE if there exists at least one set of two consecutive data points %where X[j] - X[i] < 0 (where i=j-1) function out = lic5(POINTS, NUMPOINTS) out=0; for i=1:(NUMPOINTS - 1) if(POINTS(i,1)>POINTS(i+1,1)) out=1; break; end end end
% User Specific Vars user = 2; switch (user) case 1 username = 'lstruz'; ieegLoginFile = 'lst_ieeglogin.bin'; case 2 username = 'mdshahid'; cd('D:\Work\MSE2013-2014\Spring_2014\BCI\'); addpath(genpath(cd)); cd('FinalProject/rECoGnition'); ieegLogi...
function out1 = tau2kappa(tau); % Takes in upper and lower tail dependence measures % and returns the required parameters of the Joe-Clayton copula % % INPUTS: tau = [tauU, tauL], a 2xT vector of upper and lower tail dependence measures % % OUTPUS: kappa, a 2xT vector of required Joe-Clayton copula parameters ...
function str_out=ZeroPad(str_in,num,varargin) % str_out=ZeroPad(str_in,num) % str_in: the input string % num: number of digits wanted to achieve % Optional inputs % 'PadPosition': 'start'(default)|'end'|[start index (double)] pad_position=InspectVarargin(varargin,{'PadPosition'},{'start'}); zeros_str = repmat('0',1,...
function S = sumZplains(boxSize) S = zeros(boxSize(1),boxSize(1)*boxSize(2)*boxSize(3)); for i = 1:boxSize(3) for j = 1:(boxSize(1)*boxSize(2)) S(i,(i-1)*boxSize(1)*boxSize(2)+j) = 1; end end % S = zeros(boxSize(1),boxSize(1)*boxSize(2)*boxSize(3)); % for i = 1:boxSi...
function key = gtskey(sp) %最後の方のデータは切り捨て l = length(sp); key = zeros(1,l)'; for i = 1:l key(i) = mirgetdata(mirkey(sp{i})); end
function dumpgptstart(fn,a) fid=fopen(fn,"w"); fprintf(fid,"reset\n"); fprintf(fid,"unset border\n"); fprintf(fid,"unset key\n"); fprintf(fid,"set tics\n"); fprintf(fid,"set size ratio 1\n"); fprintf(fid,"set xrange [%f:-%f]\n",a,a); fprintf(fid,"set yrange [%f:-%f]\n",a,a); fprintf(fid,"\n"); fprintf(fid,"\n...
%% This is for playing with data coming from Movebank % filtered with movebank.sh disp('reading data...') % Modify this with your own data f = fopen('samples/movebank_sample.csv'); data = textscan(f, '%*d %s %f %f %*[^\n\r]', ... 'CollectOutput', true, 'HeaderLines', 1, 'Delimiter', ','); fclose(f); [d.t,idx] =...
function [ spe ] = disfunction( Xt, svmstruct) %DISFUNCTION Determines which group the input data belongs to % given the information about kernel function and support vector data = svmstruct.TrainingData; Isv = svmstruct.Isv; spe = svmstruct.Bias; vecAlpha = svmstruct.vecAlpha; vecMu = svmstruct.vecMu; vecSigma = sv...
function plotOnGate( tA, tAIX, gIX, gSamp, plotWindow, calcFcn) samplePeriod = .05; sampWindow = [(plotWindow(1)./samplePeriod):(plotWindow(2)./samplePeriod)]; powerList = unique(tAIX(:,1)); flyList = unique(tAIX(:,8)); Npowers = length(powerList); Nflies = length(flyList); plotQty = ...
%%batch02 run_sim('simdata2.mat');
function [x] = tikh(f, mask, vsz, bdir, lambda) %TIKH Tikhonov regularization % % [x] = TIKH(f, mask, vsz, [bdir], [lambda]); % % Inputs % ------ % f unwrapped local field/phase (3d/4d array). % mask binary mask of region of interest (3d array). % vsz voxel size. % % bdir u...
function [fitresult, gof] = createFit(N, B100V4) %CREATEFIT(N,B100V4) % Create a fit. % % Data for 'untitled fit 1' fit: % X Input : N % Y Output: B100V4 % Output: % fitresult : a fit object representing the fit. % gof : structure with goodness-of fit info. % % See also FIT, CFIT, SFI...
function [a1_v1, filt_a1_v1, timeInstants, p_v1] = filterConstruction(filename, Fs) a = miraudio(filename,'Sampling',Fs); f = mirframe(a,'Length',0.05,'s','Hop',0.01,'s'); a1 = mirautocor(f); a1_v1 = mirgetdata(a1); a1_v2 = get(a1,'Pos'); f1{1} = mirfilterbank(a,'Manual',[50 75]); f1{2} = mirfilterbank(a,'Manual',[50...
function y = in_range(x, minimum, maximum) % IN RANGE: Check if number is in range % y = in_range(x, minimum, maximum) % ` check if x >= minimum and x <= maximum % INPUTS: % x - the analyzed value % minimum - the minimum value of range % maximum - the maximum value of range % OUTPUTS: % y - a boolean if x is in ra...
% Employ method of limits to determine where the OSCOR stimulus goes from % spatial to a flutter clear all; close all hidden; clc; %#ok<CLALL> path = '../CommonExperiment'; p = genpath(path); addpath(p); addpath('Stimuli Dev') load('s.mat') rng(s) subj = input('Please subject ID:', 's'); %% Stim & Exp...
function y = gauss2mf(x, params) %GAUSS2MF Two-sided Gaussian membership function. % % Synopsis % y = gauss2mf(x,params) % y = gauss2mf(x,[sig1 c1 sig2 c2]) % % Description % The Gaussian function depends on two parameters sig and c as given by: % % GAUSSMF(X, [SIGMA, C]) = EXP(-(X - C).^2/(2*SIGMA^2)); % %...
%- movie 1d global DT global VALUE_PB level_set global Zmin Zmax global nn cdd global XPAUSE PRINTF=0; %- for more printings PLOT_DERIV=0; %- to show derivative of numerical solution VFile='VF'; VFile0='VF0'; if VALUE_PB==1; VFile='Value'; VFile0='Value0'; end if PRINTF; fprintf('dim=1 !\n'); end if dim>1; f...
x = load('dataset1_inputs.txt'); t = load('dataset1_outputs.txt'); w = 30; errors = zeros(1,w); for i=1:w %polynomial curve fitting using my function designmatrix p = designmatrix(x,t,i); %evaluate polynomial at each input value in x results = evalpoly(p,x); %find square error difference err...
function newton(lamda) load trainSet.txt; siz=size(trainSet); dim=siz(1)-1; num=siz(2); Y=trainSet(dim+1,1:num); X=zeros(dim+1,num); X(1,1:num)=1; X(2:dim+1,1:num)=trainSet(1:dim,1:num); w=zeros(1,dim+1); alpha=0.001; e=1e-7; g=(Y-exp(w*X)./(1+exp(w*X)))*X'-lamda*w; temp=(exp(w*X)./(1+exp(w*X))); A=diag...
%%%% Load kgrid and sensor structure data in advance. %%%% function tof_map = get_tof_AIC_2(varargin) % varargin{1} is the receive data of objective % varargin{2} is the receive data of water % varargin{3} is the kgrid data % varargin{4} is the sensor data % varargin{5} is the half-size of window display('start running...
function [ OUTPUT, PSNR ] = CSCoding( INPUT ) %CSCODING Summary of this function goes here % Detailed explanation goes here %addpath('../Non-local CS_pub'); currpath = pwd; f = filesep; addpath([currpath f 'rwt' f 'bin']); wav = daubcqf(4); W = @(x) midwt(x,wav); WT = @(x) mdwt(x,wav); %% Recovery from Circulant ...
function check_commute_times(fn) % CHECK_COMMUTE_TIMES Check the commute times computed by graph_eigs % fn - the filename of the smat file, the commute times are stored in % fn.laplacian.ctimes smatdata = load(fn); edges = smatdata(2:end,:); G = spones(sparse(edges(:,1)+1,edges(:,2)+1,1,smatdata(1,1),smatdata(1,2))...
% Offset the boilerplate stuff to make the main loop easier/shorter to read %% Add paths Screen('Preference', 'SkipSyncTests', 1); Screen('Preference','VisualDebugLevel', 0); addpath(genpath('Psychoobox')); addpath(genpath('ptbutils')); tgt = ParseTgt(file_name, ','); tgt = struct2table(tgt); % R2013b ++! % break it ...
function add_gaussian_noise(cloud, shapename, variance) pts = cloud.Location; SAMPLING_SET = 200; % estimate diameter sampled = down_sample(cloud, SAMPLING_SET); Dfps = pdist2(sampled.Location, sampled.Location); diam = sqrt(max(Dfps(:))); sig = diam * variance; new_x = pts + randn(size(pts)) ...
Y = [1,2,3,4,5,6,7,8,9]; Mybar = bar(Y); set(Mybar,'YDataSource','Y'); while(true) for i = 6:10 Y(5) = i; pause(1); refreshdata; end for i = 10:-1:5 Y(5) = i; pause(1); refreshdata; end end
function [prog prog_null_mean prog_null_std] = get_progression_output_struct(OUTPUT_STRUCT,adjacency_used,x,y) frames = length(OUTPUT_STRUCT); prog = zeros(frames,1); if strcmp(adjacency_used,'W') prog_null_mean = zeros(frames,1); prog_null_std = zeros(frames,1); else prog_null_mean = nan; prog_nu...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Copyright 2018 Crypto4a Technologies Inc. % % Permission is hereby granted, free of charge, to any person obtaining a % copy of this software and associated documentation files (the "Software"), % to deal in the Software without restriction,...
%% init.m % % Script for setting the engine constants and initial values for simulation % % Author: Andreas Torp Karlsen (andreas.t.karlsen@gmail.com) % Last revised: 18.06.2012 %% clear all; clc; global k_a R_a T_amb c_pa d_c % for use in 'compflw' and 'compflw_alt', global to avoid passing as parameters nx = 6;...
function[]=writeABQinitialconditions(filepath,type,absoluteexteriortolerance,definition,drivingelsets,exteriortolerance,file,fulltensor,geostatic,inc,input,interpolate,midside,normal,numberbackstresses,outputvariable,rebar,sectionpoints,step,unbalancedstress,user,variable,data,comment) %================================...
function [training_data, test_data] = split_dataset_sinan(data,tt_ratio) %% Split dataset % sinangokce, 22.04.2018 M = size(data,1); M_train =round(M * tt_ratio); %number of training element random_training_indices = randperm(M,M_train); training_data = data(random_training_indices,:); temp_data = data; temp_d...
clear all ; close all ; clc; %% Load HSI demoFile = 'Pavia.mat'; vars = {'pavia'}; load(demoFile, vars{:}); M3d = pavia; M3d = M3d(:,224:end,:); % keep right part of image [nl,nc,p] = size(M3d); nt = nc*nl; M = reshape(M3d, nt, p).'; %% Normalise HSI data cube temp = max(M(:)); M = M./temp; %% Initialise H b...
function [ ranklist ] = GetRankList( taskDAG,nodeCount,localComPower,serverComList,serverCount,transRate,transData,computeCost,delta ) %function [ ranklist ] = GetRankList( taskDAG,nodeCount,MaxNodeCount ) %GetRankList 获得DAG中每个子任务的rank,按照优先级从高到低(递增)顺序排序 % rank依据,借助AOE网络关键路径发,计算AEST(actual earliest start time)和ALST(a...
% % This script computes all the Haar-like features for the training % set. % To configure the constants, please modify config_training.m % % Carica le costanti config_training fprintf('*** Computing Haar-like features for given training set ***\n'); % Carica gli esempi positivi fprintf('Loading positive samples...
function [matched_bit_strm] = match(mod_bit_strm, pulse) %MATCH Summary of this function goes here % Detailed explanation goes here pusle=pulse(end:-1:1); pusle=[pusle']; matched_bit_strm=filter(pusle,1,mod_bit_strm); end
function treCompute(framebins,filename,sgname) %treCompute Compute Temporal Reliability Entropy % treCompute(FRAMEBINS,FILENAME) computes the Temporal Reliability % Entropy for the surrogate data. FRAMEBINS specifies the number of % bins each frame is broken up into. The resulting entropy measurements % are sav...
function [ hfig ] = plot_optprice_sigma( self ) %PLOT_OPTPRICE_SIGMA 画期权价格对sigma的图 % ---------------------------------- % 吴云峰,20160130 % 吴云峰,20160316,基于copy的数据做研究 %% 预处理 % TODO:检查各个变量是否都有值 % 将旧的变量进行保存 copy = self.getCopy(); [ L1, L2 ] = size( copy.optPricers ); %% 画图,画px~sgima的图 obj.sigma*100 volsurf = 0.10:0.0...
function [Xw] = stageII(fs,fwfmin,fwfmax,N,Xsabs) % % % Objetive: The main contribution of this stage is the development of a % Wheezing/Normal breath sound separation based on a constrained % tonal semi-supervised NMF approach using redundant information % from the BOI obtain...