text
stringlengths
8
6.12M
function plot_band(lower, upper, lower_line, upper_line, plot_title, plot_xlabel, plot_ylabel, plot_legend, varargin) % Plot lines and confidence band for dynamic variance decompositions maxmin = @(x) max(min(x,1),0); % Plot lines/bands hold on; if ~isempty(lower) the_band = plot(1:length(lower), maxmin(lower), ...
function lsequal2(displaymode,listname,nl,M,Wn) % LSEQUAL2 Compute random phase signals with loadspeaker equalization % for the loudspeakers for HRTF measurement. % LSEQUAL(displaymode,listname,nl,M,Wn) % diplaymode=1 shows the inverse filters, % listname = name of a file with name...
function SmoothArray = smooth(Array,m) %13-month running mean n = length(Array); k=floor(m/2); SmoothArray(n) = zeros(); SmoothArray(1:k) = mean(Array(1:k)); for i = k+1 : n-k SmoothArray(i) = sum(Array(i-k:i+k))/m; end SmoothArray(n-k:n)=mean(Array(end-k:end));
classdef PF_Fa_DwS < PF_Fa %PF_Fa_DwS Summary of this class goes here % Detailed explanation goes here methods function obj = PF_Fa_DwS(f) obj = obj@PF_Fa(f); end end end
logger = kifu.Logger('project', 'thtfrhgfest2'); data = rand(10, 10, 1, 100); responses = categorical(round(rand(100,1))); layers = [ imageInputLayer([10, 10, 1]) fullyConnectedLayer(2) softmaxLayer classificationLayer]; options = trainingOptions('sgdm', 'OutputFcn', @logger.log); trainNetwork(data,...
% created: Tilke Judd, Feb 2011 % updated: Zoya Bylinskii, Aug 2014 % This finds the similarity between two different saliency maps when % viewed as distributions (equivalent to histogram intersection). % score=1 means the maps are identical % score=0 means the maps are completely opposite function score = similarity...
Nimgs = 15; lr = zeros( Nimgs ); rf = zeros( Nimgs ); rf1 = zeros( Nimgs ); for u_img = 1 : Nimgs u_img for gt_img = 2 : Nimgs for fld = 1 : 5 %img = 50; %fld = 10; %ngts = 20; img = u_img + gt_img; ngts = gt_img; % img = 40; % ...
function [num_S_0,num_P_0,num_O_0,Is_FirstOrder, Is_SecondOrder, Is_ThirdOrder,T_unique_embeddings,ic, ia] = GetOrderInfo_sherlock_v2(TestData) tupleId2IndMap = containers.Map(TestData.unique_tuple_ids, [1: numel(TestData.unique_tuple_ids)] ); T_embedding = TestData.unique_tuple_features(get_val_array...
function passed = test_vid2adj_edges % test geometry % contains non-manifold vertex % test boundary vertex, non-manifold interior vertex and manifold interior % vertex nv=10; edges=int32([ 3,5; % 1 1,2; % 2 2,3; % 3 1,10; % 4 10,6; % 5 1,6; % 6 ...
function stat = within_subj_tf_cluster(GA_tf_CONV,GA_tf_NOCH,neighbours,freq,subj,latency) %% cfg = []; cfg.channel = {'EEG'}; cfg.latency = latency; % 'all'; cfg.frequency = freq; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_depsamplesT'; cfg.correctm ...
%Author: REDJAN F. SHABANI %Universita' degli studi di Roma "LA SAPIENZA" %Ingegneria Informatica - Intelligenza Artificiale %Version: Dec. 2009 %Class definition for Perceptron objects classdef perceptron properties bias;%unit bias weights;%input weights end methods %method costru...
function data=read_namelist(filename,namelist) %data=READ_NAMELIST(filename,namelist) Returns values from FORTRAN namelist % This function reads a FORTRAN input namelist and returns the values as % the fields of a structure. Multidimensional arrays have their indicies % scaled and shifted to fit the matlab numbe...
function generateCompetitionPlot_new(folder,sxBySy,sxBySyTex) if nargin < 3 sxBySyTex = 150 * 150; end gain_thres = 0.1; nChannel = 0; load(sprintf('rawmodel_basis_%s_size%d.mat',folder,sxBySy),'template'); nChannel = nChannel + 1; template_all{nChannel} = template; ax = 10; load(sprintf('rawmodel_tex_%s_size%d...
% teleTrain2 % Constants global ts; center = 0; gain = -1; startTime = 10; interval = 30; lockDuration = 1; preTest = 16; visStimN = [1, 0, gain, center]; odor1Laser = '0000'; odor2Laser = '0000'; odorOn = 'ff00'; laserOff = '0000'; odorOff = '0000'; trialStructureList(1,:) = {0, visStimN, laserOff,odorOff...
% Left Stance Domain % % Contact: Left Toe function domain = LeftStance(model, load_path) % construct the right stance domain of Cassie % % Parameters: % model: the right body model of Cassie robot %% first make a copy of the robot model %| @note Do not directly assign with th...
function [icoord, jcoord, kcoord, head_box, quality] = ini_head_n_hands( IM, IM2, use_kinect, debug, slow_version ) %[icoord, jcoord, kcoord, head_box, quality] = ini_head_n_hands( IM, IM2, use_kinect, debug, slow_version ) % Find coordinates of head and hands (kcoord is either the depth or red) % and the head bounding...
% Sport_Utility_in.m ADVISOR 3.1 rev b input file created: 12-Jan-2001 16:01:33 global vinf vinf.name='Sport_Utility_in'; vinf.drivetrain.name='conventional'; vinf.fuel_converter.name='FC_SI102_emis'; vinf.fuel_converter.ver='ic'; vinf.fuel_converter.type='si'; vinf.transmission.name='TX_5SPD'; vinf.transmission.v...
%function DCA_embedding(NetList) addpath('../Data/'); clear; maxiter = 20; restartProb = 0.5; nnode = 3; NetList = {'Network.txt'}; dim = 50; for i = 1 : length(NetList) tic fprintf('Processing network %d ...\n', i); netID = char(NetList(i)); ppi_net = loadNetwork(netID, nnode); p...
%Lectura Sperm 0 y 1 lee_archivos1 = dir('C:\Users\Ruth\Desktop\train\label\*.jpg'); for i = 1:length(lee_archivos1) %Obtiene el nombre de los archivos de la carpeta archivo1 = lee_archivos1(i).name; A = erase(archivo1,".jpg"); Im= imread(strcat('C:\Users\Ruth\Desktop\train\label\',archivo1)); ...
datafolder = fullfile('E:\SURYA-PRO\speech command\speech_commands_v0.01'); ads = audioDatastore(datafolder,'IncludeSubfolders',true,'FileExtensions','.wav','LabelSource','foldernames') ads0 = copy(ads); commands = categorical(["yes","no","up","down","left","right","on","off","stop","go"]); isCommand = ismember(ads.L...
function [file_name,folder_name] = get_names(file_path,rep) %This function returns the filename of a given file from the full file_path %, removing all the folder names before the actual file. It also replaces underscores '_' with empty spaces ' %'. Additionally, it also provides the folder name that the files is in. %...
function [y] = m1_hiQ_eq(q,a,b,c2,th1) y = (a-log(q))/b - c2 + th1 - 2*q - 1/b; end
function x = trans2_3(theta, point) mat2_3 = [cosd(theta) -sind(theta) 0 3; sind(theta) cosd(theta) 0 0; 0 0 1 0; 0 0 0 1]; x = mat2_3*point; end
% UQ_LISTINPUTS return all the INPUT objects available in the UQLab session. % UQ_LISTINPUTS returns a list a INPUT objects that have been created by % the <a href="matlab:help uq_createInput">uq_createInput</a> command. % % The INPUT that is currently selected (used by default in several UQLab % command...
function []=CompileConcentrationCurve_v1(dataName,numFrames) %Use file" {Name}_AnalysisData_NoHeaders.txt data=load([dataName '_NoHeaders.txt']); %% Figure out which spots came from which well dataindex=data(:,1)~=0; data_clean=data(dataindex,:); NumSamples=length(data_clean); %Identify wells on 384 plate wrt 96 plat...
function [W_fuel] = performance(W_fuel_c, W_wing_c, L_c, D_c) R = 12569.5e3; % m CT = 1.8639e-4; % N/Ns V = 243; % m/s base_weight = 154.44e3; WTO_max = W_fuel_c + W_wing_c + base_weight; W_fuel = WTO_max * (1-( 1 / (0.938*( exp((CT*R*D_c)/(V*L_c)))))); end
clear; close all; clc; dirpath = uigetdir('.','Please pick MEM data directory'); subjects = dir(strcat(dirpath,'/S*')); for ear = 1:2 if ear == 1 eartag = '_L'; earname = 'left'; else eartag = '_R'; earname = 'right'; end for k = 1:numel(subjects) s = subjects(...
function funct = registerfunction(controller,functionname,channelname) % REGISTERFUNCTION Associates a callback function with a specific channel % name. % FUNCT = REGISTERFUNCTION(CONTROLLER,FUNCTIONNAME,CHANNELNAME) returns % the Java Function object that is created within this function. % CONTROLLER is th...
% ADVISOR data file: ESS_UC2_Maxwell_temp.m % % Data source: % Testing at NREL's Battery Thermal Management Testing facility. % % Data confirmation: % % Notes: % These parameters describe the Maxwell PC2500 Ultracapacitor. % % Created on: 11/01/01 % By: Tony Markel and Matt Zolot, NREL % % Revision history at end of...
function JobSyubmitResults(fileID,folder,MatPunique) % submit the job fprintf(fileID,' mdb.jobs["%s"].submit(consistencyChecking=OFF) \n',MatPunique); % wait for the job to be complete fprintf(fileID,' mdb.jobs["%s"].waitForCompletion(); \n',MatPunique); % read output database to retrieve the J-i...
function selectAnnos(imgset) if nargin < 1 %error(['usage: selectAnnos(imgset)']); imgset = 'test_coco_2000_clean'; end addpath([cd '/VOCcode']) VOCinit; file = sprintf(VOCopts.imgsetpath, [imgset]); fprintf('file list %s\n', file); [ids] = textread(file, '%s'); selected = {'sofa', 'diningtable', 'refrigerator', 'w...
function D2u = grad(Du,type) %% Input %% Output %% Coder:Rubing Han %% Lastest Version:2021/1/15 if type == 0 D2u(:,:,1) = Delta(Du,1,0); D2u(:,:,2) = Delta(Du,2,0); else % type == 1 D2u(:,:,1) = Delta(Du(:,:,1),1,0); D2u(:,:,2) = Delta(Du(:,:,2),2,0); D2u(:,:,3) = (Delta(Du(:...
function [X] = norm_l2(X,y, opt) % norm_l2(OPT) % Spheriphies the data according to the l2 norm. % % INPUTS: % -OPT: must contain the field X % % OUTPUT: % -X: normalized input data matrix for j = 1:size(X,1) X(j,:) = X(j,:)/(norm(X(j,:)) + eps); end if opt.verbose fprintf('\tL2 Normalized\n'); end
Exp = {'Participant'}; load('ExpInfo'); [j,k] = size(ExpConditions); for c = 1:j Exp = horzcat(Exp,ExpConditions(c,1)); %#ok<*AGROW> end Exp = horzcat(Exp,'Trial Number'); Heading = {}; HeadingsExport = horzcat(HeadingsExport,'Pelvis Sway (ML) - Mean'); HeadingsExport = horzcat(HeadingsExport,'Pelvis Swa...
clear all close all root=fullfile(mdf,'stn_rotameter\STN_Rotameter\'); cd(root); addpath(fullfile(mdf,'matlab_scripts\wjn_toolbox')); addpath(fullfile(mdf,'stn_rotameter\rotameter_scripts')); pat=patienten; gfiles=ffind('newoneth_gamma_brown_burst_r*.mat'); for c=1:length(gfiles); d=load(gfiles{c}); ...
%Part1 a %********************************************************************** load ORLfacedata; X = data([1:10, 301:310],:); Y = labels([1:10, 301:310]); %create a cell to store datase C = []; %create 50 partitions and store in the cell for index = 1:50 %create a partitions [Xtr, Xte, Ytr, Yte] = PartitionData(X,...
% PRP: add field for derivative from prior classdef ErrorPackage < DataPackage methods function merge(obj, package) if all(obj.datasize == package.datasize) obj.data = obj.data + package.data; else error('ILLEAGAL OPERATION'); end e...
T_old.nodes=[1,-1,2;sqrt(3),0,-3]; T_old.n=[1;2;3]; T_old.e=[1;2;3]; T_old.t=[1]; T_old.En=[1,2,3;2,3,1]; T_old.types=[1]; T_old.info=[]; T_old.num_nodes=3; T_old.num_tri=1; T_old.num_edges=3; T_old.refined=zeros(7,T_old.num_edges); [T_new]=refine(T_old,1,2);
close all; clear all; %Parameters for finding corners (HarrisTop) DoWarp = 1; SIGMA = 1.5; K =0.04; LOCAL_RADIUS= 20; THRESHOLD = 50; %CORNER_NUM = 400; MARGIN = 25; %Parameters for matching (knnMatch) MATCH_NUM = 50; % Get input images from input directory, and store them in dataset{} InputDir = 'C:\Users\panda\Des...
classdef testADLStoreEndUserAuth < matlab.unittest.TestCase % TESTDLSTOREENDUSERAUTH This is a test stub for a unit testing % The assertions that you can use in your test cases: % % assertTrue % assertFalse % assertEqual % assertFilesEqual % assertElementsAlmostEqual %...
function [mu, w, D] = ComputePCABasis(X) %COMPUTEPCABASIS Compute the eigenfaces % compute the mean of all the faces mu = mean(X, 2); % subtract the mean from each face X = X - repmat(mu, 1, size(X,2)); % if the vector length is very large, use an alternate way of computing % eigenvector...
% GSE_Analysis.m by Amanda Smelser, created 6/28/12 % For GSE analysis of particles tracked by Video Spot Tracker (VST). % VST output (*.vrpn file) must be converted to *.vrpn.mat file using % vrpnLogToMat, provided by UNC, prior to running this program. % This wrapper program calls the following function...
function [ t_old,t_new,diff] = line_by_liney( t_old,t_new,z1,z2,z3,m,n,value,mat,diff ) %this function implements the line by line gauss siedel method along the %y-direction mat1=zeros(n,n); value1=zeros(1,n); for j=z1:z2:z3 if j==1 for i=1:m if i==1 value1(i)= (mat(i,2)*t_old(2,...
function [PSI_all,psi,psi2,granger,granger2,g1,g1_f,G,g_f,FB,FB1]=getval_psi(P,Q,labelconditions3,label1,s,w,fn) n=min([length(P.(labelconditions3{1}).(label1{w}){s}) length(P.(labelconditions3{2}).(label1{w}){s})... length(P.(labelconditions3{3}).(label1{w}){s}) length(P.(labelconditions3{4}).(label1{w})...
function [ matout ] = flatmat( matin ) %UNTITLED8 Summary of this function goes here % Detailed explanation goes here matout = reshape(matin,1,size(matin,1)*size(matin,2)); end
% brainmovie3d() - generate a sequence of images showing event-related coherence, % event-related spectral perturbations, and inter-trial coherence % of localized EEG waveforms. Uses outputs of timef() and cross(). % Usage: % >> brainmovie3d(ersps,itcs,crossfs_amp,crossfs_phase,TIMES,freqs...
function[V6,tiempo]=save_samples(x,transitions) %Loads the .continuous file h=messbox('Loading .continuous file','Current Progress') [data6m, ~, ~] = load_open_ephys_data_faster(x); close(h); fs=20000; %Original sampling frequency. [C6,tiempo]=reduce_data(data6m,transitions,fs,3); clear data6m A=cellfun('length',C6); ...
%% function [a_tr, a_te, tr_error, te_error]=temporal_ridge_fc_tr_te(corrs,k_values,tr_all,te_all,lambda,duration) % pos: voxel_number by 3 matrix % k_values: the number of neighbor voxels ( p_values in the algorithm ) % tr_all, te_all: train and test data (N by voxel_number matrix, N:sample size %% p=k_...
function [substr, isEnsemble , ensStr]= splitClassifierNames(name) allMdls = string(classreg.learning.classificationModels); name = convertCharsToStrings(name); match = rmEmptyStr(regexpi(name,allMdls, 'match')); loc =arrayfun(@(x) strfind(lower(name),x), lower(match)); substr= toCol(match(pick(@sort,2, loc)))...
% Change raw data files to be compliant with current analysis. % Changes are renaming columns or fixing bugs in the code that are well % established. % No data changes in this code. % % V1.0 October 30, 2017 function preprocessing_overwrite_eyelink_settings_v10(settings) % Show file you are running p1 = mfilename; f...
function boolean= analyzeBW(targetBW) %ANALYZEBW 此处显示有关此函数的摘要 % 此处显示详细说明 height=size(targetBW,1); width=size(targetBW,2); area=height*width; L=logical(targetBW); ct=regionprops(L,'centroid');% ct means centroid. ctCell=struct2cell(ct); bb=regionprops(L,'BoundingBox');% bb means BoundingBox bbCell=struct2cel...
function [y,s] = Simul_MSAR(theta,P,T) %Fonction permettant de simuler un processus MS-AR à probabilités de %transition variables, à l'aide d'une chaine de markov à probabilités %de transition variables. %la simulation a propremement parler et ensuite la même que pour un %processus de markov simulé ...
function [ug,t] = AccTHfromPSD(G,dt,Ts,dOmega) % % Acceleration time history from a one sided Power Spectral Density (PSD) % % ug = AccTHfromPSD(G,dt,Ts,dOmega) % % Description % This function calculates an acceleration time history that % corresponds to the given one sided Power Spectral Density (PSD)....
function product = myprod(inputArray) rows = size(inputArray, 1); cols = size(inputArray, 2); product = 0; for i = 0: rows for j = 0: cols product = product * inputArray(rows, cols); end end end
function cord_new=Rz(cord,theta,cord0) x0=cord0(1); y0 = cord0(2); z0 = cord0(3); s= sind(theta); c = cosd(theta); T = [c -s 0; s c 0; 0 0 1]; vector_old =[cord(1)-x0, cord(2)-y0, cord(3)- z0]; vector_rotated = T*vector_old'; cord_new = vector_rotated' + [x0 y0 z0];
clear all %read in datafile from POEM2 COBALTS %PISC_data = csvread('/volumes/bigDisk/POEM2/CODE/Data_hindcast/CSV2/Data3_PISC.csv'); %plot(PISC_data(:, 10)) %read in datafile from POEM2 TP subplot(2, 2, 1) PISC_data = csvread('/volumes/bigDisk/POEM2/CODE/Data_hindcast/CSV2/DataTP_PISC.csv'); plot(PISC_data(:, 1:10)) ...
function saveOPC_toFile( var , type) current_date = datetime(); filename = datestr(current_date,'yyyyMMdd_HHmmSS_'); filename = strcat(filename,type,'.txt'); % fprintf('filename=%s\n',filename); fileID = fopen(filename,'w'); fprintf(fileID, '%7.4f %9.4f %10.4f\n',var'); fclose(fileID); end
function [] = showMovieForSpeed(dataMtr) % cmap = jet(256); limits = []; limits(1) = double(min(dataMtr(:))); limits(2) = double(max(dataMtr(:))); handle = implay(dataMtr); cmap = jet(256); handle.Visual.ColorMap.Map = cmap; handle.Visual.ColorMap.UserRangeMin = limits(1); handle.Vis...
function octInt = toOctal(action) % TOOCTAL returns the octal representation of an AclAction % % Example: % % return the octal value of myAclAction % myOctalInt = azure.datalake.store.acl.AclAction.toOctal(myAclAction) % Copyright 2018 The MathWorks, Inc. % validate input p = inputParser; p.CaseSensitive...
function [r888, KLAYERS, SARTA] = cris888_sarta_wrapper_bc(rtpin, nguard); % function [r888, KLAYERS, SARTA ] = cris888_sarta_wrapper_bc(rtpin, nguard); % % Wrapper for running SARTA for CrIS 8/8/8 mm OPD. Uses the % IASI RTA to calculate Guassian apodized IASI radiances. % The IASI radiance is then unapodized and tru...
function cover=GetObstacleCover() global accuracy; global xmax; global ymax; global robot_size; cover=[]; for i=floor(0*10/accuracy)-floor(robot_size/2/accuracy)+1:1:ceil(10*10/accuracy)+floor(robot_size/2/accuracy)+1 for j=floor(38.5*10/accuracy)-floor(robot_size/2/accuracy)+1:1:ceil(41*10/accuracy)+floor(robot_si...
function fFitness=calculateFitness(fObjV) fFitness=zeros(size(fObjV)); ind=find(fObjV>=0); fFitness(ind)=1./(fObjV(ind)*0.5+1); % 设为0.5效果是最好的,对于布谷鸟来说 % fFitness(ind) = exp(-fObjV(ind)*0.05); ind=find(fObjV<0); % 怎么会有小于0的呢?! fFitness(ind)=1+abs(fObjV(ind));
%% FFT Currents, i_actual% Frequency Analysis close all % For example, consider the following data x with two component frequencies % of differing amplitude and phase buried in noise: fs = 250; % Sample frequency (Hz) % sample_start = 900; % sample_end = 2700; sample_start = 100; sample_end...
% postprocessing on when the best design is found probs = sparse(zeros(2455,1)); load ggbs_test6_s10000_inq10_forprofit.mat; probs = probs + prob(:,31); load ggbs_test1_s10000_inq10_forprofit.mat; probs = probs + prob(:,31); load ggbs_test11_s10000_inq10_forprofit.mat; probs = probs + prob(:,31); load ggbs_test...
% WPDTOOL  ウェーブレットパケット表示ツール % VARARGOUT = WPDTOOL(OPTION,VARARGIN) % Copyright 1995-2004 The MathWorks, Inc.
%% for i = 1:(floor(length(rms(:,2))/5)) binsRMS(i) = mean(rms((5*i-4):(5*i),2)); end %% %using data from hammer1, binsRMS(:,2), gyro trainIndex = [243,252;252,261;261,270;269,278;278,287;... 286,295;295,304;304,313;313,322;322,331;331,340]; %% hammerExamples = zeros(11,10); for i = 1:length(trainIndex) ...
% XXXXXXXXXXXXXXXXXXXXXXXXXXXX htet_generate_cross_validation_data XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX % % Author : Htet % Date : Sep 11, 2019 % Function : generate 5-fold cross validation data that consist of failed banks and survived banks % Syntax : htet_generate_cross_valid...
%Backpropagation start out(it,:,:) = outputs(1).value(:,:); diffsum = outputs(1).value - expected; deroutput = sigmoid_prime(outputs(1).value,1,0); deltaoutput = diffsum .* deroutput; avgdiff(it) = mean(abs(diffsum)); for y = 1:numoutputs for x = 1:hiddensdef(1) tmp = ( deltaoutput / hiddens(end,x).value ...
classdef TabularCpd < CondProbDist %TABULARCPD properties dof; ndimensions; params; prior; end methods function model = TabularCpd(varargin) % end function computeMapOutput(model,varargin) % notYetImplemented('TabularCpd.computeMapOutput()'); end function fit(model,varargin) % ...
close all; [file, path] = uigetfile('/Users/preston/MATLAB-Drive/Cropped_image_stacks/*.mat', 'MultiSelect', 'on'); if isa(file, 'char') file = {file}; end fig = figure(1); for i = 1:length(file) load(fullfile(path, file{i})); fprintf('h = %d, w = %d\n', h, w); arr = zeros(size(mydata_bw, 3), 1); % im...
classdef PPOptProblem3D < OptProblem properties facetMap end methods function obj = PPOptProblem3D() end function createProblem(self, splitedMembers, nozzleMaxAngle, maxTurnAngle, solverOptions, knowAngleValue) xZoneNumber = size(sp...
function out=runlength(BinaryVector,num) % Make sure BinaryVector is a column vector if size(BinaryVector,2) > 1 BinaryVector = transpose(BinaryVector); end if num == 0 % Augment binary vector BinaryVector = [1;BinaryVector;1]; out = find(diff(BinaryVector)==1)-find(diff(BinaryVector)==-1); ...
function OUT = lwtcoef2(type,xDEC,LS,level,levEXT) %LWTCOEF2 Extract or reconstruct 2-D LWT wavelet coefficients. % Y = LWTCOEF2(TYPE,XDEC,LS,LEVEL,LEVEXT) returns the coefficients % or the reconstructed coefficients of level LEVEXT, extracted from % XDEC, the LWT decomposition at level LEVEL obtained with the %...
% function Test_group_lasso % min 0.5 * ||A * x - b||_2^2 + mu * ||x||_{1,2} % generate data seed = 97006855; ss = RandStream('mt19937ar','Seed',seed); RandStream.setGlobalStream(ss); n = 512; m = 256; A = randn(m,n); k = round(n*0.1); l = 2; A = randn(m,n); p = randperm(n); p = p(1:k); u = zeros(n,l); u(p,:) = rand...
% chklimits.m % A script to quickly find indices at which drivetrain limits were reached. For % this script to work, a simulation must have been run which generates boolean % flags, *_limited, with TRUE indicating that the particular limit was reached. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
function RenameImagePilotDicom % RenameImagePilotDicom reads the patientID from the Dicom-file to rename % the Dicom-file with patientID as filename. This function will search % for all Dicom files in the selected folders and subfolders. % April 2017 ImagePilot doesn't add file extension to dicom files, what % ...
%Process the sliding along bar with one hand while other holds bar addpath('../'); addpath(genpath('C:\asl_git\kalmanfilter\ik_framework\common\ars')); %Load post alignment data load('C:\aslab\data\bench2\featureSet_mocap_post_const1_Subject02_lyingdown_sliding_12.mat') trc = dataInstance_trc_post; m_names = fieldnam...
mdl='PlantNL'; % Obtain default operating point op = operspec(mdl); % Set the value of output concentration C to be known op.Outputs.Known = true; % Specify operating regions C = [2 3 4 5 6 7 8 9]; % Initialize an array of state space systems Plants = rss(1,1,1,8); for ct = 1:length(C) % Compute equilibrium operat...
function [Wx, Wy] = trainMMSSH(X, Y, dMMSSH) % % Input % X = features matrix [Nfeatures, Nsamples] % Y = features matrix [Nfeatures, Nsamples] % SHparam.nbits = number of bits (nbits do not need to be a multiple of 8) % [Ndimx Nsamples] = size(X); [Ndimy] = size(Y,1); % algorithm % option = struct('disp',0); Wx...
%calvo_ss.m %Steady state of the Two-sector open economy model with Staggered price %setting in the nontraded sector developed in the chapter entitled ``Nominal Rigidity, Exchange Rates, And Unemployment,'' of %the book ``Open Economy Macroeconomics,'' %by Martin Uribe and Stephanie Schmitt- %Grohe, Prince...
function [output] = calUtilde(what_vec, mu_vec, sigma_mat, gamma_c) output=(mu_vec')*what_vec-(gamma_c/2)*((what_vec')*(sigma_mat*what_vec)); end
ziad = 1;
function result = is_cyl_coordinate_data(r, phi, z) if is_double(r) && length(r) == 1 && isreal(r) &&... is_double(phi) && length(phi) == 1 && isreal(phi) &&... is_double(z) && length(z) == 1 && isreal(z) result = 1; else result = 0; end
% % irpFilterDistanceMap uses various filters (median, average) to smooth the % distance map. % % Usage: % FilteredMap = irpFilterDistanceMap(DistanceMap); function FilteredMap = irpFilterDistanceMap(DistanceMap) DistanceMap = irpInterpolateRows(DistanceMap); DistanceMap = medfilt2(DistanceMap,[3,3]); % set all z...
function visualize_network_webweb(A, varargin) % visualize_network(A, varargin) % % optional inputs % case {'webwebdir'} % case {'node_names'} % case {'groups'} % case {'group_names'} % case {'values'} % case {'value_names'} webwebdir = '/Users/clinpsywoo/Dropbox/MATLAB/network_tools/webweb_v3.2'; vis_groups = fals...
%========================================================================== % Genetic algorithm function %========================================================================== function [new_chromosomes,fitness,accuracy,features_used] = genetic(chromosomes,... num_features,population,crossover_rate,mutation_rate,X...
%% load in subject clear all; clc addpath(genpath('C:\Users\gridlab\Desktop\ai phuong\HAPTIC SUBJECTS\SUBJECTS')) addpath(genpath('C:\Users\gridlab\Desktop\ai phuong\HAPTIC SUBJECTS\CODE\Extraction')) % ui box for input % have to have a value assigned to the file to have it wait to finish % loading...mathwork...
function results = Itegration(position,velocity,position_DR,velocity_DR,gyro_heading_deg) %parameters deg_to_rad = 0.01745329252; % Degrees to radians conversion factor rad_to_deg = 1/deg_to_rad; % Radians to degrees conversion factor latitude_deg = position(:,1); longitude_deg = position(:,2); height = positio...
function val = subsref(p, s) %% extract panel % extract panels array userData = get(p.fig, 'UserData'); if ~isfield(userData, 'panel') error(['panel reference no longer valid - "' int2str(p.id) '" not found in figure "' num2str(p.fig) '" (was associated figure closed/reopened?)']) end panels = userData...
classdef FilterClass < handle properties (SetAccess='protected', GetAccess='public') maxNPoles = 20; % filter parameters samplingRate = nan; cornerFrequency = nan; nPoles = nan; pbRipple = nan; LoHi = 0; % low-pass (0), high-pass (1), band-pass (2...
clear all addpath(genpath('./')) FontSize=10; %set the situation of the classification problem in the demo. numClass=5; numSampleForEachClass=5; centerForEachClass=[-2 -1 0 1 4]; numFeatureDims=100; %make data for validation feature=[]; label=[]; for index_class=1:numClass temporal_feature=zeros(numSampleForEachC...
function [xlist,ylist]=adaptive(func,opt) if ~isa(func,'function_handle') error('%s is not a function handle',func2str(func)); end if ~isa(opt,'struct') error('option is not a struct'); end if isfield(opt,{'min','max'}) if opt.min>=opt.max error('min of plot range %f is larger than max %f',opt.min,o...
function de = quickde(ts,dim,lag,nmin) % de = quickde(ts,dim,lag,nmin) % does a quick-and-dirty characterization of determinism using de % ts -- the time series % dim -- the embedding dimension % lag -- the embedding lag % nmin -- optional: number of points to use for delta-eps fitting % default value: 500 % ...
function [] = exitProg() % Last Update: 27/04/2016 global PROG; %% Define Ending Date and Elapsed Time PROG.elapsedTime = toc(PROG.myTic); PROG.dateEnd = datestr(clock); %% Print Exit Message fprintf('\n\nTotal Elapsed Time: %1.4f [s]\n',PROG.elapsedTime); entranceMsg('END'); %% Ready Sound % WarnWave = [sin(1...
function outvar_twyd = dist_towed_vehicle(veh_depth, wire_out) % outvar_twyd = DIST_TOWED_VEHICLE(veh_depth, wire_out) % % inputs % - veh_depth: vector with the towed vehicle depth, in % meters (i.e. derived from pressure sensor). % - wire_out: vector (same length as veh_depth) with the...
function multiObjectTracking1() options=0; obj = setupSystemObjects(); tracks = initializeTracks(); nextId = 1; while ~isDone(obj.reader) frame = readFrame(); [centroids, bboxes, mask] = detectObjects(frame); [cA1] = DiscreteWT(mask); [eigvector, eigvalue] = PCA2(cA1, options); ...
function [ W0 ] = weightLoop( parameters, tailParameters) %UNTITLED11 Summary of this function goes here % Detailed explanation goes here %%%%% Optimizer: Weight Estimation Inner Loop MTOW = parameters.W0;%%% inital MTOW guess wNew = 1.1*MTOW; %%% initialize a dummy weight variable so loop will run W0 = wNew; %%% ...
% I have not tested this to make sure it works yet, but I didn't change % anything from what Lucas had except I commented more. function regions = find_clusters(frame, threshold, dir) %INPUTS: % frame: a grayscale array of images F(row,col,t), where t is the array index % threshold: how many white pixels must ...
function y=sigmoid(x) y=1./(1+exp(-x)); end
% WDFIGUTL は、Wavelet Toolbox のデモの Figure に関連するユーティリティ % です。 % VARARGOUT = WDFIGUTL(OPTION,VARARGIN) % Copyright 1995-2003 The MathWorks, Inc.