text
stringlengths
8
6.12M
function [regions,t,a] = load_covid_jhu(vars,folder) %If input folder doesn't exist yet if !exist(folder,"dir"), mkdir(folder); end %Load region data from JHU github repository and write it to csv file or %read it straight from file if it alrady exists fname = fullfile(folder,"jhu.csv"); if !exis...
function dataStruct = dataStructSegment(dataStruct, varargin) %DATASTRUCTSEGMENT Segments MRI structural images into CSF, WM, and GM components. % % SYNTAX: % dataStruct = dataStructSegment(dataStruct, 'PropertyName', PropertyValue...) % % OUTPUT: % dataStruct: The human data structure with referenc...
function [LaminarData] = GetLaminarPhase(spikeTimes,LFP,chanMap,Fs,filtBand,GP) % Code to calculate the laminar profile of linear electrode data. The code % takes as input: % spikeTimes = a Mx1 cell array of M channels having N spike times in msec % in each cell. % LFP = a MxN array of M channels having N time poi...
% 2012-2018.mat is just the csv files converted to matlab form using the % importing tool. addpath(genpath('Matlab Files')); load("2012-2018.mat"); % create training and test splits % 288 is 144 matches which is approx %70 train2012 = AFLStats2012(1:288,2:31); test2012 = AFLStats2012(289:414,2:31); train2013 = AFLSt...
i = 1; filename = ['d' num2str(i)]; load(filename) fw_traces.period = [10000; fw_traces.period]; fw_traces.pip = [1.0; fw_traces.pip]; % plot PI_delta plot(fw_traces.period / 1000, 1 - fw_traces.pip, 'r^-'); hold on; % plot utilization u = (1./(fw_traces.period / 1000)) / 0.1; plot(fw_traces.period / 1000, u, 'bs-...
vtolParamHW7; % load parameters % instantiate spring, controller, and reference input classes % Instantiate Dynamics class vtol = vtolDynamics(P); ctrl = vtolController(P); amplitude = 1; % amplitude of reference input offset = 0; frequency = 0.01; % frequency of reference input reference = signalGenerator(amplitu...
%mlStructured light method - this method seems to be simpler and provide better %calibration...testing needed % Extract projector-camera color correspondences. addpath('/Users/jacoverster/Desktop/Test_color_calib/light_off') %Ainv_original = % 1.8297 -0.0189 -0.0454 % -0.6188 1.5252 -0.3168 % -0.1377 ...
function [outputArg1,accuracy] = naive_classifier(n,m,d,train,test,v) %This function executes various calculations like computation of priori %probabilities, likelihood probabailities, postpriori probabailities for %the Naive bayes classifier. %The likelihood probability is computed incorporating the laplace sm...
function [Max, Min] = MM(A) % 计算最大最小值 Max = max(A(:)); Min = min(A(:)); fprintf("max=%f, min=%f\n",Max,Min);
function mdw1dstem(axe_IN,cfs_IN,longs,stem_ATTRB,txt_ATTRB) %MDW1DSTEM Multi-Signal 1-D stem. % M. Misiti, Y. Misiti, G. Oppenheim, J.M. Poggi 22-Jun-2005. % Last Revision: 20-Jul-2010. % Copyright 1995-2010 The MathWorks, Inc. % $Revision: 1.1.6.2 $ $Date: 2010/08/11 14:38:33 $ % Defaults. %---------- a...
[fName,fDir,fFilter] = uigetfile('*.txt;*','Open data file',... 'E:\Decathlon Raw Data'); delim=find(fName=='_'); delim=delim(end); fName(delim+1:end)=[]; cenID=strcat(fDir,fName,'Centroid.dat'); motorID=strcat(fDir,fName,'Motor.dat'); labelID=strcat(fDir,fName,'labels.dat'); areaID=strcat(fDir,fName,'Area.dat'); ...
%This code takes eigenvalues (from eigfolder) and the normalized ??? %(ie. cos? = (???)/????b? from wdotbfolder). It then plots %controllability magnitudes and angles of controllability magnitude set(0,'defaultlinelinewidth',3) set(0,'defaultaxesfontsize',32) selected_bcls = [600:-10:80]; parameterflag = 4; B ...
%% Here we close video and audio devices and shows cursor if removed function close_program(pahandle, MEG) ShowCursor; Screen('Closeall') PsychPortAudio('Close', pahandle) if MEG.use MEG.bitsi.close(); end end
% 16-741 Mechanics of Manipulation, Fall 2015 % Author: Sung Kyun Kim (kimsk@cs.cmu.edu) % % W: a set of normalized contact screws [[cix; ciy; ciz; c0ix; c0iy; c0iz] ...]; 6x(NM) matrix % bFC: a flag which is true if the grasp is force closure; boolean % zmax: the maximum value of the objective function at the optimal ...
function [input_img,output_img,accuracy,L_k,output_img_name,flag1] = recognize(test_img_path,pca_transf_mat,L,D,k) % A function to recognize test image using pca %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Input parameters % test_img_path path for test image % ...
% Octave GNU Plotting % % Copyright (c) 2012-2015 Matthias Schmid <ramsondon@gmail.com> % % 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, including without limitation the...
%% Load saved NREM data (Avoids running previous code) %Reference C6=load('C6.mat'); C6=C6.C6; %PFC C9=load('C9.mat'); C9=C9.C9; %Parietal C12=load('C12.mat'); C12=C12.C12; %Hippocampus C17=load('C17.mat'); C17=C17.C17; %Timestamps T6=load('T6.mat'); T6=T6.T6; %Time lenght per epoch tiempo=load('tiempo.mat'); tiempo=t...
function dy = model(~, y, p) dy = zeros(3,1); dy(1) = -p(1) * y(2) * y(1); dy(2) = p(1) * y(2) * y(1) - p(2) * y(2); dy(3) = p(2) * y(2); end % beta = p(1), gamma = p(2),
function Flag = isanystri(X,List) % isanystri True if string is found in list, case insensitive. % % Syntax % ======= % % Flag = isanystri(X,List) % % Input arguments % ================ % % * `X` [ char ] - Input string that will be matched against the `List`. % % * `List` [ cellstr ] - List of string...
% ------------------------------------- % Gaetan Facchinetti % Cours C03 : methodes numeriques % % TP6 : Volumes finis en 1D % -> Avec limiteur de pente % ------------------------------------- % ---- INITIALISATION DES PARAMETRES INITIAUX % Nombre de points, temps max N = 1600; T = 4.0; % Pas d'espace : longeur d'...
function [dist1,dist2]=distcal1(spimg,targetimg,bdctresult,T) %calculate distance change of single image %reshape images if length(spimg(:))~=length(targetimg(:)) || length(spimg(:))~=length(targetimg(:)) fprintf('image size is not the same\n'); return end pixnum=length(spimg(:)); imgwid=sqrt(pixnum);...
classdef unit < double properties (SetAccess = immutable) name = 'dimensionless' % unit name dimensionality = [] % dimensionality of unit value = 1 % base system equivalent value, 1 for base units offset = 0 % offset from reference value aliases = {} % pseudonyms and abbrevia...
%plots imagesc of grid with NaNs as white %http://www.mathworks.com/matlabcentral/newsreader/view_thread/140607 function imgsc = plot_grid(grid, curr_loc, dest_loc, home, resources) maxval = 110; grid(isnan(grid)) = maxval + maxval/10; imgsc = imagesc(grid); caxis([-100 110]); set(gca,'ytick',1:size...
function varargout = bicolordef(varargin) % BICOLORDEF MATLAB code for bicolordef.fig % BICOLORDEF, by itself, creates a new BICOLORDEF or raises the existing % singleton*. % % H = BICOLORDEF returns the handle to a new BICOLORDEF or the handle to % the existing singleton*. % % BICOLORDEF('CALL...
% Representation for the attachments for the entire system. The system is % comprised of the attachments for a cable, which contains the individual % attachment points. % % Author : Darwin LAU % Created : 2016 % Description : classdef AttachmentPointParamSystem < handle properties (SetAccess...
%% range_stim = 1:12; n = round(length(range_stim)*1.1); clrmap = hsv(max(1,n)); anat_yx_norm = getappdata(hfig,'anat_yx_norm'); figure; hold on; image(anat_yx_norm) axis equal axis ij axis off range_fish = 8:11; for i_fish = range_fish, IX = ~isnan(Fish{i_fish}.xyz_norm_avr(:,1)); scatter(Fish{i_fish}.xyz_...
function [Reg_model,rms] = learn_one_BLSregressor(Data,LearnedDistribution, options, current_cascade) nData = length(Data); n_points = size(Data{1}.shape_gt,1); shape_dim = 2*n_points; n_init_randoms = options.augnumber; if strcmp(options.descType,'sift') == 1 desc_dim ...
function Z = mydetectorMod(x, smoothLength, thresh) % % INPUTS: % - x is output of one of your filter. % - smoothLength is length of moving average filter to smooth out the % variations. % - thresh is the threshold level for amplitude to flip to 0 or 1. % % OUTPUT: % - Y is the vector filtered output with bette...
% obliczanie estymatora widmowej gestosci mocy % transformata Fouriera funkcji autokorelacji procesu ergodycznego % metoda Blackamana-Tukeya (okienkowanie autokorelacji) clear all; clf; subplot(1,1,1); N = 1000; % liczba probek sygnalu fs = 1000; % czestotliwosc probkowania n = 0:(N-1); % indeksy [rpbel dt = 1/fs; % o...
filefolder = 'C:\Users\praveen\Desktop\imgp\1\Input Images\'; imagefiles = dir(fullfile(filefolder,'*.*')); nfiles = length(imagefiles); count = 0; for i=9 filename = imagefiles(i).name; fullfilename = fullfile(filefolder,filename); im = imread(fullfilename); [rows column depth] = size(im); if(dept...
function [dirIndcs,dirSigns] = alignCVdirsDR(weights1,weights2) nComps = size(weights1,2); indcs = 1:nComps; dirIndcs = 1:nComps; dirSigns = ones(1,nComps); for i = 1:nComps cossvals = weights1(:,i)'*weights2; [val,idx] = max(abs(cossvals)); dirIndcs(i) = indcs(idx(1)); if cossvals(idx)<0 ...
function str = cleargds(str) % This function deletes existing gds data in str. % SF, May 2 2007 str.gds = [];
function vec = interp_obstacle(obstacle,rho) %%definne obstacle coordinates X = obstacle(1,:); Y = obstacle(2,:); Z = obstacle(3,:); vec = []; %%interpolate along each edge for z = Z for x = X yvec = linspace(Y(1),Y(2),rho)'; yvec = [x.*ones(rho,1),yvec,z.*ones(rho,1)]; vec = [vec;yvec]; ...
# Add all the natural numbers below one thousand that are multiples of 3 or 5. # ---------------------------------------------------------------------------- # execute within Octave session session using "source q1.m" in this dir. # brute force: filter and sum clear all tic ns = 1:999; sum((mod(ns,3)==0 | mod(ns,5)==0...
datos [t, x] = meulermej(f, intervalo, x0, N); graficas
X = []; y = []; o1 = [-25 -25] r1 = 25 o2 = [25 25] r2 = 25 for i = -100:100 for j = -100:100 X = [X; i j]; f = 0; x = [i j]; if norm(x-o1) < r1 f = sqrt(r1^2 - norm(x-o1)^2); elseif norm(x-o2) < r2 f = sqrt(r2^2 - norm(x-o2)^2); end y = [y; f]; end end figure; scatter3(X(:,1...
function plotAngles(model_index, out) model = strcat('Model', int2str(model_index)); figure('WindowState', 'maximized'); subplot 211 hold on, grid on, box on yyaxis left ylabel('YAW ANGLE [deg]'); plot(out.tout', out.logsout.find('BlockPath', strcat(model, '/yaw_angle[deg]')).getElement(1).Values(:,1).Data, ... '...
function C = RandColor(index) %function C = RandColor(index) % outputs a random color uniformly in RGB if(nargin > 0) z = Colors; C = z(1+mod(index,size(z,1)),:); else C = [rand rand rand]; end function C = Colors C = [0,1,2,3,5,6,8,9] * .1; C = repmat(C(:),[2,1]); C(1:10,2) = 1; C(1:10,3) = 1; C(11:20,2) = ....
function Xs = CubeRoot(p) F1=@(x) x^3-p;%주어진 함수 F1_x=@(x) 3*x^2;%x로미분 xi=p;%초기값 fail=0;%초기값 for i=1:20 Xs=xi-(F1(xi)/F1_x(xi)); if abs((Xs-xi)/xi)<0.00001 disp('Success')%원하는 값을 얻었다 fail=1; break end xi=Xs; end ...
% Final Project - Interest Points Detection and Image Matching % Author: CÚline Bensoussan & Jill Perreault % Course: Computer Vision % Date: April 15, 2013 function theta = gradientOrientation(im, sigma) % GRADIENT ORIENTATION: Calculate the direction angle of the gradient (orientation) % % theta = gradient(im, si...
info = dicominfo('./IM00002.dcm'); Y = dicomread(info); figure dicomwrite(Y, 'sc_file.dcm'); imshow(Y,[]);
clear; clc; max_user_ratings = 100; buff=20; num_movies = 10; %read data about movies MovieData = readtable('movies.csv'); %wczytanie pliku z macierza korelacji CorrMatrix = csvread('CleansedCorrMatrix.csv'); %create helper vector fid = fopen('corrMatrix.csv'); a = textscan(fid,'%s',1); fclose(fid); str = char(a{1})...
function model = loadSDIMS(file_sdims) %Go through the file line by line creating the model %This is a tree structure which will keep track of the model, later it is %converted to XML doc readable by our EKF. The root node only contains the %world frame information. %Create empty tree model = tree(); %Keeps track of...
function [angle, range,phase1,phase2,MY_PHI] = analyze_results_test_m_engin(fliename) %fname = 'Sparameter_2017_07_07_11_41_35.csv'; vnaCfg = struct('Nrx', 3, 'startFreq', 6.25e9, 'stopFreq', 6.75e9); % vnaCfg = struct('Nrx', 3, 'startFreq', 3e9, 'stopFreq', 8e9); pkCfg = struct('relThresh', 0.3, 'Npk', 3); fname = f...
a = zeros(1,10); for n = 1:10 a(n) = sin(n-1); end input = a + 0i; output = fft(input);
function Graph = graphical_lasso(S,rho) dim = size(S); n = dim(1,1); p = dim(1,2); max_iterations = 100; tolerance = 1e-4; % Initialize W W = S + rho*eye(p); W_prev = W; for iter=1:max_iterations for j=p:-1:1 i = j; W11 = W; W11(i,:) = [...
function [di,filtered_fixed,transformed_moving] = differenceImages(fixed,moving,spacing,A,b,method,filter,sigma,radius) % crosshair = vargin{1}; % crange = vargin{2}; % if nargin < 10 % crosshair = round(size(fixed) / 2); % end % if nargin < 11 % crange = [-1000 1000]; % end if nargin <= 6 ...
classdef VerMacData < handle properties all_data; data_day; config_file; end methods %=============================================================== % initialize object properties with all the raw data funct...
% source: https://www.mathworks.com/examples/matlab-communications/mw/comm_product-OFDMvsUFMCExample-ufmc-vs-ofdm-modulation clc; close all; clear; s = rng(211); %% Parameters numFFT = 512; % number of FFT points subbandSize = 20; % must be > 1 numSubbands = 10; % numSubbands*subbandSize <= numFFT subb...
% mu: 2x1 matrix % Sigma: 2x2 matrix % phi: a number % mu0 = [0;0]; % Sigma0 = [1, 0; 0, 1]; % mu1 = [1;1]; % Sigma1 = [1, 0; 0, 1]; % phi = 0.5; % plot_ex1(mu0, Sigma0, mu1, Sigma1, phi, 'Line', 1); % % mu0 = [0;0]; % Sigma0 = [1, 0; 0, 1]; % mu1 = [1;1]; % Sigma1 = [1, 0; 0, 1]; % phi = 0.9; % plot_ex1(mu0, Sigma0,...
function prediction=S4VM(labelInstance,label,unlabelInstance,kernel,C1,C2,sampleTime,gamma) % S4VM implements the S4VM algorithm in [1]. % ======================================================================== % % Input: % S4VM takes 8 input parameters(the first three parameters are necessary, % the rest are opt...
function [ chaincodes ] = im_chaincodes( datafile, region_size ) if (isdatafile(datafile)) images = data2im(datafile); length = size(datafile, 1); elseif (iscell(datafile) && ismatrix(datafile{1})) images = datafile; length = size(datafile, 1); elseif (ismatrix(dataf...
function newROI = duplicateStimROI(StimROI) if length(StimROI.scanfields)>1 error('ROI contains multiple scanfields'), end sf = StimROI.scanfields; newSF = scanimage.mroi.scanfield.fields.StimulusField(sf.stimfcnhdl,sf.stimparams,sf.duration,sf.repetitions,... sf.centerXY,sf.scalingXY,sf.rotation...
qw = bwlabel(imSegAr); ab = imSegAr; for i=1:length(centAr) flag = 0; for j=1:length(destCoord) if(centAr(i)==destCoord(j)) flag = 1; % disp('hi'); end end if (flag==1) ab = ab - (qw(:,:)==i); end end
function [Prediction] = ItemBasePrediction(a,index,TestSet,TrainingSet,TestThreeRateIndexOrg,k,knn) [~,column] = size(a); count=0; countRateSim=0; sumofSim=0; for i=1:column if(TrainingSet(index(1,i),TestThreeRateIndexOrg(k,1))~=-1 && count<knn) countRateSim= countRateSim + ((a(1,i))*(TrainingSet(i...
function [ img norm_events sum_events ] = plotProcEvents( events, fields, pixelWidth, figname_prefix, allEventTypes, colorMap, lineTypes, timeInterval) %plotTiming draws an image that represents the different activities in MPI % The function first parses the data and generate a normalized event map % with dimension...
function [ nevheader, spikeheader, nevstimheader ] = nevGetHeaders( fid ) % % function [ nevheader, spikeheader, nevstimheader ] = NEVGetHeaders( fid ) % % Reads the header data from a nev file - see the nev spec for interpretation % % Written by Dave Warren nevheader =[]; spikeheader= []; nevstimheader= [...
function [ T ] = ZSR(X, Y, U, V, opt) %%%%%%%%%%%%%%%%%%%%%% % set default values %%%%%%%%%%%%%%%%%%%%%% if ~isfield(opt,'beta') || isempty(opt.beta), opt.beta = 2; end; if ~isfield(opt,'omega') || isempty(opt.omega), opt.omega = 0.7; end; if ~isfield(opt,'lambda') || isempty(opt.lambda), opt....
I = imread('DinosaurPrints.jpg'); I = rgb2gray(I); I = im2double(I); %figure; I = imresize(I, 1/3); figure, subplot(1, 2, 1), imshow(I); %Ic = edge(I, 'canny', [0.20 0.25], 16); %subplot(1,2,2), imshow(Ic), title('Canny Filter [0.20 0.25], 16') nl = colfilt(I, [100 100], 'sliding', @findPrint); subplot(1, 2, 2), imsh...
delta0=6.8323; %delta0=8; <====== check for T*0.7 %delta=[0.8*delta0 0.9*delta0 delta0 1.1*delta0 1.2*delta0 1.3*delta0]; T=0.55*delta; T=[0.55*delta0 0.6*delta0 0.65*delta0 0.72*delta0 0.8*delta0 0.85*delta0]; delta=delta0*ones(1,6); snr=zeros(1,6); lenbits=zeros(1,6); for ia=1:6 qcf=quanTHD(sub,T(ia),delta(...
function test_predict() %c = predict(Theta1, Theta2, X); c = predict(ones(3, 8), ones(1, 4), ones(9, 7)); assert(c, ones(9, 1)); c = predict(ones(3, 8), ones(1, 4), magic(7)); assert(c, ones(7, 1)); c = predict(-1/170*ones(3, 8), -1/3*ones(1, 4), magic(7)); assert(c, ones(7, 1)); pre...
addpath('jsonlab') basedir = '/run/user/1000/gvfs/sftp:host=ipns.compute.dtu.dk/home/sdka/data/actigraph/'; file_list = getAllFiles(basedir); for i=1:length(file_list) file = file_list{i}; [pathstr,name,ext] = fileparts(file); [~,sub_name,~] = fileparts(pathstr); if strcmp(ext, '.gt3x') d...
function Y = KANG_FFC(janela) %UNTITLED2 Summary of this function goes here % Detailed explanation goes here N = length(janela); teta = 2*pi/N; Xre = 0; Xim = 0; for m = 0:N-1 Xre=Xre + (2/N)*janela(m+1)*cos(teta*m); Xim=Xim - (2/N)*janela(m+1)*sin(teta*m); end for m = 0:N/2-1 Xre_odd =...
%Operadors morfologics %%%sang clc; I = imread('blood5.tif'); B = I < 128; F = imfill(B,'holes'); %imshow(F); radi = 6; SE = strel('disk', radi); E = imerode(F, SE); %erosionem la imatge F %figure;imshow(E); E = imerode(E, SE); %apliquem una altra erosio %figure;imshow(E); %%% cafe I = imread('cafe.tif'); B = I < 16...
classdef Processor < handle %PROCESSOR Summary of this class goes here % Detailed explanation goes here properties minV = -20; end methods function [T,V,invalid] = getVelocities(this, t, Vms, distances) nruns = length(Vms); if isscalar(dis...
% add QSM.m to path run('/path/to/QSM.m/addpathqsm.m'); % Philips PAR/REC or XML/REC filename = '/path/to/input/file.par/or/file.xml'; outpath = '/path/to/save/results'; % Constants for normalizing phase B0 = 3; GYRO = 267.513; % Load dataset [hdr, data] = parxrec(filename); mag = data(:,:,:,:,1); % for multi-ec...
function [mOS, plotst,condst] = calltestUnequal(f,COND,ANLYZ,mEq) curs = f.UCUR(COND,:); m3 = f.ms(ANLYZ,curs(1)); m4 = f.ms(ANLYZ,curs(2)); [mOS, plotst, condst] = testUnequal(m3,m4,mEq); plotst.conds = curs; end
function opt = NP_getOpts(subjID,varargin) % Function to get struct with default analysis pipeline options % example: % % Example 1: % opt = getOpts('verbose', false) % Example 2: % opt = getOpts('foo', true) opt.subjID = subjID; % --- GENERAL --- opt.verbose = true; % General opt.plo...
function something = signchange(xfunc, yfunc) something = find((yfunc(1:end-1)>0 & yfunc(2:end) < 0) | (yfunc(1:end-1)<0 & yfunc(2:end) > 0) ); end
% % % % % DHO, 8/10. % classdef BTStimTimingArray < handle properties mouseName = ''; sessionName = ''; sessionType = ''; trim = [2 20]; % The number of trials to trim from beginning and end. performanceRegion = []; % Beginning and ending behavioral trial numbers for b...
function [lambda1,fval,exitflag1,output1] = solveLambda1(vawt, iTSR, ith, alphaAnt) %SOLVELAMBDA1 Solve interference factor at an azimuthal angle % position % % [lambda1,fval,exitflag1,output1] = vawt.solveLambda1(iTSR, ith, alphaAnt) % returns the interference factor (lambda1) for the gi...
clearvars DIR='Parte_2/'; IMAGEN=imread(strcat(DIR, 'face04.ppm')); K=4; %Modelo HSV HSV=rgb2hsv(IMAGEN); minValue=min(min(HSV(:,:,1))); maxValue=max(max(HSV(:,:,1))); [vls pks]=findpeaks(imhist(HSV),'minPeakDistance',floor(255/K*.5)); semillas=pks(1:K)/255; imagen_k_hsv= bayes(K,HSV,semillas); % imshow(hsv2...
function [E] = solve_l1l2(W,lambda) % SOLVE_L1L2 Vectorized implementation of the prox operator of the l1l2 norm % % Mehdi Bahri % Imperial College London % August, 2016 E = W*diag(max(1 - lambda ./ diag(sqrt(W'*W)), 0)); end % function [E] = solve_l1l2(W,lambda) % n = size(W,2); % E = W; % for i=1:n %...
clear all; close all; clc addpath('../modules/configs'); datapaths = configPaths(); ID = 'img_5976'; % filename instanceData = loadInstance(datapaths,ID); load('tmpLabImg'); addpath('../modules/myregionmerging'); opt.sensitivityMerging = 0.9; % 0 ~ 1 opt.minSize = 0.9; zzz = cat(3,instanceData.spweight,instanc...
classdef RigidBody < CoordinateFrame % A coordinate frame that is rigidly attached to the CoM position of % a rigid link. In addition, this class also stores the mass and % inertia of the rigid link to which the frame is attached. % % Copyright (c) 2016-2017, AMBER Lab % All right reserved. ...
function res = IF(condition, true_action, false_action) % substitutes C++ like ? operator. When either of actions can be evaluated only if condition holds/doesn't hold, it needs to be passed as function handle. % % Usage - simple: x = IF(a>b, 1, 0); % Usage - deferred evaluation: x = IF(~isempty(a), @()a(1), 0); % ...
clear all; close all; clc; delete(instrfind({'Port'},{'COM15'})) telapsed = 0; strfile = sprintf('wearable_%s.txt', datestr(now,'mm-dd-yyyy HH-MM'));s = serial('COM15','BaudRate',115200); s.ReadAsyncMode = 'continuous'; fid = fopen(strfile,'wt'); fprintf( fid, '%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s\n...
function mm=meannonan2(x) notin=isnan(x) | isinf(x); [row,column]=find(notin); index=[1:length(column)]; for ii=index colvals=x(:,column(ii)); colvals(row(ii))=[]; meancol=mean(colvals); x(row(ii),column(ii))=meancol; end mm=mean(x);
clear classes clear all close all camara = gigecam(1); set(camara, 'LightSource', 'ExposureActive'); set(camara, 'LightBrightness', 100); set(camara, 'ExposureTime', 100); %% close all corrida = 0; %% corrida = corrida + 1; N = 1000; picos = []; for i = 1:N foto = snapshot(cam...
function bins = binarray(myarray,numbins) bins = linspace(min(myarray),max(myarray),numbins+1); return end
function sig = genStSignal(m,n,nu) % generate student's t signal with freedom nu sig = zeros(n,1); ids = randperm(n,m); val = trnd(nu,m,1); sig(ids) = val ;
% University of British Columbia, Vancouver, 2017 % Alex Kyriazis % William Choi % Main entry point into the cell segmentation process. The result of this % is a setting of the internal properties of dpimage to reflect the new % information gathered about the cells. % The critical parameters that must be modified...
function [mask,accuracy] = getmask(weight,x,y,net) momentum = 8; idim = size(x,2); average = mean(x)'; % s_weight = [weight rank] [s_weight] = sortrows([weight [1:1:idim]'], 1); accuracy = zeros(idim+1,1); % mask = ones(idim,1); accuracy(1) = mmse(sim(net,x')',y); m_x = x; for i = 1:idim % Set ...
function [header,headersize] = ReadAIHeaderAncient(fid) % [header,headersize] = ReadAIHeaderAncient(fid) % Read the acquisition header, from back before the type % and version identifiers. % The Labview that writes these headers is 'create AI binary header0.vi' headersize = fread(fid,1,'uint32'); header.chstr = readLVs...
%% SEIR Model ODE Equations function Xdot = Yaws_ODE_File(t,X) %use your file name % global rho ... betaONE ... betaTWO ... mu ... alpha ... gamma ... proportion ... epsilon ... eta ... theta ... lambda ... %% assign compartment names ...
function [ mato ] = thrdmatmult(mat1,mat2) %UNTITLED2 Summary of this function goes here % Detailed explanation goes here sz1 = size(mat1); sz1 = sz1(3); sz2 = size(mat2); sz2 = sz2(3); if(sz1 == sz2) for i = 1:sz1 mato(:,:,i) = mat1(:,:,i).*mat2(:,:,i); end end end
%% copy all figures to another directory copyfile('figs/*.eps','C:/Users/NhatTan/Dropbox/Papers/GreenMetrics16/DCDR_adv/figs') %%
classdef MeshEdge properties nodeA nodeB facetA facetB length end methods function obj = MeshEdge(nodes, facets) if (nargin > 0) obj.nodeA = nodes(1, 1); obj.nodeB = nodes(2, 1); obj.length = ((...
function phys = Convection1d_Solver(phys) [rk4a, rk4b, rk4c] = getRK_coefficient; % set time interval xm = abs(phys.mesh.x(2) - phys.mesh.x(1)); CFL = 0.3; dt = CFL*min(xm./phys.u(1), xm.^2/sqrt(phys.Dx)); time = 0; outStep = 0; resT = zeros(size(phys.var)); FinalTime = phys.ftime; var = phys.var; Np ...
function folderName = get_folder_to_use(folderResult) %GET_TASK_PERFORM Summary of this function goes here % Detailed explanation goes here [~,folderName,indx] = uigetfolder; end
function [ frictionSolver ] = initFrictionSolver( obj ) %INITFRICTIONSOLVER Summary of this function goes here % Detailed explanation goes here if obj.option.isKey('FrictionType') % the option exist switch obj.getOption('FrictionType') case enumSWEFriction.None frictionSolver = NonFrictionTer...
load("datasetA.txt"); load("datasetB.txt"); % mixmodel(datasetA, 3, 1000) mixmodel(datasetB, 3, 0)
function [phan, map] = loadMaterialsPhantom( p ) % Load materials and density defined Phantom % % Meng Wu at Stanford University % 2014 - 2015 fprintf(['Loading material phantom "' p.Phantom.materialsFileName '" with material mapping "' p.Phantom.materialMappingName '"... ']); %% read phantom matreial data file [pha...
function makeCurrentFigures(currentVals,indices,networknames,legendnames,network,path) %% figure pos = [0.1 0.55 0.38 0.4]; subplot('Position',pos) ww = indices(1); plot(currentVals(ww).t_lags,mean(currentVals(ww).C(:,1:2000),2),'Color',[0.7 0.7 1],'linewidth',2) hold on ww = indices(2); plot(currentVals(ww).t_lags,...
function op_plottrace_behavior(xls_path,posdiff,path) data = xlsread(xls_path); pos(:, 1) = data(:, 2); pos(:, 2) = data(:, 3); posdiff = logical(data(:, posdiff)); NumPos = size(pos,1); figure;hold on for i_pos = 2 : NumPos - 1 posbef = pos(i_pos,:); posaft = pos(i_pos + 1,:); if (posdiff(i_pos + 1) || po...
function plot_dispersion_relation(H1, H2, m2, m3, s1, s2, Q, fk) %PLOT_DISPERSION_RELATION Plots the dispersion relation % Plots the dispersion relation for given parameters and a final f % value. if nargin < 8 fk = 1; end nf = 101; omega = zeros(2,nf); k = lin...
% jiangjian@eegion.com % 2021-03-24 % HR plot t=0-eeg3; [b,a]=butter(2,1/(500/2),'high'); t2=filter(b,a,t); [pks,ind]=findpeaks(t2,'MinPeakProminence',0.05,'MinPeakDistance',200); del_i=[]; for ii=1:length(pks) if pks(ii)<0 || pks(ii)>0.3 del_i(end+1)=ii; end end pks(del_i)=[]; ind(del...
%Sarahi Ruvalcaba vt=input('Introduce tu ventana de tiempo: '); vi=input('Introduce el monto inicial a invertir: '); P=xlsread('google','precios','e2:e1250'); d=length(P); MA=zeros(d,1); GP=zeros(d,1); A=vi/P(1); C=vi; cont=2; for j=vt:d aux=0; for i=j-vt+1:j %Uso de la ventana, contador "hacia atras" ...
t=-10:0.01:0; x=exp(2*t); w=-10:0.01:10; for j=1:length(w) Xjw(j)=(sum(x.*exp(-i*w(j)*t)))*0.01; end %plot x(t) subplot(311); plot(t,x); title('x(t)=e^(at)u(-t), a>0'); %plot magnitude spectrum subplot(312); plot(w,abs(Xjw)); title('Magnitude spectrum'); xlabel('frequency w'); ylabel('|X(jw)|'); %...
function defaultarg(varargin) [hasval, flagind] = ismember('-value', varargin); if hasval default_val = evalin('caller', varargin{flagind+1}); varargin = varargin(setdiff(1:end, flagind+[0,1])); else default_val = []; end for i=1:numel(varargin) if ~evalin('caller', ['exist(''' varargin{i} ''', ''var...