text
stringlengths
8
6.12M
function [dX_dchi] = Boozer_chi_derivatives_HSX(chi, Position, current, taper) % function [dX_dchi] = Boozer_chi_derivatives(chi, Position, current, taper) % % This returns the ode for a field line as a function of chi % (chi = the integral of |B|*dl along the line)r % % This is inteded to be solved with one of ...
% (1) Kernel Based Hypothesis Testing: Maximum Mean Discrepancy % Using T_n = (n1+n2)(norm(mu2-mu1)_H)^2 as test statistic - MMD % (1i) Have sum of BOLD levels for each region in each patient: % Proceed to normalize BOLD levels across patient. Use this as a way to get % an 'average' region i measure for person j % (1...
function plot_density(x,nelx,nely,XL,YL,loop,Mnd2) % PLOT DENSITIES x_axis=(1:1:nelx)*XL/nelx; y_axis=(1:1:nely)*YL/nely; figure(1); colormap(gray); imagesc(x_axis,y_axis,1-x); axis equal; axis tight; axis on; %colorbar %drawnow; title(['Density plot (',num2str(loop),' iter. Gray level indicator...
function [ nn ] = interface_get_nnOptSet(refInfo) stringToRun=''; stringToRun=strcat(stringToRun, refInfo.get_nnOptSetFunction); stringToRun=strcat(stringToRun, '('); stringToRun=strcat(stringToRun,'refInfo'); stringToRun=strcat(stringToRun,')'); [nn]=eval(stringToRun); end
function [vecXi, vecE]=fun_NR2(fun,der,x0,error) fx = fun(x0); dx = der(x0); ea(1) = 100; i=1; vecXi = nan(2,1); vecE = nan(2,1); while abs(ea(i))>=error xi = x0 - (fx/dx); ea(i+1) = (abs(xi-x0)/xi)*100; vecXi(i) = xi; ea(i) = ea(i+1); vecE(i) = ea(i); x0 = xi; fx = fun...
function fVec = extractVideoFeatures( filePath, startFrame, endFrame ) %EXTRACTVIDEOFEATURES Summary of this function goes here % Detailed explanation goes here % TODO NORMALIZE FEATURES TO 0 .. 1 videoReader = VideoReader(filePath); % calculate ROI of first frame (to determinen size) firstFrame = read(videoReader...
%This function takes image data as an input and rotates the image according %to two points selected by the user. The image is rotated so that the %selected points are horizontal.Once the image has been satisfactorily %rotated the user can exit the GUI window, and the rotated image and angle %will be returned. %c...
% This script produces figure 4 of the article from saved data. popdata = load('data_populationSizeRate.mat'); popMeanErr = mean(popdata.meanE,3); popSdErr = std(popdata.meanE,0,3); popindices = [17 5 18 19 20 21]; jitterindices = 1:5; popsize = popdata.cases(popindices,1); figure, hold on, plot(popsize, popMeanEr...
function linearODESolveP2X4Inact2factor() global k1 k2 k3 k4 k5 k6 L1 L2 L3 L4 L5 L6 W2 H0 H11 H12 H13 H14 H5 kd1 kd2 kd3 kd4 ks1 ks2 ks3 ks4 H3 H3D H4 g1 g2 E1 E2 delta epsilon mu A J V n1 n2 n3 r1 r2 r3 v1 v2 v3 p0 Acell Tsoln I Y imin imax t0 Q; %#codegen generatorMatrixP2X4Inact2factor(); for i=imin:imax p...
clc,clear all echo off disp('FName LName and my UH ID is 0000000') % E3 Practice %background:temperatures taken at Houston Zoo %throughout 2013 at 12noon daily. There are 52 rows % (weeks) and 7 columns (days of week). Column 1 % represents "Sunday"...Column 2 represents "Monday" etc. % the dataset is named ...
function writeKnossosCube( kl_parfolder, kl_fileprefix, kl_cubeCoord, ... kl_cube, classT, kl_filesuffix, options, cubesize ) % WRITEKNOSSOSCUBE: Write from Matlab into raw data % % The function has the following arguments: % KL_PARFOLDER: Give the root directory where you want the file to be % ...
%% Create folder clk = clock; date_str = [num2str(clk(1)),'-',num2str(clk(2)),'-',num2str(clk(3))]; time_str = [num2str(clk(4)),'-',num2str(clk(5))]; save_path = [root_dir,'/SimLog/',date_str,'/',time_str,'/']; mkdir(save_path) cd(save_path) %% Save log user_input = inputdlg({'Date/Time','Setup','Results'}, 'Data Log'...
% aamod_pilab_rsa_predictorvisualisation_group and % aamod_pilab_rdms_visualisation_group. % % mds plots with supporting lines using plotmdslines so we have a set of % colours for eccentricity (purple to pink). So we connect the points % according to the order specified by direction and colour them according % to eccen...
% Anthony Rosenblum % DSP - Lab 5 % 2/7/2019 %% Pre-lab % 2-2a tt = 0:0.5/11025:0.5; x1 = 100 * cos(2*pi*800.*tt -pi/3) soundsc(x1) %% 2-2b tt2 = 0:0.8/11025:0.8; x2 = 80 * cos(2*pi*1200.*tt2+pi/4) soundsc(x2) %% 2-2c xx = [x1,zeros(1,1103),x2] soundsc(xx) %% 2-2d ttx = (1/11025)*(1:length(xx)); plot(ttx,xx)...
clear all %% ground truth values of each marker in world frame p1_gnd = [10.563 2.483]; p2_gnd = [0 14.5]; p3_gnd = [-11.655 8.741]; p4_gnd = [0 -14.5]; p_gnd = [p1_gnd; p2_gnd; p3_gnd; p4_gnd]; threshold = 0.05; p_ptp_gnd = zeros(4,4,2); for i = 1:4 for j = 1:4 p_ptp_gnd(i,j,:)=p_gnd(j,:)-p_gnd(i,:); ...
function A_version global ADEPT_INIT_FLAG CONST A_FID ADEPT_VERSION if isempty(ADEPT_INIT_FLAG) a_init; else fprintf('\nADEPT.m Version: %s\n\n',ADEPT_VERSION); fprintf('Author: Jeffery L. Gray, grayj@purdue.edu'); fprintf('\n School of Electrical and Computer Engineering'); ...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Author: Trinh, Khanh V <khanh.v.trinh@nasa.gov> % Notices: % % Copyright @ 2020 United States Government as represented by the % Administrator of the National Aeronautics and Space Administration. All % Rights Reserved. % % Disclaimers % % No Warranty: ...
function pf_new=remove_empty_rows_new(pf) row_size=size(pf,1); if length([pf{:,3}])==0 pf_new=cell(1,6); else pf_new=cell(1,6); if length([pf{1,3}])~=0 pf_new=[pf_new;pf(1,:)]; end for i=2:row_size-1 if length([pf{i,3}])==0 pf_new=[pf(1:i-1,:);pf(i+1:e...
% --- Executes on selection change in listbox_activeFilters. function listbox_activeFilters_Callback(hObject, eventdata, handles) % hObject handle to listbox_activeFilters (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) up...
%========================================================================= % % Likelihood ratio tests of deterministic trends in a vecm % %========================================================================= function coint_trend( ) clear all clc RandStream.setDefaultStream( RandStream('mt19937ar','...
clear all mkdir('Result','LinkPrediction3DBLP2WS') load LinkPrediction3DBLP2LabellFeatureHop3 %reduce the feature vector by deleting the features which are 0 for all %data t=Data{1}(:,:); for i=2:stamps+1 t=cat(1,t,Data{i}(:,:)); end t2=sum(t); t3=find(t2); for i=1:stamps+1 Data{i}=Data{i}(:,t3); end MasterD...
% load_nss_test.M % see notocord.file %!!! IMPORTANT: event markers 2 goes with channel 01 !!! %test cases: file_path = 'C:\Data\GSK\Phase 2\Control Group\161107\161107_Control_group_ analyzed.nss'; wtf = notocord.file(file_path); % the continuous_stream class with fs, dt, n_samples, duration stream1 = wtf.getStr...
clc;clear;close all N = 512; fin=fopen('boat_512_512.raw','r'); %fout=fopen('boat_512_512_dis.raw','w'); I=fread(fin,N*N,'uint8=>uint8'); ft_Z=reshape(I,N,N); ft_Z=ft_Z'; figure; imshow(ft_Z); LEN = 5; avgH = (1/LEN^2) .* ones(LEN,LEN); J = conv2(ft_Z, avgH,'same'); figure; imshow(uint8(J)); %fwrite(...
%% Iteration 0 simul_res0 = load("Results\SimulationResults_17-Mar-2021_PLacIter0TrainingSet.mat"); it0 = zeros(288,4); it0(:,1) = simul_res0.simul_res.resultsPL.sim.tsim{1}; it0(:,2) = simul_res0.simul_res.resultsPL.sim.states{1}(:,4); it0(:,3) = simul_res0.simul_res.resultsPL.sim.states{2}(:,4); it0(:,4) = simul_...
% Cluster coefficient C = zeros(1,5); % The number of neighbors each node has n1 = zeros(1,5); for i = 1:5 for j = 1:5 if d(i,j) == 1 n1(i) = n1(i) + 1; end end end % The number of edges between each node's neighbors n2 = zeros(1,5); for i = 1:5 for j =1:5 ...
function varargout = Calculadora_LTE(varargin) % CALCULADORA_LTE MATLAB code for Calculadora_LTE.fig % CALCULADORA_LTE, by itself, creates a new CALCULADORA_LTE or raises the existing % singleton*. % % H = CALCULADORA_LTE returns the handle to a new CALCULADORA_LTE or the handle to % the existing si...
function [k, a, d] = decision_stump(X, y, w) % decision_stump returns a rule ... % h(x) = d if x(k) ¡Ü a, -d otherwise, % % Input % X : n * p matrix, each row a sample % y : n * 1 vector, each row a label % w : n * 1 vector, each row a weight % % Output % k : the optimal dimension % a : the optimal ...
function exp = laser_shock1_testHalf(exp) laserDistribution = exp.protocolArgs{1}; laserParams = exp.protocolArgs{2}; exp.laserDistribution = laserDistribution; exp.laserParams = laserParams; exp.nullEpochs = [1,3,5]; exp.leftEpochs = [4]; exp.rightEpochs = []; exp.t...
% function K = kernelmatrix(ker,X,X2,sigma) % % Inputs: % ker: 'lin','poly','rbf','sam' % X: data matrix with training samples in columns and features in rows % X2: data matrix with test samples in columns and features in rows % sigma: width of the RBF kernel % b: bias in the linear and polinomial ker...
function p = frameUpdate(p) % p = pds.tracking.frameUpdate(p) % get current sample from tracked source & apply calibration % % Called during [frameUpdate] state of [pldapsDefaultTrial] % % TODO: Add explainer for how updateFxn should be constructed for different % tracker sources. % % %!%!%!% WARNING %!%!%!% % % ...
%soal no 2 : membuat fungsi pdf function hasil = fungsi(x1,x2,x3,datakelas,sigma) %mengambil nilai n [n, kolom]=size(datakelas); %menghitung sigma for i=1 : n jumlah = (x1 - datakelas(i,1))*(x1 - datakelas(i,1)) + ... (x2 - datakelas(i,2))*(x2 - datakelas(i,2)) + ... (x3 - datakelas(i,3))*(x3 - data...
function a = apply(n,param) %TRIBAS.APPLY Apply transfer function to inputs % Copyright 2012-2015 The MathWorks, Inc. a = max(0,1-abs(n)); a(isnan(n)) = nan; end
function Bingo() global main; main = figure('numbertitle','off','toolbar','none','menubar','none','color','black','name','Bingo','resize','off'); % 장애물이 몇번 펀치를 맞는지 셈. global push_cnt; push_cnt = 0; global now_cnt; now_cnt= 0; % mode 0일때 set_mode mode 1 일때 shakehand, 게임실행. global mode; mode = 0; global bingoCnt...
function d = normDist(shape1, shape2, index1, index2) % NORMDIST - normalized distance between 2 shapes. % % D = NORMDIST(SHAPE1, SHAPE2, INDEX1, INDEX2) will compute a normalized % distance between two shapes.shape2dobject, by taking the mean of the % eulclidian distance from 1 point of shape1 to the closest sh...
function cascade_test02 ( ) %*****************************************************************************80 % %% CASCADE_TEST02 computes a scaling function at 5 resolutions. % % Licensing: % % This code is distributed under the GNU LGPL license. % % Modified: % % 13 August 2011 % % Author: % % John Burkar...
function test(image_path, frame, Level, lambda, mu, delta,... kernel_size, gaussian_sigma, noise_rate, result_image_path) if nargin<1, image_path = './image/fig1.png'; end if nargin<2, frame= 1; end % wavelet frame type % 0--Haar; 1--piecewise linear; 3--piecewise cubic if nargin<3, Level=2; end % decomposition le...
classdef limit properties lower upper end properties (Dependent = true, SetAccess = private) range constant end methods function Limit = limit(l,u) if nargin == 2 if l > u error('Lower limit must no...
%-------------------------------------------------------------- % Elektrische Systeme 1 % Musterlösung - Aufgabe 2 % Prof. Dr.-Ing. V. Sommer, Beuth Hochschule für Technik Berlin %-------------------------------------------------------------- clear close all home rho = 0.0179; % in Ohm mm^2/m A = 1.5; ...
fileNames = dir('*N*_*.*'); ss = size(fileNames,1); save = 1 ; %yes = 1 path = 'C:\Users\PEAQ\Documents\PhD_York\Working from Home Folder\LearningExperimentGithub\LearningExperiment\images\Mask\'; for i=1:ss fileNames(i).name im=imread(fileNames(i).name); %// Cast out = uint8(im); if save ==...
function [patterns n_positive n_negative n_scans] = load_test_scans( file, positive_label) %------------------------------------------ % load training_set %------------------------------------------ clear scan; fprintf('Loading scans...'); load(file); fprintf('DONE\n'); %-----------...
function segImage = graykmeans(img, k) iSize = size(img); % Initialize means = rand(k, 1); means(:, 1) = round(means(:, 1).*255); minChange = 2; % Made the image into a column for some optimizations imgc = double(reshape(img, iSize(1)*iSize(2),1)); change = realmax.*ones(3,...
% Issues % 1) FIXED Need to increase precision for time column - issue was with % csvwrite in fGetMITBIHData. replaced with dlmwrite and added precision % argument % 2) FIXED 108, 109, 111 need to be re-got with correct precision % 3) FIXED First waveform (V) looks upside down - it's fine, that's how the % data looks i...
% Javier Salazar 1001144647 Numerical Project Method Comparison clc clear variables %----------parameters----------------- func = @(x) ((1-cos(x))./x); % function input a = 0; % domain parameter 1 b = 2*pi; % domain parameter 2 plotPoints = 24; % how many 2^point calculations to go up to samplingDist = truncate...
function varargout=set_mat_par_FEBIO(febXML,saveName,mat_cell) % function FEB_XML=set_mat_par_FEBIO(filename,savename,mat_cell) % ------------------------------------------------------------------------ % % Example: % mat_cell={}; % mat_struct.id=1; % mat_struct.par_names={'density'}; % mat_struct.par_values=...
% MS: Really INCOMPLETE implementation of probit potential, just % for debugging % % See also POTFUNCTIONS.M. function P = potMSErf(s,type,z) %fprintf(1,'PotMSErf: nargin=%d\n',nargin); if nargin==1 % Have no clue what to do here! Just copied from 'potLogistic' q = numel(s); P = zeros(q,4); ...
clear all; close all; clc; %%%% COMO TP2_2 pero con una differencia en la actualizacion de los w %%% Version mejorada con computacion de la energia global de un ciclo con cada patron %%% ! mas fiable y funciona siempre pero a veces no converge y se queda E=0.2500 ! %% VAR matrice_XOR = XOR_matrix(); figure,p...
function [a,b,c]=nacteni_puvodni(data) data=data(1:end-6); nazev=[data '01.ics']; addpath('bfmatlab') bfopen(nazev) r=ans{1}; for k=1:size(r,1) b(:,:,k)=r{k,1}; end nazev=[data '02.ics']; bfopen(nazev) r=ans{1}; for k=1:size(r,1) a(:,:,k)=r{k,1}; end nazev=[data '03.ics'];...
clear all; %a script sysA = [1; 1; 1; 1]; sysB = [1; 0; 10000; 10000]; sysC = [1; 100; 0; 250]; for system = 1:1:4 a = sysA(system); b = sysB(system); c = sysC(system); matA = [ 0 1 0; 0 0 1; -a*(b^2 + c^2) -(b^2 + c^2 + 2*a*b) -(2*b+...
function [data, w] = normalize_data(data, scale, w) %-------------------------------------------------------------------------- % data normalization % % Author: Tianyi Lin, UC Berkeley, 2018. %-------------------------------------------------------------------------- A = data.A; b = data.b; c = data.c; ...
function A = vec2mat_mask(vec_data, mask) % A = vec2mat_mask(vec_data, mask) % % This function is used to convert a vector to a matrix [row, col] = size(mask); tmpA = zeros(row*col,1); tmpA(mask(:)) = vec_data; A = reshape(tmpA, [row, col]); end
#include "com_codename1_ui_List.h" const struct clazz *base_interfaces_for_com_codename1_ui_List[] = {}; struct clazz class__com_codename1_ui_List = { DEBUG_GC_INIT &class__java_lang_Class, 999999, 0, 0, 0, 0, &__FINALIZER_com_codename1_ui_List ,0 , &__GC_MARK_com_codename1_ui_List, 0, cn1_class_id_com_codename1_ui_...
% ====================================================================== %> @brief computes the spectral flux from the magnitude spectrum %> called by ::ComputeFeature %> %> @param X: spectrogram (dimension FFTLength X Observations) %> @param f_s: sample rate of audio data (unused) %> %> @retval v spectral flux ...
function PSNR = CG_PSNR(Base_image, Recon_image) [m,n] = size(Recon_image); Max_I = max(max(abs(Base_image))); MSE = sum(sum( (abs(Base_image-Recon_image).^2) ) )/(n*m); PSNR = 10*log10( (Max_I).^2/MSE ); return
close all; clearvars; % Add kernel codes to path addpath ../kernel/ dir = '/lustre/projects/flag/'; sub_dir1 = '/TMP/BF/'; sub_dir2 = '/word_lock_cov/'; file_array = {'2017_07_21_15:23:00A',... '2017_07_21_15:24:43G',... '2017_07_21_15:25:53B',... '2017_07_21_15:26:41B',... ...
function result = ex_test(e) % ex file: ex_activeFixation % % Active fixation tasks for any stimuli % % XML REQUIREMENTS % runline: a list of strings which correspond to other parameter names. % This list of names is used to construct the custom set command to the % slave % NAMES: all the parameters listed...
clear all; close all; %% experimental setting % load test images: cameraman couple coco house crowd lake bridge mixture image_name = 'mixture.tif'; clean_image = double(imread(image_name)); % convolution kernel s = 3; filter_type = {'Gaussian' s}; s = 9; filter_type = {'experiment_3' s}; % filter_type ...
function f = D_x(A, varargin) % Derivative along x (abscissae) % % f = D_x(A,'c') return the centered derivative (default) % f = D_x(A,'+') return the forward derivative % f = D_x(A,'-') return the backward derivative if length(size(A)) == 3 A = rgb2gray(A); end [m,n] = size(A); if nargin < 2 ...
%Matthew Russell clear clc x = [1, 2, 3, 4, 5]; squares = zeros(1, length(x)); count = 1; fprintf('%7s %7s\n', 'Num', 'Square'); while count <= length(x) squares(count) = x(count) * x(count); fprintf('%7d: %7d\n', x(count), squares(count)); count = count + 1; end
classdef DeterministicTemperatureMPC < Controller.DeterministicMPC % properties % % afLowerBoundForTheVentilation; afRhoSoftConstraintsWeight; % % fTacPercentageOnSupplyAir fTaiPercentageOnSupplyAir % output values after the post processing phase % fAirConditionedTemperature; ...
function [y] = mySimpleFunc(x) %mySimpleFunc practice function to do y=x^2 y=x.^2; end
#Ejemplo h = 'hola' function dX = f (x, t) k = 1.4; dX(1) = -x(1) +x(3); dX(2) = +x(1) -x(2); dX(3) = +x(2) -x(3); endfunction x0 = [10; 1; 1]; t = linspace (0, 50, 200)'; x = lsode ("f", x0, t); plot(t,x(:,1)); xlabel("Tiempo (h)"); ylabel("Concentracion 1 (M)"); title("Evolucion temporal de la concentr...
%% Example 2 by Xiaodong %clear addpath('../'); load NN.mat; load sysd.mat; A = sysd.A; B = sysd.B; C = [1, 0]; D = 0; network.weight = {[weights_first_layer1, weights_first_layer2], weights_second_layer}; network.bias = {bias_first_layer,bias_second_layer}; network.activeType = {'tansig','purelin'} ; save data netwo...
function perspective wall = zeros(6,4,3); wall(1,:,:) = [0,0,0; 50,0,0; 50,0,10; 0,0,10]; % right wall RED (const y) wall(2,:,:) = [0,50,0; 50,50,0; 50,50,10; 0,50,10]; % leftwall GREEN (const y) wall(3,:,:) = [0,0,0; 50,0,0; 50,50,0; 0,50,0]; % floor BLUE (const z) wall(4,:,:) = [0,0,10;...
function gui_screen_position(panel_handle,alig_x,alig_y) % % gui_screen_position v 1.0 (Aug 2008) % % % % gui_screen_position(panel_handle,alig_x,alig_y) % % % % allign figure on the screen (assuming the size of figure is smaller % % than a screen) % % panel_handle - alligned figure handle % % alig_x - x ax...
function j_nbr = get_j_nbr(j_nbr_unreduced, k, periodic_j, j_max) % % Returns periodic reduction of j if flag is set at this k % Otherwise returns j_nbr_unreduced % Copyright (c) 2019, Alexander D. Kaiser % All rights reserved. % % Redistribution and use in source and binary forms, with or without % modification, a...
function [x] = B(target, output) R = target - output; R = R * R'; x = R/2; end
close all; clear all; [F,V,extra] = read_obj('hemisphere.obj'); delta=0.00001; Vno=size(V,1); [VB, VI, VBno] = BoundaryIndex(F); E = sparse(F, F(:,[2,3,1]), true, Vno, Vno); [I, R] = InvDistMetric(F, V, VB); % [I, R] = ThurstonMetric(F, V, VB); % [I, R] = TangentMetric(F, Vno); % [I, R] = IsoscelesConstan...
function lp = calcLightFR(lp) lp = calcLightFRall(lp); % resort the events according to thier spot position [a,I,ocur] = mySortRow(lp.eventsLog(1:min(length(lp.TTLEvents), length(lp.eventsLog)),1:end-1)); %Calculate the average per group lp.lightFR=[]; lp.nonLightFR=[]; lp.lightFR=[]; for ii=1:length(ocur)-...
function collecting_info(i,subinfo,b) % collecting_info.m global results; results(i,1).id=str2double(subinfo{1}); if strcmp(subinfo{2},'ÄÐ') results(i,1).sex='male'; else results(i,1).sex='female'; end results(i,1).age=str2double(subinfo{3}); results(i,1).trialno=i; results(i,1).group=b{(results(i,1).id-1)*6+re...
function b=input_vector(n) disp('Enter values for column vector B'); b=[]; for i=1:n b(i)=input(''); end b=reshape(b, n, 1); end
function result = isInsideHull(pt, abc) %Judge if a point is inside the convex hull % Input: % pt: point of interest (2x1) % abc: hull edges (3xN), ax + by + c = 0 is the line, < 0 is % considered to be inside % Output: % result: true or false. Return true if the point is inside or ON THE % ...
function CD_fin = C_d_fin(mach_num, vehicle, env) M_A = mach_num*cos(vehicle.A_le); if M_A > 1 eq_1 = vehicle.num_of_fins*2/(env.sp_heat_ratio*mach_num^2); eq_2 = (((env.sp_heat_ratio+1)*mach_num^2)/2)... ^(env.sp_heat_ratio/(env.sp_heat_ratio-1)); eq_3 = ((env.sp_heat_ratio+...
%Bob Gess, June 2008, for EE473 %Allows simulation of the received signal without generating a new %transmitted signal. fcarr=20000 %set carrier frequency noise_offset=6000 %How far away (in Hz) jamming signal is from center frequency %Restores clean signal before new noise environment is simulated ...
clear all; close all; clc; %% plot EKG data and count waves number load('EKGdata2.mat'); t = EKGdata2(:,1); data = EKGdata2(:,end); plot(t,data) xlim([min(t) max(t)]) xlabel('time') ylabel('amplitute') title('EKGdatda VS. time') a=find(data(:,1)>1.5); diffa = diff(a); index = find(diffa~=1); number = length(index)...
[eigFac, avg] = computeEigenFaces(); Omega = computeOmegaForTrainingSet(eigFac, avg); path = 'D:\Semester 8\Numerical Algorithms\Assignment 2b\BioID-FaceDatabase-V1.2\BioID_0000.pgm';
function output = GetWhishart( cov1, p ) output = p.L*log(det(p.covariance)) + (p.L-p.q)*log(det(cov1)) - p.L*trace((p.covariance^(-1))*cov1); end
function [ pdf_out ] = advanceddensitykernel( dat ) % % This is a skeleton you can use to get the oKDE [1] quickly up and running % your own data. % % [1] Kristan Matej, Leonardis Ales and Skocaj Danijel, "Multivariate Online Kernel Density Estimation with Gaussian Kernels", % Pattern Recognition, 2011. % % Author: M...
close all; clear; D = 3; mode = 'points'; switch mode case 'centers' %% Hand model model_path = '_data/my_hand/model/'; data_path = '_data/my_hand/trial1/'; load([model_path, 'centers.mat']); load([model_path, 'radii.mat']); load([model_path, 'blocks.mat']); ...
% obtain pairwise result from simulated families function [ ref_ibd_pair, ref_ibd_sc, ibs, ibs_sc ] = simulation_all_pairs( input_family_range, input_pairlist, pedigree_all_missing, family_all ) for iteration = 1:length(family_all) random_pedigree = family_all{iteration}; f = input_pairlist(1,3); ...
function [output] = outlier_filter(data,min,max) size_data = size(data); for ii = 1:size_data(2) for jj = 2:size_data(1)-1 if data(jj,ii) > max data(jj,ii) = ((data(jj-1,ii) + data(jj+1,ii))./2); elseif data(jj,ii) < min && data(jj,ii) ~= 0 ...
function [distance]=getDistBwRegions(nodeIDoutRectCoarse,nodeCoord, regionIdT,regionIdTm1) % calcultes the distance between two region CGs regionIndex =find(nodeIDoutRectCoarse(:,regionIdT));%% finds selected nodes keyPointsRegion =nodeCoord(regionIndex,:); regionIndexTm1 =find(nodeIDoutRectCoarse(:,regionIdTm1))...
% to speed things up, could get rid of mode function function [predTr predTe] = knn_classify_bilin(dataTr,labelTr,dataTe,M,k) nTr = size(dataTr,1); nTe = size(dataTe,1); predTr = zeros(1,nTr); predTe = zeros(1,nTe); B = 750; for i=1:B:max(nTr,nTe) if i <= nTr BTr = min(B-1,nTr-i); DTr = dataTr*M*da...
%% Clear the workspace clear all close all clc fclose('all'); %% Define some processing parameters % Here - a place to which to return (there are many migrations between folders in the worker functions) Home = pwd; % A top-level project folder, which may already be designated in a local file - other...
function instances_of_crossover = my_two_color_analysis(Green_MY_DATA, Red_MY_DATA) for i = 1:length(Green_MY_DATA) Green_name_contents{i} = strsplit(Green_MY_DATA(i).name); end for i = 1:length(Green_name_contents) Green_pull_these_kymos{i}{1} = Green_name_contents{1,i}{1}; Green_pull_these_kymos{i}{2} =...
tic; np = 1200; noi=100; n=d; penguines=zeros(np,n+3); penguines=initial(penguines,range); penguines=benefit(penguines,objective_function); penguine_memory=penguines; hamEPO=[]; for g=1:noi penguines=update_penguine_parameters(penguines,g,noi,range); penguines=benefit(penguines,objective_function); ...
function fav = avaliacao(pop,nbits,gene,xlo,xhi) fav = zeros(size(pop,1),1); for i = 1:size(pop,1) %p = xlo + (xhi - xlo) * ([2.^(-[1:nbits])]*reshape(pop(i,:),nbits,gene)); p = codificacao(pop(i,:),xlo,xhi,nbits,gene); % Função básica %fav(i) = 2000 - ((sin(sqrt(p(1)^2 + p(...
function [Y, X, P, Z] = sim_dataset2(N, k, BETA, GAMMA) % Generate dataset for part 2 of the problem set % Input Arguments: % N = Number of observations % k = length of y vector % SIGMA = 2 by 2 covariance matrix % BETA = scalar % ALPHA = scalar % Outputs: % Y = N by 1 ve...
mkdir(SOLUTION_DIR); for iCond = 1:nCond filename = sprintf('%03d_%02d.mni', Avg(iCond).RandomSeed, Avg(iCond).subject); filepath = fullfile(SOLUTION_DIR, filename); d = [Avg(iCond).xyz,Avg(iCond).nodestrength]; dlmwrite(filepath, d, ' '); filename = sprintf('%03d_%02d_dv.mni', Avg(iCond).RandomSeed...
% op_rs_rxy_01.m % Rectangular aperture % Numerical integration of the Rayleigh-Sommerfield diffraction integral % Uses Cartesian coordinates % % Users functiond % simpsonxy_coeff.m distancePQ.m % 07 sep 2014 % Ian Cooper School of Physics University of Sydney % cooper@physics.usyd.edu.au % http://www.ph...
function [ start_loc, goal_loc ] = assignStartEndLocs_Q3( index ) %UNTITLED12 Summary of this function goes here % Detailed explanation goes here switch index case 1 start_loc = [2.45, -3.55]; goal_loc = [0.95, -1.55]; case 2 start_loc = [4.95, -0.05]; goal_loc = [2.45, 0.25];...
%%cloudplot %Function to plot the cloud profile of the atmosphere. displaying cloud %in orange and cloud-free regions in blue. %Requires cloud bounds to already be calculated. % %General form: [] = cloudplot(y,m,d,h,cloudLB,cloudUB) %Inputs: %y: year %m: month %d: day %h: hour ...
%% Inicializacion clc; clear; close all; %% Cargar datos load ./datos_entrenamiento/X.mat; load ./datos_entrenamiento/Y.mat; load ./datos_entrenamiento/F.mat load ./datos_entrenamiento/time_test; load ./datos_entrenamiento/max_time_test.mat; load ./datos_entrenamiento/i_test.mat; load ./datos_entrenamient...
function err = naivePerfusionSSEIntegratoranmarP2X4sense(ton,toff,Ttot,amp,T,I) %#codgen; naive=getNaiveanmarP2X4sense(); V=-60*10^-3; err=errorIntegratoranmarP2X4sense(ton,toff,Ttot,amp,naive,T,I,V); end
classdef ImageCoordDescBMExact % % Update the image using coordinate descent and with the cubic BM function. % % @author: Jeffrey Chan, 2014 % properties m_l1ImageReg = 0; end methods function obj = ImageCoordDescBMExact(varargin) if length(vara...
% Makes stimulus set for the testing/retrieval phase of Swahili exp clear; % Seed this with the subject ID if you want to be able to reproduce rng('shuffle'); answer=inputdlg({'Subject'},'',1,{'A'}); subject = char(answer(1,:)); %The subject the stimulus set is intended for. if ~exist(subject, 'dir') mkdir(subject)...
%FLAT WINDOW FUNCTION Š®‘S”Å clear [ W, n, m, delta, eps, epsd, eps_std, w, shift, I] = Make_para_sodapaper(); C = @(x)cos(2*pi*x/n); [ F_M_n ] = F_M( n ,w ); [ F_M_n_d ] = F_M( n-1 ,w ); [ IF_M_n ] = IF_M( n, w ); [ std_G, std_G_ft, iv] = Make_std_win_func_soda_01( W, n, shift, F_M_n ); [check_result] = check_std...
%% 1-dim finite volume advection-diffusion solver % Jingyu Chen % Feb. 4th, 2017 clc clear %% Main function % simulation setup sim_mode = 1; % sim mode: 1-Pulse, 2-Exponential CFL = 0.8; % CFL# round = 0; while (round < 2) % automatically run the program twice if (round == 0) N = 100; ...
%-----------initialize-------------------------- GMax = 32 ; BMax = 15 ; EDOP=zeros( 1 , runtime ); NDOP=EDOP; VDOP=EDOP; HDOP=EDOP; PDOP=EDOP; GDOP=EDOP; EDOP_G=EDOP; NDOP_G=EDOP; VDOP_G=EDOP; HDOP_G=EDOP; PDOP_G=EDOP; GDOP_G=EDOP; EDOP_B=ED...
clc close all gate = 'Ara'; cross = {'Ara', 'IPTG', 'Rib', 'Tre'}; cross(ismember(cross, gate)) = []; d1 = xlsread('sigResults.xlsx', [gate, 'R1']); d2 = xlsread('sigResults.xlsx', [gate, 'R2']); d3 = xlsread('sigResults.xlsx', [gate, 'R3']); meanMean = mean([d1(:, 2), d2(:, 2), d3(:, 2)], 2); stdevMean = ...
% Convex sum % Input: % 1. mat - Matrix n*m, m vectors in R^n. % 2. flag - flag = 0, then make cvx sum, flag~=0 pick num = flag vector % from matrix % Output: % 1. vec - vector equal to convex sum of m vectors. function [vec] = convex_sum(mat, flag) if(flag == 0) lambda = rand(1, size(mat, 2)); ...