text
stringlengths
8
6.12M
classdef SLSDesign < handle %SLSDESIGN class of a robust MPC problem equipped with robust SLS, %tube MPC and dynamic programming (DP) methods. % Task: solve a robust optimal control problem (OCP) in each MPC loop % Consider robust closed-loop OCP of the uncertain system with given % x(0) and h...
%% Clustering load clusterData.mat %% UBClustering K = 4; nModels = 20; model = clusterUBClustering(X,K,nModels); cluster = model.clusters; %% Make plot clf; hold on; colors = getColorsRGB; symbols = getSymbols; h = plot(X(cluster==0,1),X(cluster==0,2),'.'); set(h,'Color',[0 0 0]); for k = 1:K h = plot(X(clust...
function [ ModXDispNorm ] = ImportModalDisp (ModNr,sel_torque,PathName) % ImportModalDisp: imports displacements for spesific modeshape % surfaces. If possible the elmenets are also imported % INPUTS: % ModNr : Mode number % sel_torque : Select torque level ['7NM' , '20NM'] % PathName : path were ...
% This code formulates and solves a random linear programming problem % utilizing the simple interface. % ------------------------------------------------------------------------- % Copyright (C) 2018-2020 David Papp and Sercan Yildiz. % % Redistribution and use of this software are subject to the terms of the % 2-Clau...
image = imread('riceblurred.png'); stretched_Image = imadjust(image, stretchlim(image, [0.05, 0.95]),[]); subplot(2,2,1), imshow(image), title('Original Image'); subplot(2,2,2), imshow(stretched_Image), title('Strethced Image'); subplot(2,2,3), imhist(image), title('Histogram of Original Image'); subplot(2,2,4), imhi...
function quantitColocalis(image_label,start_frame,end_frame) % % Isabel Llorente Garcia: August 2011. % If you use this code please acknowledge Isabel Llorente-Garcia in your % publications. % % Quantitative measure of colocalisation. % Calculation of M1 and M2 colocalisation coefficients according to paper % Biophys. ...
%f_d = speed2doppler(v, f_c, vunit = 'kmph') % % Calculates Doppler frequency from velocity and % carrier frequency for moving transmitter. % % Arguments: % v - transmitter speed % f_c - carrier frequency in Hz % vunit - unit of v ('kmph', 'mps') % % Returns: % f_d - Doppler frequency in Hz % Copyright 2...
function y=nrmse3(Vx,Vy,Vz,u,v,w) %3D version of nrmse y=(norm(Vx(:)-u(:))^2+norm(Vy(:)-v(:))^2+norm(Vz(:)-w(:))^2)^0.5/(norm(u(:))^2+norm(v(:))^2+norm(w(:))^2+eps)^0.5; end
% Example 3.16 % clf reset figure(gcf) setfsize(500,200); echo on %NEWFF — 建立一个BP网络 %TRAIN — 对网络进行训练 %SIM — 对网络进行仿真 pause P = -1:.1:1; T = [-.9602 -.5770 -.0729 .3771 .6405 .6600 .4609 ... .1336 -.2013 -.4344 -.5000 -.3930 -.1647 .0988 ... .3072 .3960 .3449 .1816 -.0312 -.2189 -.3201]; plot(P,T,'+...
function confusiontable(ConfusionMat) %=========================================================================% % 根据confusionmat绘制table表 % %=========================================================================% % Description: % 根据类标签,统计类的数量和占比并绘图 %-------------...
% t1_move_piece.m is used for task 1 % the gamestate struct must be checked to find the type of piece present % using a switch case to choose the piece present. % after determining the piece type, call one of the valid_x functions % corresponding to the type of piece. % check the global output value, if it is a 1,...
reg_results = load(fullfile(files_path, 'postprocessed_data', 'ephys_regression_results.mat')); nUnits = length(reg_results.bad_glm); nRegs = 10; window_size = 1; %% Compute port-entry CPDs for each regressor for unit_i = 1:nUnits loaded = load(fullfile(files_path, 'postprocessed_data', 'circshift_SSEs', ['ci...
close all; clear all; %% import data %This dataset (2014) has a measurement for every 3 hour. % Temperature, RH, O3 and NOx have been measured once every hour % column 1 - 6 is the year, month, date, hour, minute, sec CS_file = load(['C:\Users\mette\Documents\MATLAB\Hyytiälä\Hyde_Condensation_sink_1996_2016.da...
function [total_reward, global_step_out, epsilon,bump,final_state,action_traj,car_traj,veh_traj,action_map ] ... = episode_run( gamma, epsilon_init, learning_rate, action_list,... q_network,... ...
clear all; % Create the mapping table first by running load FileWav16kHz trainfilelist; % see create_gmm for what to be loaded by FileWav16kHz % iTask = 0; Task = 'Native'; IdxSet = 1:5; % My Computer(0) test % iTask = 1; Task = 'Native'; IdxSet = 6:130; % My computer (1) % iTask = 2; Task = 'Native'...
function [a, cache] = conv_relu_pool_forward(X, W, b, conv_param, pool_param) % conv [a, cols] = conv_forward(X, W, b, conv_param); X_conved = a; % ReLU a = max(0, a); X_relued = a; % max-pooling % [a, max_ind] = max_pool_forward(a, pool_param); [a, max_ind] = MaxPooling(a,...
function [pbrtMaterial, pbrtTextures] = mPbrtImportMexximpMaterial(scene, material, varargin) %% Convert a mexximp material to an mPbrt MakeNamedMaterial element. % % pbrtMaterial = mPbrtImportMexximpMaterial(scene, material) cherry picks % material properties from the given mexximp material and scene and uses % these ...
close all clearvars clc h=[25 50 70 100 150 200 250 500]; m=[1.26 1.325 1.33 1.34 1.32 1.321 1.322 1.37]; %interpolacja figure; hh = 1:1:500; mm = interp1(h,m,hh); plot(h,m,'rd'); hold on; plot(hh,mm); %funkcje sklejane figure; s=spline(h,m); mm=ppval(s,hh); plot(h,m,'rd'); hold on; plot(hh,mm);...
function dist12=gp_dist(x1,x2) % Euclid dist between x1 and x2 % x1 d*N1 % x2 d*N2 x12=sum(x1.*x1,1); x22=sum(x2.*x2,1); % dist12=x12'*ones(1,size(x2,2))+ones(size(x1,2),1)*x22 - 2*x1'*x2;
function result=Rosenbrock(x) %Rosenbrock 函数 %输入x,给出相应的y值,在x=(1,1,…,1) 处有全局极小点0,为得到最大值,返回值取相反数 %编制人: %编制日期: [row,col]=size(x); if row>1 error('输入的参数错误'); end result=100*(x(1,2)-x(1,1)^2)^2+(x(1,1)-1)^2; result=-result;
function x=sylvester3(a,b,c,d) % solves a*x+b*x*c=d where d is [n x m x p] % Copyright (C) 2005-2017 Dynare Team % % This file is part of Dynare. % % Dynare is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation, eit...
function [MM] = fGMBeamStandaloneSimplified(s_G,s_span,m,U) % Performing full integration of mass matrix without shape integral functions % for a beam % % INPUTS % - s_G : [m] 3 x nSpan, location of the cross sections COG points, when the beam is undeflected % - s_span : [m] span integration variable (e.g. s_G(1,...
syms s; s=tf('s');%tf表示传递函数 %G=1/(s^2+0.3*s+1); figure(1); %subplot(321) GH=-(s-1)/(s*(s+2))%*(s*s+4*s+20));%GH为开环传递函数 rlocus(GH); %grid;
classdef FDN < handle properties % 4 separate mod delays M = 4; % # of delay blocks delay = cell(4,1); % d = [521; 607; 738; 869] fb = cell(4,1); gain = 0.5; %D = [0 1 1 0; % -1 0 0 -1; % 1 0 0 -1; % 0 1 -1 0]; ...
function [ answer , LDAEgn , egnValSort , varargout] = myLDA_Yale_EXP3( testing , trn , trnGroup , varargin ) % trn: each row is an observation, trnGroup: nominal or double % if the length of your vectors is very large, you may need to use PCA beforehand. In this case you can also use the PCA which is inside "myLDA"...
function [ret,x0,str,ts,xts]=simexa22(t,x,u,flag); %SIMEXA22 is the M-file description of the SIMULINK system named SIMEXA22. % The block-diagram can be displayed by typing: SIMEXA22. % % SYS=SIMEXA22(T,X,U,FLAG) returns depending on FLAG certain % system values given time point, T, current state vector, X...
function testStrip = KFTest(trackers, testFrames) testStrip = InitStrip(); [N, ~, ~] = size(testFrames); for i = 1:N frame = squeeze(testFrames(i, :, :)); testStrip = MeasurePositionTest(frame, testStrip); end testStrip = MeanPositionTest(testStrip); nTracker = length(trackers...
%% demo using sampled NCM to estimate proportion on Pavia University dataset. % Author: Alina Zare et al. Rewriten by Sheng Zou % Department of Electrical and Computer Engineering, University of Florida % 09/07/2017 clear; load('PaviaU.mat') data = EF_reshape(paviaU); dim = size(data,1); M = 4; % number of endmembers [...
function [r_array,raw_y] = adpcm_decoder(adpcm_y,fsample) % This m-file is based on the app note: AN643, Adaptive differential pulse % code modulation using PICmicro microcontrollers, Microchip Technology % Inc. The app note is avaialbe from www.microchip.com % Example: Y = wavread('test.wav'); % y = adpcm_...
function results = fullCellIntensity(dataSet_label,image_label,start_frame,tsamp,roi,output_label) % % Created by Isabel Llorente-Garcia, June 2012. % If you use this code please acknowledge Isabel Llorente-Garcia in your % publications. % % % This function looks at the integrated intensity of a whole bacteria cell %...
function [sys, x0, str,ts] = f18_sfcn(t, x ,u, flag,x0,opts) % % % This is a S-function representation for the plant described in % f18full.m . % This S-function is used for trimming and linearizing the aircraft. % This S-function is being called in the f18_trim.mdl file. % % Abhijit 11/12/2009 switch flag ...
close all; clear all; %% Data Received N_samps=55680; fid1=fopen('received.dat','r'); x_rec=fread(fid1, N_samps,'short'); fclose(fid1); xComplex_rec= zeros(1,N_samps/2); count = 1; for i=1:2:N_samps xComplex_rec(count) = complex(x_rec(i),x_rec(i+1)); count = count+1; end length(xComplex_rec); figure(1) su...
% This program computes the value of the Gene Ontology Term Overlap function % between genes is the same cluster (molecular function) % For specific details on the underlying methods: % % https://arxiv.org/abs/1703.02872 % % % Copyright (c) 2017 Nuno R. Nene, University of Cambridge % Email: nunonene@gmail.c...
function [] = single_cell_analyze_chromvar_deviation_Tcell2(args1) a = readtable('../../data/input/Figure5/SRR161517_naive_Th1_Th2_mRNA_rep1_2.txt','Delimiter', '\t'); tcell_gene = table2array(a(:,1)); tcell_rpkm = table2array(a(:,2:7)); import bioma.data.DataMatrix DM0 = DataMatrix(log2(tcell...
%submit Mouselab learnign simulations to Savio nr_conditions=3; nr_reps=20; for r=1:nr_reps for c=1:nr_conditions job=['simulateMouselabLearningSavio(',int2str(r),',',int2str(c),',true)']; job_name=['Mouselab_learning_simulation_c',int2str(c),'_r',int2str(r),'_withPR.m']; submitJob2Savio(jo...
function m_NormElem = f_NormInterTriang(s_archDat,m_setInterf) %Función para el cálculo exacto de las normales de las interfaces formadas por elementos triangulares. %Tiene que agregado todos los path del programa. %La lógica que se usa es que el lado que tiene como elemento vecino un material distinto al d...
load 'temp.mat'; geom = loadProjectionGeometryCT( p ); n0 = 1e6; spectrum = loadSpectraCT(p, geom, n0); tubeCurrentProfileFilename = 'tubeCurrentProfile_v4-XCAT-lung_kVp119.0_FLUX1e+06_BOWT1_ACE1.00_EID1_NOISE1_sim2.raw'; fileID = fopen(tubeCurrentProfileFilename, 'r'); tubeCurrentProfile = fread(fileID, Inf, '...
function [ R, n ] = zeroElimMedianHoleFill( I ) n = 1; R = zeroElimMedianFilter(I); hasHoles = ~all(all(R)); while hasHoles R = zeroElimMedianFilter(R); hasHoles = ~all(all(R)); n = n + 1; end end
function s = loadFull(matname) load(matname); load(strrep(matname,'.mat','.idx'),'-mat'); s = struct('data',{data},'index',{index},'symbol',{symbol}); end
a = [1 -3 4 -5;2 4 6 8 ;4 3 2 1 ; 5 3 1 -3]; b = [-11 42 -11 -38]'; a(:,length(a)+1)=b; % arttırılmış matris oluşturuldu. [rows cols]=size(a); for i=1:cols for j=i+1:rows tmp=a(i,:).*(-a(j,i)/a(i,i)); a(j,:)=tmp+(a(j,:)); end end for i=length(1:rows)-(1:rows)+1 if(i<cols-1) ...
function [ modif ] = FunctionEx3( img, canal ) modif = zeros(size(img,1),size(img,2),size(img,3),'uint8'); modif(:,:,canal) = img(:,:,canal); end
% Die Messungen werden von Git ignoriert, da die Dateien einfach zu gro? sind. % Die Messung findet man unter: https://cloud.andrewdelay.com/index.php/s/FsTtRdeLLHWsP2p % Im Ordner LR_dspace\ControlDesk_Gruppe2\Experiment_Gruppe2\Measurement Data data = load('RiccatiRegler.mat'); data = data.RiccatiRegler; LEG_FONT_S...
clear all clc format long %N=100 M=2; N=4 A=[zeros(1,N-1) 0; eye(N-1) zeros(N-1,1)]; % stem N=length(A); B=rand(N,M); x0=rand(N,1); tf=1 % WB0=zeros(N,N); % ot=0.025; % for k=1:tf/ot % WB0=WB0+expm(A*(ot*k))*B*B'*expm(A'*(ot*k))*ot; % end % C0=pinv(WB0); syms t s real p=simple(expm(A*t)); pf...
function [L, U, X] = DLU_fact(A,B) % This function perfoms Doolittle LU Factorization % B = matrix of solution vectors %Allocation of space and setup U = A; %allocate space for U X = B; %allocate space for X n=size(A,1); %number of unknowns m = size(B,2); ...
%Copyright Andreas Mihalea Gr. 104 2019 Exemplu 5 din curs clear close all m=input('Pozitia balizei:'); format long hcil=19; dco=25; rco=dco/2; Dco=46; Rco=Dco/2; hcon=14; hmax=Dco+dco; if(m<=hcil) Vtra=pi*(rco^2)*m; fprintf("Volumul apei este %d m3",Vtra); end if (m>=hmax) Vcon = pi*hcon*(...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Chaotic Evolutionary Particle Swarm Optimization % Author: Phillipe Vilaça Gomes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [Fit_and_p, sol, fitMaxVector, Best_otherInfo] = ... EPSOu(epsouParameters,caseStudyDa...
function resetPursuerEvader(varargin) %resetPursuerEvader(varargin) % %This function erases all state. % global PURSUER_EVADER global NETWORK_MOTE_IDS global MAX_NETWORK_DIMENSION %initialize the locations where we store measurements if ~isfield(PURSUER_EVADER,'pursuerMeasurements') PURSUER_EVADER.pursuerMeasurem...
function plottruss(xyz,topo,eforce,fbc,rads,pltflags) %function plottruss(xyz,topo,eforce,fbc,rads,pltflags) %---------------------------------------------------- % % plot 3-truss, bars colored accoring to force % supported nodes are plotted in red % non-supported nodes are plotted in black % % Input: xyz...
clear all clc syms x disp('DIFERENCIAS DIVIDIDAS') valor=input('Valor a interpolar x: '); datos=input('Datos Ordenados[X0 X1 X2 ... Xn]: '); longitud=length(datos); % fun=input('Valores F(x) [F(X0) F(X1) ... F(Xn)]: '); f=input('Función f(x): '); fun=double(subs(f,datos)); DD=zeros(longitud); DD(:,1)=fun'; for j=2:long...
% Author:Eduardo Alho %Date:13/03/2017 %Uses k-means clustering for histology segmentation %root_dir: directory where images are %sigma= standard deviation of gaussian distribution for gaussian blur %filter, for blockface segmentation 5 is a good start (more blur with %higher numbers) %clusters: number of color cluste...
function summary = PWSummarize(basedir, num) % num participating senders % num packets sent % num bytes sent % num packest received % num bytes received for i= 1:num cd(basedir); data = load (sprintf('Experiment_%d.txt', i)); summary(i,:) = [i ... sum(data(:,2)) ... sum(data(...
function [weights,used,sigma2,errbars,basis,selected,alpha,lambda] = FastLaplace(PHI,y,sigma2,eta,lambda_init, adaptive,optimal,scale, verbose) % This code implements the fast Laplace algorithm from the following paper: % [1] S. D. Babacan, R. Molina, A. K. Katsaggelos. “Bayesian Compressive Sensing using Laplace Pri...
% $FILENAME$ short description % % SYNTAX % [output] = $filename$(M) % % INPUT PARAMETERS % M: mesh in patch format with the following additional subfields % - M.FA: % - M.FN: % % OUTPUT PARAMETERS % output: output description % % DESCRIPTION % Exhaustive and long description of functionality of $filena...
close all; td = load('testdata7.txt'); [td_tols, idx] = sort(td(:,4)); td_errs = td(idx,5); semilogx(flip(td_tols),1:length(td(:,1)),'ro') hold on semilogx(flip(td_errs),1:length(td(:,1)),'b*')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Wenan Chen %% September, 2007 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% This function tries to finds midline of a CT image function [rota_img, rota_seg, rtv, xy1_bump, xy1_linept]=find_midline(A) %% input: a rgb image or a gray scal image %% %% output:...
function opticFlowCalc(parentDir) %============================================================================================================================ % CALCULATE MEAN OPTICAL FLOW % Calculates the mean optic flow across each frame of each video from the fly behavior camera. Returns an nx1 cell array with % a ...
function out = arbirand(p,n) %out=drnd(p,n) %copyright: rocwoods %p is the probility distribution vector %n is the num of samples you hope to generate a = cumsum( p(2,:) ) b = rand(n, 1) out =zeros(1, n); for k = 1:n c = find( a<b(k) ) if (isempty(c)) out(k)=p...
function [charAcc, wordAcc] = ScoreModel (words, imageModel, pairwiseModel, tripletList) % This function runs the Markov network model end-to-end and computes the % per-character and per-word accuracy on provided data. % % Input: % words: A cell array where words{i} is the struct array for the ith % word (this is...
function cifrado = cifr_mochila(s, texto) %cifr_mochila - Description % % Syntax: cifrado = cifr_mochila(s, texto) % % Funcion para cifrar un mensaje con una mochila % (no tiene por qué ser supercreciente) % % Entradas: s: mochila % texto: texto a cifrar % % Salida: vector numérico que se corresponda con el...
function dataset = createDataset(dataFile) import AMF.* specification = feval(dataFile); if isfield(specification, 'DESCRIPTION') description = specification.DESCRIPTION; else description = []; end if isfield(specification, 'TYPE') type = specification.TYPE; else type = []; end if ~isfield(specific...
function list_contains = str_list_contains(list,patterns) % make case insensitive list = lower(list); patterns = lower(patterns); if ~iscell(patterns) patterns = {patterns}; end list_contains = false(numel(list),numel(patterns)); for i=1:numel(patterns) list_contains(:,i) = cellfun(@(str) any(strfind(str,pat...
function [pnsP,fP] = feedbackPressureBound3(Bn,QtA6,pns,P,k) c = [4.26e-4;4.31e-4;4.27e-4]; % mm^3 s kg^-1 a = 0; f = QtA6*1e-3; % mm^3 / s model = createpde(); importGeometry(model,'brain3D.stl'); specifyCoefficients(model,'m',0,'d',0,'c',c,'a',a,'f',f); h = generateMesh(model,'Geometr...
function plotdata=plotERAperture(lindata,ring,dpp,varargin) %#ok<INUSD> %function plotdata=plotERAperture(lindata,ring,dpp,varargin) %#ok<INUSD> % % Plots RApertures EApertures aperture. % % use with atplot(atlattice,@plotAperture); % rapind=findcells(ring,'RApertures'); eapind=findcells(ring,'EApertures'); xm=getce...
## Arthur Pessoa de Souza 380075 clc; close all; clear all; lena=imread("4.2.04.jpg"); ruido=imread("lena14.jpg"); subplot(2,3,1),image(lena); subplot(2,3,2),image(ruido); x=fft2(lena); y=fft2(ruido); for i = 1:512 for j = 1:512 z(i,j) = (real(x(i,j))^2 + imag(x(i,j))^2)^0.5; endfor endfor for i = 1:512 for...
function surfaceArea = meshSurfaceArea(FV) faces = FV.Faces; verts = FV.Vertices; a = verts(faces(:, 2), :) - verts(faces(:, 1), :); b = verts(faces(:, 3), :) - verts(faces(:, 1), :); c = cross(a, b, 2); surfaceArea = 1/2 * sum(sqrt(sum(c.^2, 2))); end
function T=cp_to_ten(params,x) if nargin>1 params.factors{params.current_factor}=reshape(x,params.dimensions(params.current_factor),params.rank); end if(params.order==1) T=params.factors{1}; else T=cpdgen(params.factors); end
function[x, uu, tt] = n1_ks(N, m, Tf, p) % This functions solves the PDE % u_t = uu_x - u_{xx} - u_{xxxx}, x \in (0, 32*pi) % u(x, 0) = cos(x/16)*(1 + sin(x/16)) % and periodic boundary conditions with 2nd order centred differences in % space and first order null scheme in time. % % Key features: % + 4th orde...
% Test Cases: [winner1] = civilWar('Captain America', 'Iron Man'); [winner1_soln] = civilWar_soln('Captain America', 'Iron Man'); % winner1 => Player 1 wins! % [winner2] = civilWar('Hawkeye', 'Black Panther'); [winner2_soln] = civilWar_soln('Hawkeye', 'Black Panther'); % winner2 => Player 2 wins! % [winner3] = ci...
% METHOD TAKEN FROM % http://www.csse.uwa.edu.au/~ajmal/code/icp.m function [ R, t, corr, q ] = ICP(p, q, tol) %initialise c1 = 0; c2 = 1; R = eye(3,3); t = zeros(3,1); fprintf('Doing Delaunay triangulation:...'); tri = delaunayn(p'); fprintf('DONE\n'); counter=0; while( c2 > c1 ) tic ...
%% Learning-by-doing model, Byunghee Choi clear; clc; global L rho kappa l v delta beta W0 W1 W2 i1 i2 %% Parameterization L=30; rho=0.85; kappa=10; l=15; v=10; delta=0.03; beta=1/1.05; ini_V=ones(L,L); ini_p=ones(L,L); new_V=ini_V; new_p=ini_p; dist=1; tol=1e-4; lambda=0.5; % for dampening num_iter=0; %% Compute...
% trace criteria % probably not gonna be used in gui function [div_order,min_trace]=crit_trace(stbc_index,const_index,r) div_order=diversity_order(stbc_index,const_index,r); min_trace=min_trace_delta(stbc_index,const_index); end
classdef injector < handle properties inject_rate bolus_volume inject_log end methods function obj =injector(a) obj.inject_rate = 0.01; obj.bolus_volume = 0.2; obj.inject_log = []; end ...
function stage = whatstage(image) %Import the model. Remember to avoid loading it each time categoryClassifier = importdata('stageClassifer.mat'); %Stage identifier function %Crop and resize frame bboxI = [367 3 912 715]; image=imcrop(image,bboxI); image=imresize(image,0.4); %predict stage ...
function makeSimpleGammaLut bufLUT = (0:255)/255; bufLUT = bufLUT'*[1 1 1]; bufLUT=bufLUT.^(1/2.2); save('/home/nielsenlab/stimulator_slave/calibration/general/simpleGammaLut.mat','bufLUT');
close all; clear; clc; m = 5; VISUALIZE = false; NODES_TO_ADD = 3500; INITIAL_NODES = 7; TOTAL_NODES = NODES_TO_ADD+INITIAL_NODES; SIZE = NODES_TO_ADD+INITIAL_NODES; graph = GenerateERGraph(INITIAL_NODES, 1); initialConnections = EdgeList(graph); numInitialEdges = size((initialConnections),1); edgeList = zeros(NODES_T...
function score = computeIntegralImageScores(integralImage,windows) windows = round(windows); windows(windows == 0) = 1; %windows = [xmin ymin xmax ymax] %computes the score of the windows wrt the integralImage height = size(integralImage,1); index1 = height*windows(:,3) + (windows(:,4) + 1); index2 = height*(windows(:...
% % ECEN2060 % Initialize MPPtrackIref % global Iref; global Increment; global Pold; Pold = 0; % initial value for the sensed power Iref = 4; % initial value for the current reference Increment = -1; % initial direction: decrease reference current
warning off rootDir = '/Users/mbu/Documents/fMRI_data/ASL_TMS_project/'; rootDir = '/home/data/asl/'; subjects = [ ... '100125mh'; % - ok '100203mh'; % -ok '100201ra';% - ok '100208ep';% - ok '100210ra';% - ok '100217ep';% - ok '100308am';% - ok - missing a bit up top '100317am';% - ok '100322nt';% - ok '1003...
function [feature] = descriptor_mir(gamma, zeta, res, t_end, Fs) %DESCRIPTOR_MIR Descripteur a partir d'une fonction de la MIRtoolbox % Renvoie la valeur de la fonction de la MIRToolbox % Inputs : % gamma : Paramètre de pression dans la bouche adim % zeta : Paramètre d'anche adim % res : Matrice de taille N_MOD...
function obj = update(obj) % Biafra Ahanonu % Started: 2021.03.25 [22:11:25] (branched from ciatah.m) % Notify user if they are behind version-wise. ciapkg.io.updatePkg; uiwait(ciapkg.overloaded.msgbox('The CIAtah GitHub website will open. Click "Clone or download" button to download most recent version of CIAtah...
%applies Signal_RMS to columns of a matrix function y = matrix_rms(input, windowlength, overlap, zeropad) for i = 1:size(input,2); y(:,i) = signal_rms(input(:,i),windowlength,0,0); end end
% ODE Assignment 2 clear all close all clc clf %% Logistic equation % global a b % % a = 1; % Scalar constant % b = 2; % Right hand side % T = 100; % tau = [0 T]; % Time vector % x_init = [0:5]; % Begynnelsevärde % ri = 0.1; % K = 10; % % f = @(t,x)ri.*x.*(1-x./K); % % hold on; % % fo...
clear all folder_all=dir('./Results-map'); falsefolder=[];k1=1; for i=1:numel(folder_all) if folder_all(i,1).name(1)=='.' falsefolder(k1)=i; k1=k1+1; end end folder_all(falsefolder)=[]; for j=1:numel(folder_all) imgpath=['./Results-map','/',folder_all(j,1).name,'/','*.tif']; allimg...
function process_fista_neighbor_clust(filename) % Cluster the events with isosplit5 algorithm, also make sure the labels % will follow them after events are separated into different files. S=load(filename); fista=S.fista; %data_s=smooth(S.data_pad); fista.X1_neighbor=zeros(length(fista.X1_max),56); ...
function VTSoptPath = VTS_makeExperimentOptFile(experiment) prompt = {'Enter the duration of experiment blank(s)',... 'Enter the number of pre-experiment blanks', ... 'Enter the number of post-experiment blanks', ... 'Enter number of cycles (sweeps) per experiment', ... 'Enter number of tactile st...
function [ deformed_mesh, rotations ] = deformRotInvCoords( mesh, consF, consP ) %[ deformed_mesh ] = deformRotInvCoords( mesh, consF, consP ) % % consF: rows of [vtx_i, m11, m12,... m33, weight_i] (m = 3x3 transformation matrix) % consP: rows of [vtx_i, x, y, z, weight_i] pcount = numel(mesh.vid...
%% specify a subset only because 100k takes too long subset = 1:num_ratings; userIds = dataset.userIds(subset); itemIds = dataset.itemIds(subset); ratings = dataset.ratings(subset); %% calculate the training error predicted = BARTMAP_eval(data, result, userIds, itemIds); errors = predicted - ratings; %% print some o...
function [zc,zcg,t,n,del] = threebody(th1,th2,l,zcg1,t1,n1,del1) % E Kanso, April 22, 2004 % modified April 27, 2004 % -----------------INPUT % % zg position of c.o.m of ellipses % % beta angle of each ellipse relative to inertial frame % % a & b major and minor axes of the ellipse % % npts total number o...
function out = PM_dm(O,Bmstop,data,dataMask) % if param.B % % inFT = fftNc(param.O); % Bufferdata = inFT(param.Bmstop==1); % temp1 = param.data.*inFT./sqrt(abs(inFT).^2+param.B.^2); % param.B = param.data.*param.dataMask.*param.B./sqrt(abs(inFT).^2+param.B.^2); % ...
%[x y] = meshgrid(-1000:10:1000); % Generate x and y data x = 330:530; y = -230:-30; [X,Y] = meshgrid(x,y); for i = 1:1 A = wPlaneCol(i,1); B = wPlaneCol(i,2); C = wPlaneCol(i,3); D = wPlaneCol(i,4); Z = -1/C*(A*X + B*Y + D); % Solve for z data A2 = wPlaneRow(i,1); B2 = wPlaneRow(i,2)...
function m = initModelStructured(data_train) %% Parameters for memory allocation Q = data_train.nLabels; % for unary nodes. we treat the binary nodes separately Nx = data_train.TT; % total number of feature fectors D = size(data_train.X,2); nUnary = Nx*Q; nBinary = Q^2; nTotal = data_train.max;...
clear all close all exp_folder = 'D:\GoogleDrive\retina\Chou''s data\20210504'; cd(exp_folder) load('rr.mat') load(['Analyzed_data\unsort\0224_cSTA_wf_3min_Q100.mat']) figure('units','normalized','outerposition',[0 0 1 1]) ha = tight_subplot(8,8,[.04 .02],[0.07 0.02],[.02 .02]); for channelnumber=1:60 axes(ha(rr(c...
% Function [CtxSti, ThresholdValue]= HL_FP_ParseSti(CtxSti_ch,sr, ThresholdValue, stimulus_length) % function to process the recorded stimulus channel data to identify % sitmulus onset and timing % INPUT: % CtxSti_ch: data of the stimulus channel, 1 x n vector % sr: sampling rate % ThresholdValue: t...
% reset order % for the run about to be completed, clear out any prior responses and run totals % reset total score % % first column in order is blocknum function order = resetOrder(order,run_num) %runTotals(subject.run_num) = 0; %reset total points in this run %range=((run_num-1)*trialsPerBlock+1):(run_num*t...
classdef imageRegistrationGUI < handle properties (SetAccess=public) h par end properties (SetObservable, AbortSet = true, SetAccess=public) end properties (Constant) end methods function obj=imageRegistrationGUI() %class constructor %d...
%-------------------------------------------------------------------------% % % File: W2weight(xc,locpts,Cp,cellradius) % % Goal: script that computes the PU weights % % Inputs: xc: the collocation points % locpts: the collocation points on the subdomains % Cp: centres of the PU subd...
function p = fhm_params_col(bufSize, s2_type,s2_fSizes,c1sp) p.groups={}; c = struct; c.name = 'ri'; c.type = 'riMultiDim'; c.size = [3 bufSize(1) bufSize(2)]; p.groups{end + 1} = c; p.ri = numel(p.groups); %***************************************************************************...
function [x] = gauss(A, b) [A, b] = upperTriangular(A,b); x = solveUpperTriangular(A,b); end
% Création d'un grid sag adapté à l'exportation dans zemax. % Scipt principal pour la génération à une surface 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é [distor...
%%İONESPHERE VERİSETİ İÇİN ROC CURVE clear all;close;clc; load ionosphere; %binary classification [m,n] = size(X); Per = 0.80; idx = transpose(randperm(m)); Training_X2= X(idx(1:round(Per*m)),:); Training_Y2= Y(idx(1:round(Per*m)),:); %Spilitting data Testing_X2 = X(idx(round(Per*m)+1:end),:); Testing_Y2= Y(idx...