text
stringlengths
8
6.12M
clear; data=normrnd(600,196.6292,1,10000); out=find((data>1200)|(data<=0)); data(out)=[]; minfee=inf; for n=20 for m=315 f=mean(test2fun(data,n,m)); if f<minfee minfee=f; n0=n;m0=m; end end end n0,m0,minfee
% KCCTest01 N = 3000; k = 4; p=k/(N-1); Graph = mexGraphGeneratePoissonRandomGraph(N,p); % load('D:\Network.mat'); tic KCC = mexGraphLinkDirectionality(Graph); toc CC=mexGraphClusteringCoefficient(Graph); for i = 1 : numel(KCC.KCCData) if (KCC.KCCData{i}(2).LinksAt~=CC.NodeNeighboursLinks(i)) error...
function var_list = plotBgrid(phi, u, v, it) % write a netcdf files of the data nc = netcdf('Bgridu.nc', 'c'); nc('x') = size(u,2); nc('y') = size(u,1); nc{'u'} = ncdouble('x', 'y'); nc{'u'}(:) = u'; close(nc); nc = netcdf('Bgridv.nc', 'c'); nc('x') = size(v,2); nc('y') = size(v,1); nc{'v'} = ncdouble('x', 'y'); nc{...
function [Wt] = bci_gradient_descent(FeaturesBundle,targetBundle,statsBundle,W,alpha) %BCI_GRADIENT_DESCENT Summary of this function goes here % Detailed explanation goes here [Nt] = size(FeaturesBundle,1) NFr = size(FeaturesBundle{1},2); g = 15; Wt = zeros(NFr,1); Wt_1 = W; NIter = 1000; for j=1:NIter range = ra...
function [delta_nu, eta] = LLSE_tracking(data_FFT,pilot_pattern,nr_car, length_cpre,L) M=length(pilot_pattern); delta_phase=angle(data_FFT); weight=[0:1:L-1]*(nr_car+length_cpre)+length_cpre; weightM=ones(M,1)*weight; num=sum(sum(weightM.*delta_phase)); den=2*pi*M*sum(weight.^2); delta_nu=num/den; k=pilot_pattern-1...
function [SynthData] = gen_synth_data_cube(nViews) dim = 0.25; cube_points = [ -dim -dim 1 dim -dim 1 dim dim 1 -dim dim 1 -dim -dim 2 dim -dim 2 dim dim 2 -dim dim 2 ]'; lineIndices = [ 1 2 2 3 3 4 4 1 5 6 6 7 7 8 8 5 1 5 6 2 7 3 4 8 ...
close all; clear all; allEventTypes = [-1 11 12 41 46 42 43 0 21 22 23 31 32 44 45 ]'; allTypeNames = {'Other',... 'Mem IO',... 'GPU mem IO', ... 'ADIOS init', ... 'ADIOS finalize', ... 'ADIOS open', ... 'ADIOS alloc', ... 'Compute',... 'Network IO', ... 'Network wait', ... 'Ne...
function y = unit_amp(x,amp,point) if size(x,1)<size(x,2) x = x'; end N = size(x,1); [env_up,env_down] = envelope(x,point,'peak'); y = zeros(N,1); for i = 1:N if(env_up(i)>10e-3 ) if(x(i)>0) y(i) = x(i)*(amp/env_up(i)); else ...
classdef AbstractAnimator < handle properties(Access = private) tmr timer end properties (GetAccess = protected, SetAccess = immutable) fig axs end properties (Access = public) currentTime double speed double end properties (Access = pub...
function [unc] = est_scovint(x,x0) [nix,sql,sqr] = scovint(x,0.95,x0); if isempty(sql) [nix,sql,sqr] = scovint(x,0.95); end unc = max(abs(sqr - x0),abs(sql - x0)); end
clc; clear all; close all; A = [4 -2 1; 2 3 -1; 8 -5 2] % i - satir, j - sutun n=size(A,1); U=A; L=eye(n); for i=1:n-1 for j=i+1:n L(j,i) = U(j,i)/U(i,i); U(j,:) = U(j,:)-(U(i,:)*U(j,i))/U(i,i); end end L U
function Hd = BPFilter %TEST Returns a discrete-time filter object. % MATLAB Code % Generated by MATLAB(R) 9.1 and the Signal Processing Toolbox 7.3. % Generated on: 23-Dec-2016 09:53:22 % FIR Window Bandpass filter designed using the FIR1 function. % All frequency values are in Hz. Fs = 62500000; % Sampling Freque...
1 [x, Fs] = audioread('xkolcu00.wav'); Fs; % vzorkovacia frekvencia N = length(x); % dlzka signalu t = length(x)/Fs; % dlzka v sekundach 2 % zobrazenie modulu spektra signalu X = abs(fft(x)); % fourir. trans. povodneho signalu om_f = ((0 : (N / 2) - 1) / N * Fs); % získame frekvencnu osu X = X(1 : N / 2); ...
function [respuesta] = definidaPositiva(matriz) %DEFINIDAPOSITIVA Summary of this function goes here % Detailed explanation goes here [n,m] = size(matriz); respuesta = false; if n == m otraMatriz = matriz; respuesta = true; for i=1:n [n2,m2] = size(otraMatriz); %esDeterminante = determinan...
%Copyright (c) 2020, Denielle Ricciardi %All rights reserved. function [full_cov,e_trans,cov_1,cov_2] = gen_cov(sigma_1,sigma_2,w_1,w_2,nug_1,nug_2,N,... strain_inc,el_pl_trans,show_figs,analyze) u = strain_inc; [~,e_trans] = min(abs(u - el_pl_trans)); %find strain index corresonding to elastic-pl...
close all clc clear run('C:\Users\ashle\Desktop\Masters\MATLAB\ElastomerDrops\Alignmentcheck.m') fprintf('done running Alignment Check \n Now running Angle DIC Complex \n') % frame=30; jet2 = jet(2049); jet2(1025,:)=[1 1 1]; %put stephane's stretch code here for frame=1:10 load('E:\Elastomer Drop Redo\MorphDOWNWARD\nc...
%Some data %x = 1:5 ; y = rand(size(x)) ; % The plot bar(y) ; % add the values for i=1:length(x), TH(i) = text(x(i),y(i),num2str(y(i))) ; end % Use the handles TH to modify some properties set(TH,'Horizontalalignment','center',... 'verticalalignment','bottom') ;
pa = 1/5; ps = 1/3; P = [1 - pa pa 0 0 0; (1-pa)*ps (1-pa)*(1-ps)+pa*ps pa*(1-ps) 0 0; 0 (1-pa)*ps (1-pa)*(1-ps)+pa*ps pa*(1-ps) 0; 0 0 (1-pa)*ps (1-pa)*(1-ps)+pa*ps pa*(1-ps); 0 0 0 (1-pa)*ps (1-pa)*(1-ps)+pa*ps]; P0 = [1 0 0 0 0]; res=P0*P^2; res(3) % ooor P(1,:)*P(:,3)
function [opt,combinedpop,frontpop]=infeasort(opt,combinedpop) %1. Split the combined pop into feasible and infeasible subsets [feaspop,infeaspop]=split(combinedpop); %2. sort the feasible subsets using non-dominated sorting; if ~isempty(feaspop) [opt,feaspop,frontpopfeas]=ndsort(opt,feaspop); end %3. sort the inf...
function run_ex5() % load image img = imread('cow.jpg'); % img = imread('zebra_b.jpg'); % for faster debugging you might want to decrease the size of your image % (use imresize) % (especially for the mean-shift part!) % img = imresize(img, 0.3); % scale for zebra % figure, imshow(img), title('original image') % smoo...
% Measure approximation error and compression ratio for several images. % % NOTE Images must be have .png ending and reside in the same folder. global U; file_list = dir(); k = 1; Errors = []; % mean squared errors for each image would be stored here % UPDATE: % If available load the dictionary.mat f...
function WigCreateAmbiJS(dec,az,elev,norm,HV,pname) % WigCreateAmbiJS(dec,az,elev,norm,HV,pname) % % Create a JS effect that implements an Ambisonic Decoder. Dec is the 2D % decoding matrix. Az and Elev are the speaker positions (used for % labelling the ins outs and 'norm' is the normalisation scheme/channel % orde...
% @Input : % image - RGB color space input image % metric - only support 'gabor' or 'Law' % % @Output : % feature - texture filter response % -------------------------------------------------------------------- % % extract feature vector from Gabor texture function gImg = ex...
function [y,xGTNO,xNOTR,errFGTNO,errXGTNO,no]=synthesizeY(xGT,TGT,TFov,S,A,B,M,kGrid,rkGrid,NS,sigma,no) %SYNTHESIZEY Synthesizes motion corrupted data % [Y,XGTNO,XGTNOTR,ERRFGTNO,ERRXGTNO,NO]=SYNTHESIZEY(XGT,TGT,TFOV,S,A,B,M,KGRID,RKGRID,NS,{SIGMA},{NO}) % synthesizes motion corrupted data according to the forw...
function [d] = zadatak10(A) [mn, ind_min] = min(A); [mx, ind_max] = max(A); min_pt_x = [mn(1), A(ind_min(1), 2)]; %tacka koja ima najmanju x koordinatu min_pt_y = [A(ind_min(2),1), mn(2)]; %tacka koja ima najmanju y koordinatu max_pt_x = [mx(1), A(ind_max(1), 2)]; %tacka koja ima najvecu x koordinatu max_pt_y = [A(in...
classdef TestSizeof < matlab.unittest.TestCase % Properties List properties dataTypeIn_Int dataTypeIn_Uint dataTypeIn_Bits dataTypeIn_Float dataTypeIn_Bad dataTypeIn_Unrec dataTypeOut_Int dataTypeOut_Uint dataTypeOut_Bits dataT...
% band=4:7; Cpli=[];Cx=[];O=[];SNR=[];Cxp=[]; for i=1:length(FT) fprintf(num2str(i)) out=tensor_connectivity3(FT{1,i}{4},FT{1,i}{2},FT{1,i}{3},band); % out=tensor_connectivity2(FT{1,i}{4},FT{1,i}{2},band); % out=mean(out,3); out=mean(out(:,:,band),3); O(i)=max(max(out)); Cx(:,:,i)=topoconn_...
function h3p3 function [r,it] = newton(fcn,fpr,p0,TOL,Mmax) x(1) = p0; %x(2) = p1; for n=1:Mmax-1 num = fcn(x(n)); den = fpr(x(n)); x(n+1) = x(n) - (num/den); abserr = abs(x(n+1)-x(n)); relerr = abserr/(abs(x(n+1))+eps); ...
function [Q,eigvalue]=DivideAndConquer(A) %% % Using the idea of divide and conquer to solve all eigenvalues of A. % Return: All eigenvalues of A; eigvector matrix Q % precondition: A is m by m (m>=2), symmetric, tridiagonal. % 1. If A is not irreducable, reduce A % 2. Divide: find eigenvalues/e...
function [J, grad] = linearRegCostFunction(X, y, theta, lambda) %LINEARREGCOSTFUNCTION Compute cost and gradient for regularized linear %regression with multiple variables % [J, grad] = LINEARREGCOSTFUNCTION(X, y, theta, lambda) computes the % cost of using theta as the parameter for linear regression to fit the ...
classdef Visual1d < AbstractVisual %VISUAL1D 此处显示有关此类的摘要 % 此处显示详细说明 properties end methods function obj = Visual1d( mesh ) obj = obj@AbstractVisual( mesh ); end drawResult( obj, field ); drawOutputResult( obj, outputObj, step, fieldId ...
function [h, r1_1, r1_2, r2_1, r2_2] = plotFigCompare2(h, rmse_fct, feature_optsim1, feature_optsim2, feature_optsim3, ... param_docsim1, param_docsim2, param_docsim3, secondWindowOffset, thirdWindowOffset) len1 = length(feature_optsim1.q); len2 = length(feature_optsim2.q); len3 = length(feature_optsim3.q); indSe...
function y=F_Retrieval(Interferogram,matrix,lambda,lambda_in,sigm) PinRet=abs(Interferogram*(pinv(matrix))); gaus=exp(-0.5*((lambda-lambda_in)/sigm).^2)./(sqrt(2*pi)*sigm); c=conv(gaus,PinRet,'same'); y=c; end
% Tao Du % taodu@stanford.edu % Feb 12, 2015 % Test renderObj. Incidentally, it also tests model2Image. % Clear. clear all; clc; % Read V and F from .obj files. [V, F] = readObj('data/cube.obj'); % The camera coordinate is: % x: left to right % y: down to up % z: outside to inside. % Note that this coordinate is lef...
function y = normcols(x) %NORMCOLS Normalize matrix columns. % Y = NORMCOLS(X) normalizes the columns of X to unit length, returning % the result as Y. % % See also ADDTOCOLS. % Ron Rubinstein % Computer Science Department % Technion, Haifa 32000 Israel % ronrubin@cs % % April 2009 y = x*spdiag(1./sqrt(sum(...
function data_file_read(option) % function data_file_read % requires a text file with one header line containing names(no spaces) for each column of data % allows user to choose a data file with header(s) and assigns each column of data to % variables named by the header names. The user can then save the information...
% Ex 2 % a) N = 20; P = 10000; alfa = 0.1; lambda = 1800; C = 10; f = 1000000; b = 10^-6; PL_lst = zeros(1,N); APD_lst = zeros(1,N); MPD_lst = zeros(1,N); TT_lst = zeros(1,N); for i=1:N [PL_lst(i),APD_lst(i),MPD_lst(i),TT_lst(i)] = simulator2(lambda,C,f,P,b); end % Calculate Packet Loss PL = mean(PL_lst); PL_con...
clear; close all; %% validationSet = [1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67]; Rvalues = []; Gvalues = []; Bvalues = []; RGvalues = []; GBvalues = []; BRvalues = []; for N = 1:length(validationSet) % Current sign id nSign = validationSet(N); %nSign ...
% % contencates new imageJ code to the matlab code % % % N.B. im.m cuts the upper intensities by imadjust! % %clear sequence newseq f nam novseq anoseq % finding factor for normalizing: analyzing the first time step only tcon = datacon(:,1); % time intd = find(tcon == 1); % finds indices nc = max(intd); con = data...
function fixtures = SharedFixtures %SHAREDFIXTURES Shared fixtures for Silver Lab Analysis Pipeline tests. % % Sets up paths so source files are found. % Also defines a shared temporary folder. import matlab.unittest.fixtures.PathFixture; tests_folder = fileparts(mfilename('fullpath')); so...
%% About % This script run ICA on one dataset % TODO: CHECK IF BAD CHANS CORRESPOND TO FILE IN CURRENT LOOP %% 0.0 Prepare enviroment eeglab; % open eeglab to lighten paths to the eeglab ways close all; % close everything clc; % clear command line clear all; % clear enviroment %% 0.1 Directory and file names my_di...
function a = str2numcell(b) a= cell2mat(cellfun(@str2num,b,'UniformOutput',0));
%function theta= gradientDescent(X, y, theta) function[theta, J_history] = gradientDescentMy(X, y, theta, alpha, num_iters) %GRADIENTDESCENT Performs gradient descent to learn theta % theta = GRADIENTDESENT(X, y, theta, alpha, num_iters) updates theta by % taking num_iters gradient steps with learning rate alpha ...
%LU dengan pivoting function x = lu_pivoting(A,b) n = length(A); AA = A; bb = b; m = []; for i=1:n-1 t = find(abs(A(i:end,i))==max(abs(A(i:end,i)))); p = t(1)+i-1; A1 = A; b1 = b; A1(i,:) = A(p,:);A1(p,:)=A(i,:); b1(i)=b(p);b1(p)=b(i); m = [m;p]; for j=i+1:n lambda = A1(j,i)/A1(i,i);...
%%spherical surface % r=2; % surface=@(x,y) sqrt((r^2)-(x^2)-(y^2)); % surface_normal=@(x,y,z) [2*x,2*y,2*z]; % incident_direction=[0,0,-1]; % % x1=-1; x2=1; y1=-1; y2=1; % h=0.2; % x=x1:h:x2; y=y1:h:y2; % [X,Y]=meshgrid(x,y); % n=length(x);m=length(y); % Zexact=zeros(n,m); % for i=1:n % for j=1:m % ...
function integ=calka(c_in, i, dt, tt, lambda,Pe, NN) sum=0; t=i*dt; for j=1:i-1 it=j; tau=j*dt; switch(NN) %tlok case 1 f=c_in(it)*(dirac((t-tau)-tt)==inf)*exp(-lambda*(t-tau)); %expotencjalny case 2 f=c_in(it)*1...
function [] = coefficients_to_package_file_vhdl( coefficients,B,FileName) h = coefficients/max(abs(coefficients)); %el maximo del valor absoluto era positivo o negativo? abs_max_positive=0;%false for i=1:1:length(h) if h(i)==1 abs_max_positive=1;%true end end if abs_max_positive==1 %caso positivo(o a...
function [im_SR] = TRNRSR(im_l,XH,XL,upscale,patch_size,overlap,K,lambda) im_l = im_l./255; [imrow imcol ~] = size(XH); Img_SUM = zeros(imrow,imcol); overlap_FLAG = zeros(imrow,imcol); U = ceil((imrow-overlap)/(patch_size-overlap)); V = ceil((imcol-overlap)/(patch_size-overlap)); % hallucinate the HR patch ...
% % ISEL - Instituto Superior de Engenharia de Lisboa. % % LEIC - Licenciatura em Engenharia Informatica e de Computadores. % % Com - Comunicações. % % % time2.m % Função de teste. % function time2() % Limpar a consola. clc; % Mensagem de início fprintf(' Função time2 \n'); % Dimensão do vetor. vetor_size = 15000...
function setup_fastRPCA % SETUP_FASTRPCA Adds the fastRPCA toolbox to the path baseDirectory = fileparts(mfilename('fullpath')); addpath(genpath(baseDirectory)); fprintf('Loaded fastRPCA');
function linSys = ss(sys) %SS Convert a linear POLYSYS model to an SS object. % % LINSYS = SS(SYS) converts the POLYSYS model SYS to an SS object LINSYS. % The input SYS must be linear. % % See also LINEARIZE, ISLINEAR, SS. % 7.22.2007: TJW - Initial coding if islinear(sys) [nOutputs,nInputs] = size(sys)...
classdef PF_Fc_DwS < PF_Fc %PF_Fc_DwS Summary of this class goes here % Detailed explanation goes here methods function obj = PF_Fc_DwS(f) obj = obj@PF_Fc(f); end end end
function [A,B,C,D]= bcdLrMrNr_init(X,L_vec,M_vec,N_vec) %BCDLMN_INIT Random initialization for the BCD-(Lr,Mr,Nr) [I,J,K]=size(X); R=length(L_vec); A=cell(1,R); B=cell(1,R); C=cell(1,R); D=cell(1,R); % generate random matrices if isreal(X) for r=1:R A{r}=randn(I,L_vec(r)); B{r}=randn(J,M_vec(r)); C{r}...
function varargout = fPAFOIL7(varargin) func = varargin{1}; switch func case 'readline' varargout{1} = readline(varargin{2},varargin{3},varargin{4}); case 'minRows' varargout{1} = 1; case 'maxRows' varargout{1} = 1; otherwise error('invalid input optio...
function [a,c] = test_struct( s ) %UNTITLED4 此处显示有关此函数的摘要 % 此处显示详细说明 s = struct('a',1,'b',2); a = s.a/s.b; c = s.b; end
clear all % close all clc addpath data addpath toolbox set(groot,'defaultLineLineWidth',1.5); %% load and scale data load('australian_label.mat'); load('australian_sample.mat'); h = full(h); % rescale the data for j=1:size(h,2) h(:,j) = rescale(h(:,j), -1, 1); end %% parameters [m, n] = size(h); para.m = m; para...
function [returnx]=capacity_STAT_IFN_parallelfun(i,stim_spanMesh,par,name,N,freq,init_T,y0,obsv,sigma,type,stim_ind,t_discont,path) disp(num2str(i)) %Fisher Information estimation tic; par(stim_ind)=stim_spanMesh(i,:); [Tptemp M_term V_term TptempN M_termN V_termN stemp vartemp varinfo conc_traj_...
% A simple code to test convergence of codes % % problem parameters m = 2048; Tf = 0.30; n = 32; nref = 25600*4; % set reference solution if ~exist('uref', 'var') [xref, uref, tfref] = RK4_ammc(m, nref, Tf); end % check final time if abs(Tf-tfref)>1e-14, disp('Issue with final time'); end % select...
% 3.6 from 3 .csv file of trimming data, analysis and compare each other table_trim_no_redundant = readtable('trim_result_no_redundant.csv'); table_trim_redundant_prop = readtable('trim_result_redundant_prop_simple.csv'); table_trim_redundant_full = readtable('trim_result_redundant_full_jde_fix_03_08_17_49.csv'); arr...
% This function takes in a HED remap file and stores the old HED to new HED % tag mappings in a Map object. % % Usage: % >> remapMap = remap2map(remapFile); % % Input: % 'remap' The name or the path of the HED remap file containing % the mappings of old HED tags to new HED tags. This % ...
function Plot_sorted(Data,idx,C) [m,n]=size(C); figure; Colors=hsv(m); for i=1:m %plot data points plot3(Data(idx == i,1),Data(idx == i,2),Data(idx == i,3),'s','MarkerEdgeColor','k','MarkerFaceColor',Colors(i,:)); hold on; plot3(C(i,1),C(i,2),C(i,3),'s','Color',Colors(i,:)); ...
function ret = fibmat(n) A = [1,1; 1,0]; B = A^n; ret = B(1,2); endfunction %!assert(fibmat(0) == 0); %!assert(fibmat(1) == 1); %!assert(fibmat(2) == 1); %!assert(fibmat(3) == 2); %!assert(fibmat(4) == 3); %!assert(fibmat(5) == 5); %!assert(fibmat(6) == 8); %!assert(fibmat(25) == 75025);
function [good_labels,all_labels,all_thdist,all_gmask] = CC_extract_good_labels(meth) % function [good_labels,all_labels,all_thdist,all_gmask] = CC_extract_good_labels(meth) % % This function loads the mean correlation and mean RMS amplitude values % computed by CC_transcort2_auto and applies a 2-dimensional linear % t...
function [ label, proba,negative, depth ] = classifyProba( tree, x ) % CLASSIFYPROBA classify input to a label using a decision tree. % label = classify(tree, x) % use of an accumulator function to multiply the probability of each node at each iteration [ label, proba, negative, depth ] = classifyProbaAcc(tree...
% update dataFile name if XStimParams.testnum < 10 FN.data = [num2str(XStimParams.bird_number)... XStimParams.recording_site... '00'... num2str(XStimParams.testnum)]; elseif XStimParams.testnum < 100 FN.data = [num2str(XStimParams.bird_number)... XStimPa...
function y = pad_divisible(v, M) % pad zeros at the end of v to make its length divisible by M s=size(v); padlen = mod(M- mod(s(2),M),M); if padlen > 0 y = zeros(s(1),s(2)+padlen); y(:,1:s(2))=v; else y=v; end
clear; normal = [1,2]; interictal = [3,4]; ictal = 5; snr_ssim_index = 1; %% Naming = metric_optimizedForMetric ssim_ssim_index = 2; snr_snr_index = 3; ssim_snr_index = 4; snr_smooth_index = 5; ssim_smooth_index = 6; avgSNRNormal = zeros(1,100); avgSNRInterictal = zeros(1,100); avgSNRIctal = zeros(1,100); avgSSIMNo...
clc; % Масса params.m = 3000.0; % Матрица тензора инерции params.J = [5000.0, 0, 0; 0 , 10000, 0; 0 , 0 , 10000]; % Матрциа обратная матрице тензора инерции params.invJ = inv(params.J); % Функция силы от времени % Текущее значение силы интерполируется по таблице значений...
function [ stopSampling, p, whichCaudal ] = determineMisMatch( judging, p, trial) %% determineMisMatch: determines if stimuli are misMatching stopSampling = 0; whichCaudal = 0; % compares the difference in the maximumly selective layer of the network % to the current and previous stim to a funning familiarity differenc...
%Determining and removing drawbacks of exponential and running mean %Eugenii Israelit,Dmitry Shadrin,Skoltech, 2016 clc clear all close all n=200; t=32; X(n)=zeros(); A(n)=zeros(); Z(n)=zeros(); W=normrnd(0,0.08,1,n); N=normrnd(0,0.05,1,n); w=2*pi()/t; A(1)=1; %generating an oscilations for i=2:n A(i)=A(i-1)+W...
close all; clear all; clc; Time = 0.0; dt = 0.01; figure while Time < 15 theta = sin(Time); ang = theta*pi/180; c = cos(ang); s = sin(ang); a = [1;0;0]; R = [c -s 0; s c 0; 0 0 1]; b = R*a; axb = cross(a,b); k = axb/norm(axb); Q1 = [0.1;0.1;0.1]*10; Q2 = [-0.1;-0...
% Generates data (and plots) for mantle density structure and figure S1. addpath('figures/') % Sulfide EOS. EOS_params_MgS.molar_mass = molar_mass(["Mg" 1; "S" 1]); EOS_params_MgS.T_0 = 298; EOS_params_MgS.rho_0 = 2661; % 4 MgS/cell molar_mass / 140.68 A^3/cell EOS_params_MgS.K = 78.9e9; EOS_params_MgS.K_d = 3.71; EO...
function obs = gen_signals_140618_kwv2(parms, timing_parms, dofigs,doSub) % function obs = gen_signals_140328(parms, timing_parms, dofigs,doSub) % set up parms for pulse sequence and known constants % ... time units are in seconds doRK = 1; % do Runge-kutta method dt = 0.01; r1a = 1/1.67; % get parms from t...
clc clearvars dataSet = load('pima-indians-diabetes.csv'); format long; n = size(dataSet, 2) - 1; %Labels training_label = dataSet(1:615,9); test_label = dataSet(615:768,9); %Feature Scaling temp_data = dataSet; min_temp_data = min(temp_data,[],1); max_temp_data = max(temp_data,[],1); diff = max_temp_da...
function f_mem = force_membrane_2D(S,P) % S is the vector containing the location of the vertices % instead of for loops vector and matrices are used , the notation is related % with the Supplementary Material S_x = s_i^x, S_x_p = s_{i+1}^x % pomega_ps = d\Omega / ds S_x = S(:,1); S_x_p = [S(2:end,1); S(1,1)];...
function [ ineqc, eqc] = constraints(w) %UNTITLED3 Summary of this function goes here % Detailed explanation goes here % currently, no constraints for weights ineqc = []; eqc = []; end
function [B,A,C,M,M1,N,N1,NumFrames,NumCols,NumRows,FrameInt,AcquisitionRatio,ActMap] = daRead3(daFile,XCoord,YCoord) %this function plots the time series for a single pixel of the redshirt %camera, both filtered and unfiltered. Pass it the file name and %coordinates. (1,1) is top left. It returns three matrices:M, N,...
function [ fullfills_kraft, summation ] = test_kraft( cl ) summation = sum(2 .^ -cl); fullfills_kraft = summation <= 1; end
function segments = HelperSegmentSpeech(audio,Fs) %HELPERGETSPEECHSEGMENTS Extract speech segments from audio signal. % Copyright (c) Theodoros Giannakopoulos All rights reserved. % % Redistribution and use in source and binary forms, with or without % modification, are permitted provided that the following condition...
% the true value of hand-eye calibration % [Rc Tc; 0 1] Tc = [0.0325;0.27;0.0438]; Rc = [1 0 0; 0 -1 0; 0 0 -1]; % you can also use the following Rc for a test %Rc = [0.9942 0.0537 -0.0931; % 0.0398 -0.9886 -0.1450; % -0.0998 0.1404 -0.9850]; invRc = inv(Rc); % the true value of TCP c...
set(0, 'defaultAxesFontSize', 12); set(0, 'defaultTextFontSize', 20); set(0, 'DefaultAxesLineWidth', 1.0, 'DefaultLineLineWidth', 1.5); a_arr = 1:-1:-1; % a_arr = 0; for a0 = a_arr %% parameter definition % jerk constraint s = 1.5; % initial condition kmph2mps = 1 / 3.6; v0 = 10.0 * kmph2mps; % [m/s] % a0 = -2.0; % ...
function fig1_regulation(Fig1ax,linewidth,fontsize,seed,cutoff) %This script plots the timecourses of figure 1 %Good regulation cell rng(seed); axes(Fig1ax(5)) par.N = 1; par.gamma_tot = 50; par.P = 1; par.c = 100; par.max_t = 2500; par.beta = 2; par.delta = 1; par.feedback = 1; par.epsi = 1e-5; max_growth = 0.5*par...
% This script generates the roots of Bessel functions. % The (m+1)-th line for the Bessel function of order m % The l-th colomn for the l-th positive zero % Up to the order of m_max m_max = 10; % First l_max positive zeros l_max = 15; % The accuracy of the roots accuracy = 1e-5; % The maximum root should be less th...
%% TEST GAUSSIAN 1D FILTER clc clear all close all t=linspace(0,20,2^11); %time vector in seconds w=1; %in Hz (is the frequency of the created signal) signal=cos(2*pi*w*t) + cos(40*2*pi*w*t); % Signal in seconds % dt=t(2)-t(1) ; %Is the inverse of the samplig rate of th...
%********************************************************************* % Theory of the Hilbert Spectrum: Code Examples for Reproducible Research %********************************************************************* % % Description: This Demo file shows illustrates Hilbert Spectral Analysis % on a synthiti...
function organizedata = organizedata(colposition) folder = 'C:\repos\ann-arrhythmia\diag\standard\abnormal\'; files = dir([folder '*.csv']); for i=1:length(files) load([folder files(i).name]); end all_vectors = [X107m;X108m;X109m;X112m;X113m;X114m; X115m;X116m;X119m;X2...
function proj=loadprojindexed(projfile,chindices,numchannels,numfiles,indexes) fid=fopen(projfile,'r'); projfp=fread(fid,[numchannels,numfiles],'int32'); projfp=projfp(chindices,:); for ch=1:size(chindices,2) for fnum=1:numfiles fseek(fid,projfp(ch,fnum),'bof'); [proj{ch,fnum},count]=fread(fid,[3,max(indexes{ch,fn...
function [xJ] = NewtonRaphsonStep(xO, fdotValue,fddotValue) xJ = xO -(fdotValue/fddotValue); end
function [J, sigma1]=simplewnrsigma(I,psf,sigma,regparam) if nargin<4 regparam = 0.001; end [ny,nx]=size(I); H = psf2otf(psf, [ny,nx]); RegInvfilter = (conj(H)) ./ ((abs(H).^2 ) + regparam); J= real(ifft2(RegInvfilter .* fft2(I))); if nargout>1 Invfilt = real(ifft2(RegInvfilter)); cx=floor(nx/2)+1; cy=...
function [chosen] = roulette_selection(candidate, mu) % linear (roulette wheel) selection fitsum = sum(candidate.fit); % sum up all of the fitnesses from every candidate candidate.p = candidate.fit./fitsum; % compute the 'probability' of picking each candidate candidate.ps ...
format long A = []; b = []; Aeq = []; beq = []; nVars = 7; %Decision vars % nrot L b, C, theta0, thetaMin, Airfoil %int : nrot b airfoil lb = [4; 1; 2; 0.05; deg2rad(0); deg2rad(0); 0]; ub = [8; 1.5; 6 ; 0.3; deg2rad(14); deg2rad(14); 1]; x0 = [6; 1; 0.15; deg2rad(10); deg2rad(10); 0]; options = optimoptions('g...
function [xymatrix_ring, s_cloud, colvect_cloud] = al_staticConfettiCloud() % AL_STATICCONFETTICLOUD This function loads the data for a static % confetti cloud that "covers" the confetti cannon load('x_cloud.mat', 'x_cloud') load('y_cloud.mat', 'y_cloud') load('s_cloud.mat', 's_cloud') load('col...
%********************************************************************************************** %**************************** CHAPTER 3: RIGID-BODY MOTIONS ********************************* %********************************************************************************************** function V = se3ToVec(se3ma...
function [DOS, e]=kvspec(E,d,g,T,r,B) % builds the d-wave DOS for given delta and gamma and Temperature % Input: E = range of energies % d = delta % g = gamma (optional) % T = temperature (optional) % r = number of data points on plot. (optional) % B = how much weight on the second ha...
function [out,inRange,outRange] = imScale(varargin) %IMSCALE Rescale image pixel values as desired % OUT = IMSCALE(IMG) Rescales image IMG with default parameters. % OUT = IMSCALE(IMG, INRANGE) Specifies input range INRANGE. % Default is [min(img(:)),max(img(:)] % OUT = IMSCALE(IMG, INRANGE, OUTRANGE) Specifies ...
function comp_hist(X, bin) figure; histfit(X, bin, 'Normal'); % Normalize histogram Y = get(gca, 'YTick'); set(gca, 'YTick', Y, 'YTickLabel', Y/numel(X)); end
function [options,Gamma] = checkoptions_spectra (options,ndim,T) if nargin==3 if iscell(T) T = cell2mat(T); T = T(:); end end % MT and common if ~isfield(options,'p'), options.p = 0; end if ~isfield(options,'removezeros'), options.removezeros = 0; end if ~isfield(options,'completelags'), options.compl...
function [] = squeeze_axes(ax, fx, fy) %% function [] = squeeze_axes(ax , fx, fy) % this function squeezes a given set of axes ax % by factor fx in the horizintal and fy in the vertical ox = 1; oy = 1; ex = 1; ey = 1; for i = 1:prod(size(ax)) tmp = get(ax(i), 'Position'); ox = min(ox, tmp(1...
function z = applyWT(est,w,N); % z = applyWT(est,w,N); % transpose operator of applyW. % est is a data vector of length N, % w is an array of weights to convolve K = size(w,2); n = size(w,1); % apply w < in backward (i.e. transpose) direction gtg = floor(n/2) - 1 + (1:N); for k = 1:K intz = conv(est, w(n:-1:1,k)...
function [f] = dobjfunc(X, str_labelFileName, varargin) % NAME % % function [f] = dobjfunc(X, str_labelFileName, varargin) % % ARGUMENTS % % X in (vector) a vector of weights % str_labelFileName in (string) FreeSurfer label file % describing refernce % (optimal) trajectory % verbosity in (integer) an op...