text
stringlengths
8
6.12M
function [lda, Sb, Sw, qda] = smithFigure(dataset); % This function produces the `classic' plot of the Normal-Psychotic % data of C.B. Smith's paper "Some examples of discrimination" % % Syntax: [lda, Sb, Sw, qda] = smithFigure(dataset); % % Inputs: % dataset : string with the name of a dataset to be used, %...
function K = k_mean_cluster(point, k) %K-mean clusturing - which take data as point and produce K cluster mid %point %input - all points and no of cluster (k) %output - mid point of all k cluster reading X = point; m = length(X); k = k; K = zeros(k,size(X,2)) ...
function lrt_make_rtw_hook(hookMethod, modelName, rtwroot, templateMakefile, buildOpts, buildArgs, buildInfo) %#ok<INUSL> % AUTOSAR_MAKE_RTW_HOOK - This is the standard ERT hook file for the RTW build % process (make_rtw). % % This hook file (i.e., file that implements various RTW callbacks) is % called by RTW for syst...
function [input_data, labels] = input_preprocess() clear all; clc; myFolder = 'G:\Probe\Face Rec Workshop\Code\Data set'; filePattern = fullfile(myFolder, '*.jpg'); % Change to whatever pattern you need. theFiles = dir(filePattern); for k = 1 : length(theFiles) baseFileName = theFiles(k).name; fullFileName = fullfi...
%testing script for the rotation handling functionality imageid = 1454; fprintf('-------------------') p=squeeze(pred_new(:,:,:,imageid)); SM = new_pca_model(train_labels); lalala = SM; for i = 0 n = rotate_heatmaps(p,i); img=imrotate(squeeze(eval_img(imageid,:,:)./255), i); ROT = kron(eye(15),rotmat(i)); ...
%% Borrar y almacenar % simulaciones_a_cargar=47:50; % % % c_sensor=1; % % c_phi1=1; % % c_phi2=2; % % c_theta=1; % % i=1; % % c_antenas=1; %puede ser 2 % cantidad_realizaciones=35; % % clusters_fijados=1; % cd resultados % for clusters_fijados=0:5 % for num=simulaciones_a_cargar % num % for e...
% This function returns the alteration frequency for mutations and copy % number data function pathwayAlterations = findGeneAlterationFreq(metabolicPathways,... studyMuts,studyCNA) % This is a table with columns as cancer types and row as metabolic % pathways % get the genes involved in a metabolic pathway and re...
% Calculate the predicted forces using the "validation" method, only for % the Linearized Sigmoid method. This is used to 'make up' for not running % the LinSig model on certain data sets originally. % % This function splits the force and image data into two sets. Use one set % to calibrate the model (the Training D...
load data_c3_2.mat % Plot the original distribution x = -2:0.1:14 y = gaussmf(x,[1 2]) z = gaussmf(x,[1 10]) plot(x,y) hold on plot(x,z) xlabel("Guassian Mixture Model")
clc; clear all; cd('D:\ternus_EEG\Raw data1\ternus-eeg'); load('chanlocs.mat'); load('erp_rmbase.mat'); %load('erp_rmbase2.mat'); load('erptimes.mat'); EM=permute(EM_rmbase,[2 1 3]); GM=permute(GM_rmbase,[2 1 3]); %% plot erp EM_erp=squeeze(mean(EM,3)); figure;plot(times,EM_erp(:,28),'b-') GM_erp=squeez...
function [Y_int Phi_int]=rbfn_integral(Xc,X1,X2,W,k_i,basisfunction) %calculates a line integral between X1 [x y] and X2 for a radial basis %function with center Xc and prescaler k_i %basis function may be 'gaussian' or 'polyharmonicspline' %see rbf_integral for more % Copyright Travis Wiens 2008 % % Thi...
%%%%%%%%% simu 和 mfun 结合,用3个一阶并行反应模拟 beta=50; %%%% Heat rate R=8.314; %%% Universal gas constanet xlow=[10 1 0.1 ]; %%% lower limit xup=[400 30 .9 ]; %%% upper limit x0=[1.2401381456564563e+002, 0.719456218222434e+001, 6.023432453252355e-001 ]; %% Loading data (so that it will only happen 1 time) load Coal_...
% Setup AE_TITLE, IP, port for your DICOM PACS PACSAE='DCM4CHEE'; % PACS AE title PACSIP='172.17.32.50'; % PACS IP number or Host-name PACSPORT='11112'; % PACS port
%-------------------------------------------------------------- % Welcome to Getscriptall %-------------------------------------------------------------- % SIMPLE ADDITION OF INTEGER PROGRAM: %-------------------------------------------------------------- %Addition of one interger number and a character %--------...
% clear all clc %十折 %% load data % load('TI_Features_324p2GAmrmr_.mat') % load('TI_Label_169.mat') % load('Feature_TI_System_521_0628.mat') % load('Label_TI_System_521.mat') load('yesornoforsample_521to455.mat') % load('yesornoforsample_521to181') % load('yesornoforsample_see521to299.mat') % load('yesornoforsample_521t...
%========================================================================= % % Program to compute method of moment estimates of various distributions % %========================================================================= clear all clc RandStream.setDefaultStream( RandStream('mt19937ar','seed',12) ); t = 10; ...
function bestguess=kwwmin(fitinfo) global MAXTIME % user set parameters if exist('MAXTIME')==0, MAXTIME=30; end %pin=(lbound+ubound)/2; %if length(abs(ubound-lbound)<minbndsz)>0, % bdidx=find(abs(ubound-lbound)<minbndsz); % ubound(bdidx)=ubound(bdidx)+minbndsz; % lbound(bdidx)=lbound(bdidx)-minbndsz; %end t...
function [RX, model] = coc_reorder( RX, model, m) % kmeans for each dimension [idx, ~] = kmeans(RX, m, 'Start', 'plus'); coc_idx = cell(m:1); for i=1:m, coc_idx{i} = find(idx == i); end %reordering RX RX = RX(cat(1, coc_idx{:}),:); cluster_sizes = cellfun(@(x)size(x,1), coc_...
function err = naivePerfusionSSEIntegratorP2X4stack(ton,toff,Ttot,amp,T,I) %#codgen; naive=zeros(1,25); naive(1)=1; V=-60*10^-3; err=errorIntegratorP2X4stack(ton,toff,Ttot,amp,naive,T,I,V); end
function [annBlueVal,spotblueval,Vs,Van]= spotDet(filt,cent,ra,spotRt,n,rows) c = spotRt(1); r = spotRt(2); [rr,cc]= meshgrid(1:size(filt,1), 1:size(filt,2)); for k=1:rows rak=ra(k); roOuter=rak*1.5; Rs = (rr - cent(k,2)).^2 + (cc - cent(k,1)).^2 < (rak).^2; Ran = ( (rr - cent(k,2)).^2...
function gof = decoderPerformance(mdl) confusionMatrix = confusionmat(cell2mat(mdl.io.trueY),cell2mat(mdl.io.predY)); chance = 1/length(confusionMatrix); accuracy = nan(1,length(mdl.io.trueY)); for g = 1:length(mdl.io.trueY) confusionMatrix_accuracy = confusionmat(mdl.io.trueY{g},mdl.io.predY{g}); accuracy(g...
function s = merge_fields(s1,s2) % % s = merge_fields(s1,s2) % Merge the fields of two structures. If there are duplicate % fields, the fields in s1 are taken. % % Inputs: % s1, s2 are arbitrary structures e.g., containing metadata or settings. % % Returns: % s is a structure containing all of the f...
function SC = sc_prep(A, In, Out) ndoms = length(In); out = horzcat(Out{:}); Aoo = A(out,out); [Aio, Aoi, L, U, P, Q] = deal( cell(ndoms,1) ); for i = 1 : ndoms inn = In{i}; Aio{i} = A(inn,out); Aoi{i} = A(out,inn); [L{i}, U{i}, P{i}, Q{i}] = lu( A(inn,inn), 'vector' ); end [SC.L, SC.U, SC.P...
%% sample_simulation_file.m % % DESCRIPTION: just an example simulating a GI % % % % % % % % % %% Initialization parameters clear; % Constants c = 299792458; h = 4.135*10^(-15); delta_PMMA = 0.45e-6; beta_PMMA = 0.6828e-10; % Spectral parameters E_central = 25000; BW = 0.00001; N_bands = 3; DE = E_central*BW; Ei = li...
function [ijs,v,ccorr] = templatematch(img, tmpl) %-------------------------------------------------------------------------- % % Copyright (c) 2011 Jeffrey Byrne % $Id: templatematch.m 91 2012-12-12 17:03:07Z jebyrne $ % %-------------------------------------------------------------------------- %% Options (FIXME) op...
clear all; figure; N=256; NFREC=N/2; NCAS=6; scale=5; offset=1; g= load('G22INT.RES'); ReG22=g(:, 2); ImG22=g(:, 3); AbsG22=g(:,4); ReG22NUM=g(:, 5); ImG22NUM=g(:, 6); AbsG22NUM=g(:,7); for j=1:NCAS; fi=NFREC*(j-1)+1; ff=NFREC*j; plot(g(fi:ff,1), ReG22(fi:ff)*scale+offset*j, 'b'); hold on; plo...
function spectralCentroid_criteria = compare_spectralCentroid(target_features,soundset_features) idx_sc_K = find(strcmp(soundset_features.names,'spectralCentroid')); sc_matrix_K = soundset_features.matrix(:,find(soundset_features.positions==idx_sc_K)); sc_vector_T = target_features.spectralCentroid; sc_matrix_T = repm...
function Yn = pkt_hp_filter(Xn,Xn_k,Yn_k,samp_freq) % High Pass Filter EEG data packets with cutoff frequency of 0.1 Hz. This is a 4th order % butterworth filter designed using fdatool. % To verify that this filter is actually working with the EEG data: % 1. Run the Brain Vision Recorder software in Simu...
clear; clc f = @(y,t) (-1/3)*y+sin(t); tmin = 0; tmax = 15; numpts = 1000; IC = 1; [t,y] = MyEuler1D(f,tmin,tmax,numpts,IC); plot(t,y) %% clear clc; alpha = 1; beta = .05; delta = 1; gamma = .01; ICx = 1; ICy = 2; tmin = 0; tmax = 15; numpts = 1000; f = @(x,y,t) alpha * x - beta * x * y; g = ...
function [ profile_length ] = chord_length( y,im ) profile_length = 0; for i = 1:size(im,1) if im(i,y) == 1; profile_length = profile_length +1; end end end
function [A] = podijeli_u_matricu( x,h,L) %Funkcija dijeli ulaznu sekvencu na potreban broj podsekvenci, a iste %dopunjuje sa Nh-1 nula. Zatim se koristeci implementiran algoritam %fft_radix_2 racuna DFT te jedne podsekvence i mnozi sa DFT-om impulsnog %odziva. A onda se dobijena sekvenca koristeci implementiranu funkc...
function leftMask = splitByPlane(pts, n, sn, prn) %Dzieli punkty 'pts' na leżące po lewej części płaszczyzny wyznaczonej %przez 3 punkty (n, sn, prn) i na takie które leżą z jej prawej strony. % wektory wyznaczajace plaszczyzne: lv = n - prn; hv = sn - prn; % wektor prostopadly do plaszczyzny (skierowany w ...
pkg load image function result = atv(img, w, h, M, V, num) result = zeros(w, h, "double"); for i = 1 : num result += imnoise(img, "gaussian", M, V) / num; endfor endfunction img = imread("pratica4.png"); sz = size(img); img = im2double(img); w = sz(1); h = sz(2); figure, imhist(img); noise = imnoise(img, "g...
%Andrew Brown Homework 5 Problem 1 clc clear %More practice functions and fzero. %Projectile motion simulated %Define constants g=9.8; %acceleration due to gravity in m/s^2 theta=89; %launch angle in degrees v=13.5; %initial velocity in m/s %Declare given position functions x = @(t) [v.*t.*cosd(theta)]; %x distance...
function std_feature = normalize_feature(raw_feature, deviation, mea) std_feature = (raw_feature - mea)/deviation; end
function gatewayDisconnect %Disconnect from omero server using Blitz. % %Author Michael Porter %Copyright 2009 University of Dundee. All rights reserved global client; global session; global gateway; global clientAlive; try clientAlive.stop; catch %If the client is no longer alive then there's nothing to clo...
function [ ] = cal_accuracy( handles ) global LMS_net; global RLMS_net; global IF_net; global GD_net; global MGD_net; global BPD_net; global train_status; global init_status; if ~init_status || ~train_status return; end set(handles.create_networks,'Ena...
clc;clear; format long %% 原始数据 Wrr = load('lncRNAsimilarity.txt'); Wdd = load('diseasesimilarity.txt'); interaction = load('known_lncRNA_disease_interaction.txt'); interaction_ori = interaction; [nl,~]=size(Wrr); n=1; %% 数据处理方法 % for gama=1:1:9 gama=1; Wrr1=reSimilarity(Wdd,interaction_ori); % reSimilarity:ln...
function conf = proposal_config(varargin) % conf = proposal_config(varargin) % -------------------------------------------------------- % Faster R-CNN % Copyright (c) 2015, Shaoqing Ren % Licensed under The MIT License [see LICENSE for details] % -------------------------------------------------------- ip = inputP...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% nome_q1a.m %%% Matlab function to detect spikes %%% by Antonio Padilha L. Bo (antonio.plb@lara.unb.br) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function spikeTimes = nome_q1a(time, electro...
%identyfikacja parametrów modelu matematycznego c1=10; x01=33; LB=[0.1 25]'; UB=[200 40]'; ym=poziom_zawor1_poprawiony(1); parametry_optymalne1=lsqnonlin('cel1',[c1 x01]',LB,UB,[],czas_zawor1_poprawiony,poziom_zawor1_poprawiony); [T1,X1]= ode45(@(t,x) rownanie1(t,x,parametry_optymalne1(1)),czas_zawor1_poprawiony,par...
clear all ; close all subs = {'alex','dina','genevieve','jeremie','karl','russell','tegan','sukhman','valerie'} ; for sub=9%:length(subs) cd(['c:/shared/badger_eeg2/',subs{sub}]) ; ls mov = dir('bcgica*rest*set') ; EEG = pop_loadset(mov(1).name) ; EEG = pop_chanedit(EEG,'lookup','C:\eeglab8_0_3_5b\plugins\dipf...
function smoothingKernel = createPaddedGaussianKernel(h, w, d, sigma, K) % CREATEPADDEDGAUSSIANKERNEL create a 3D Gaussian kernel % % smoothingKernel = createPaddedGaussianKernel(h, w, d, sigma, K) create a % gaussian kernel of standard deviation sigma in a 3D volume of size h x w % x d: smoothingKernel. K is a cuto...
function plot_figures param_fname = 'lc18_model_param'; load( strcat(param_fname, '.mat'), 'x' ); % load optimized parameters vstim_dir = './vstim/'; x_orig = x; % make a copy of optimized param param = convX2param(x); fun = @simulateXcontrast; % ---------------------------------------------------------------...
%% A load('A') YInjured=FRMat/60/5; % Is it different than baseline? [p,tbl,stats] = anova1(YInjured); c=multcompare(stats); figure bar(0:5:95,mean(YInjured),'barwidth',1,'facecolor',[1 31 91]/255,'linewidth',1.5) hold on errorbar(0:5:95,mean(YInjured),zeros(1,20),std(YInjured),'k.') K=max([mean(YI...
function [mag,theta] = orientedFilterMagnitude(im, NSCALE) %Computes the boundary magnitude and orientation using a set of oriented filters % One way to combine filter responses is % to compute a boundary score for each filter (simply by filtering with it) % and then use the max and argmax over filter responses % to...
function [z,err]=args2struct(Defaults, Args, generror) %ARGS2STRUCT Parse input parameters into a struct. % ARGS2STRUCT aids parsing of parameters, so that the call of % a function can contain both positional and named parameters % as e.g Handle Graphics calls. % Part of the OptProp toolbox, $Version: 2.1 ...
function h = histogram(data, bins) h = zeros(bins, 1); for i = 1:size(data) h(data(i)+1) = h(data(i)+1) + 1; end end
function d=derivxy(x,y) % First derivative of y with respect to x using 2-point central difference. % T. C. O'Haver, 2011. Corrected 2/4/14 % Example: % x = [1 2 4 7 10 14];y = 2*x;derivxy(x,y) % ans = % 2 2 2 2 2 2 n=length(y); d=zeros(size(y)); d(1)=(y(2)-y(1))./(x(2)-x(1)); d(n)=(y(n)-y(n-1...
function nearest_neighbor(obj, z, params) % number of features num_of_extracted_features= size(z,2); % initialize with zero, if SLAM --> initialize with (-1) obj.association= zeros(num_of_extracted_features, 1); % initialize variables spsi= sin(obj.XX(3)); cpsi= cos(obj.XX(3)); z_estimated= zeros(2,1); % select la...
function [k, TempAmb, Temp0, tStart, tMax] = ProblemConstants % Constants of the problem k = 0.08; TempAmb = 20; Temp0 = 250; tStart = 0; tMax = 30;
function afniCreateAffine(subject,mriVol,histoVol,path) % vol2volWarp(subject,mriVol,histoVol,path) % % This code creates an affine tranform to roughly align the mri volume anatomy of a PM subject to the 3D histological reconstuction % generates a new volume: fullfile(path, [subject '_3dAllin_Qwarp.nii.gz']); % and...
function B = convert_ldr(A, a, b) rad = convert_hdr(A, a); B = hdr_ldr(rad, b); end
function runAll_vot15 visualization = false; gpus = 1; seq={ 'vot15_bag' 'vot15_ball1' 'vot15_ball2' 'vot15_basketball' 'vot15_birds1' 'vot15_birds2' 'vot15_blanket' 'vot15_bmx' 'vot15_bolt1' 'vot15_bolt2' 'vot15_book' 'vot15_butterfly' 'vot15_car1' ...
classdef Tingey_s1505528_GUIEffects < matlab.apps.AppBase % Properties that correspond to app components properties (Access = public) AudioEffectsGUIUIFigure matlab.ui.Figure UIAxes matlab.ui.control.UIAxes PlotthesignalafterapplyingtheeffectPanel matlab.ui.container...
% I have -> botpos, newpos function botpos = move(botpos, pad_inpolygonMapformatX, pad_inpolygonMapformatY) vec_botpos = [botpos(1) - 1 botpos(2) + 1; botpos(1) - 1 botpos(2) - 1; botpos(1) + 1 botpos(2) - 1; botpos(1) + 1 botpos(2) + 1]; inside = inpolygon(vec_botpos(:,1), vec_botpos(:,2), ...
function [best,tr,val_fail] = trackBestNetwork(best,tr,val_fail,net,perf,vperf,epoch) % Copyright 2010-2014 The MathWorks, Inc. validationDataExists = ~isempty(tr.valInd); if validationDataExists [best,tr,val_fail] = trackByValidationPerformance(best,tr,val_fail,net,perf,vperf,epoch); else [best,tr] = trackBy...
% N = length_MSD; Note to self % epsilon = loc_uncert; Note to self % function sigma = myMichaletFun(N, epsilon_val, alpha_val) function MSD_data = myMichaletFun(MSD_data) for i = 1:length(MSD_data) %From the paper, the varience of the mean squared displacement is: N = length(MSD_data(i).MSD); alpha_val = MSD_d...
function x = gpu2nndata(y,Q,N,TS) %GPU2NNDATA Reformats neural data back from GPU. % % Training and simulation of neural networks requires that matrices be % transposed, and do not require but are more efficient when the column % length is padded so that each column is memory aligned. This function % copies data b...
%% --- 1. CLASSICAL AND MODERN SPECTRUM ESTIMATION --- %% %% 1.4 Spectrum of Autoregressive Processes %% % (a) While using the unbiased ACF estimate when finding the AR parameters, % this estimate can be highly erratic for larger lags close to N, where % fewer samples are available to estiamte to estimate the PSD. AC...
% Generate groundtruth detection log for cpp code function log = temp addpath(genpath('C:\zxk\Research\code3.0.0')); % filePath = 'C:\zxk\Research\monkeyData\Camera1_extractedVideos'; filePath = 'C:\zxk\Research\monkeyData\Camera2_labeledVideos'; firstVideoNumber = 100; lastVideoNumber = 100; for videoNumber = firs...
I = imread('C:\Program Files\MATLAB\R2021a\toolbox\images\imdata\kobi.png'); M = double([0.299 0.587 0.114; 0.596 -0.275 -0.321; 0.212 -0.523 0.311]); YIQI = zeros(size(I)); YIQI(1,1,1) = I(1,1,1)*M(1,1)+I(1,1,2)*M(1,2)+I(1,1,3)*M(1,3); YIQI(1,1,2) = I(1,1,1)*M(2,1)+I(1,1,2)*M(2,2)+I(1,1,3)*M(2,3); YIQI(1,1,3) = I...
function fx = InvChebTrans(fk, x) N = size(fk, 1) - 1; T = ChebPoly(N, x); fx = T * fk; end
function y = NeedleAngel(x) slope= ( ( x(2,2) - x(1,2) )/( x(2,1) - x(1,1) ) ); angle = atand(slope); if(angle == 90 || angle == -90) if(isUpar(x)) y = 0; else y = 180; end elseif(angle == 0) if(isAtLeft(x)) y = 270; else y= 90; end elseif (angle > 0...
% (* ::Package:: *) % Area Sources load 'J:\SHARE\OAQPS 2014-2019\Reduced Form Tools Testing (3-40)\Models\AP2\2011_PM_Worksheet_Area_Low_Western_Adj' I = eye (3109,3109); %% NOx NO3 run Area_Reset NOx_Area_Source = 28761.72.*1.35.*NOx_Cal.*(Area_Source {1,1}); p = 1; for n = 1:S; tic disp...
function out=selfdwt(in,J) % 完成J尺度Haar小波变换 % in 是输入信号 % out 是输出的小波系数 %h0,h1是相应的小波和尺度向量 h0=[1/sqrt(2),1/sqrt(2)]; h1=[-1/sqrt(2),1/sqrt(2)]; out=zeros(size(in)); m=size(in);%此处的m为一向量 x=length(in); k=0; l=0; Wl=in; for i=1:J %=================此处对应于高频部分,结果中抽取偶数的点===================== Wh=conv(h1,Wl); for j=1:(leng...
h = 0.025; t = 0:h:6; x = sin((t.*t) - 6 * t + 3) y = (1/3) * sin((t.*t) - 6 * t - pi / 6) D = 4 [~, Q] = size(x); p = zeros(D, Q); %% for i = 1 : D p(i, i : Q) = x(1 : Q - i + 1); end net = newlind(p, y); Y = net(p); display(sqrt(mse(Y - y))); figure; hold on; grid on; plot(t, y, '-b'); plot(t, Y, '-r'); figure;...
% [x,ret] = Iyajima(K,PL,PU,epsilon,solver) % % solve interval DGP SDP formulation with solver 'solver' to % find a realization of the partial interval EDM [PL,PU] % in R^K epsilon is used to go from Gram matrix to realization. % SDP model by Yajima % x = the realization % ret: a return data structure wit...
%% 综合应用:粒子群算法PSO: 求解函数y = 21.5+x(1)*sin(4*pi*x(1))+x(2)*sin(20*pi*x(2))在x1属于[-3,12.1],x2属于[4.1,5.8]内的最大值(动画演示) clear; clc % 目标函数参考的最优值:38.8503 %% 绘制函数的图形 % x1 = -3:0.01:12.1; % x2 = 4.1:0.01:5.8; % [x1,x2] = meshgrid(x1,x2); % y = 21.5 + x1.*sin(4*pi*x1) + x2.*sin(20*pi*x2); % mesh(x1,x2,y) % xlabel('x1...
classdef C11GlucoseKinetics < mlkinetics.AbstractC11GlucoseKinetics %% C11GLUCOSEKINETICS % $Revision$ % was created 29-Jun-2017 21:03:07 by jjlee, % last modified $LastChangedDate$ and placed into repository /Users/jjlee/Local/src/mlcvl/mlarbelaez/src/+mlarbelaez. %% It was developed on Matlab 9.2.0.5380...
function phi = U(varargin) assert(nargin == 2, 'U takes tow variables'); if strcmp(varargin{1}.type, 'inner') || strcmp(varargin{1}.type, 'ap') assert(strcmp(varargin{1}.type, 'inner') ||... strcmp(varargin{2}.type, 'ap'), ... 'Inner and outer logic formulas cannot be mixed'); phi =...
% shape_analysis_7b.m % the curve representing shape transition % r_a/r_0 vs h/r_0 %cd 'E:\Ben\EVOLVER\chromaffin endocytosis\harbe' results_folder = 'D:\Ben\EVOLVER\chromaffin endocytosis\results august (mixes ra and h)' ; cd(results_folder) ; folders = dir('*'); %% dirFlags = [folders.isdir]; folders ...
function sim = sim(D) %sim Compute the similarity matrix from a distance matrix sim = exp(-D); end
function A4_Combine_Data %Step 2, after checking that data is okay, combine all data into %three matrices containing all responses, SS10, SS30 and SS50. %% RG, RG2, MW,MW2, MW3, HH, HH2, HH3, HH4, RO, RO2, RO3, LJ, LJ2, LJ3, JR clear all close all subject = 'MW4'; switch subject case 'RG' ...
function removepr(PR) %************************************************* %DATE: 13/8/2007 (created); 13/8/2007 (modified) %FUNCTION: %INPUTS: %OUTPUTS: %muwn.gu@gmail.com %************************************************* global layerMatrix; layerMatrix (find(layerMatrix == 9)) = 0;
clear all; P=[1 -1.1]; T=[0.5 1]; [R,Q]=size(P); [S,Q]=size(T); lr=0.4*maxlinlr(P); % 最佳学习速率 net=newlin(minmax(P),S,[0],lr); %创建线性网络 net.inputWeights{1,1}.initFcn='rands'; %初始化权值 net.biases{1}.initFcn='rands'; %初始化偏差 net=init(net); %把初始化的权值和偏差函数赋给网络 disp('显示初始化...
% ir = imread("C:/data/FLIR_ADAS_1_3/train/thermal_8_bit/FLIR_04274.jpeg"); % rgb = imread("C:/data/FLIR_ADAS_1_3/train/RGB/FLIR_04274.jpg"); % % [mp, fp] = cpselect(rgb, ir, 'Wait', true); % % t = fitgeotrans(mp, fp, 'projective'); % Rfixed = imref2d(size(ir)); % registered = imwarp(rgb, t, 'OutputView', Rfixed); % ...
function [L,U] = forwElimLU_func(A) %FORWELIMLU_FUNC LU factorisation % [L,U] = FORWELIMLU_FUNC(A) % Compute the LU factorisation of a given A. The input A is any square matrix, % the output U is the final echelon form (an upper triangular matrix) as obtained % by forward elimination(without row exchanges),L ...
% CHAPTER 6 %% 6.1 plot x=linspace(0, 4*pi, 200); y=cos(x); plot(x,y,'LineWidth', 2.5,'Color',[0,0,0]); axis([0 4*pi -1 1]); %% 6.1a plot 2 plot(y,'LineWidth', 2.5,'Color',[0,0,0]); %% 6.1.1 t=linspace(0, 4*pi, 200); y=cos(t); plot(t,y,'LineWidth', 2.5,'Color',[0,0,0]); axis([0 4*pi -1 1]) xlabel('time ...
function min = min_dist(point, point_set) %MIN_DIST Summary of this function goes here % Detailed explanation goes here portion = 100; min = bitmax; for j = 1 : idivide(int32(size(point_set, 1)), portion, 'floor') current = point_set(j*portion,:); dist = 0; for k = 1:3 dis...
function mm = mean_squares(nn) Matrix = (1:nn); M_sqr = Matrix.*Matrix; mm = mean(M_sqr);
function projection_image=simRodCellShell(radius, lengthVar, width,realCenter, orientation,psf,sizeImage) Center=[sizeImage(2)/2,sizeImage(1)/2]; projection_imageCylinder=simCylinderShell(radius, lengthVar,width, Center, psf,sizeImage); Center1=Center; Center1(2)=Center(2)-lengthVar; projection_imageSphere1=simHalfSph...
%% Problem_1 % Define demand function demand = @(v,p) exp([v-p;0])/sum(exp([v-p;0])); % Compute demand v = [2;2]; p = [1;1]; d = demand(v,p); D_A = d(1) % Demand for product A D_B = d(2) % Demand for product B D_0 = d(3) % Demand for outside option %% Problem_2 v = [2;2]; % Initial guess of p = [p_A;p_B] p_ini =...
function [out1, out2] = residual(Pressure,Pressure_old, order, cnt, kx, ky, h, dx, dy, poro) [row,col] = size(order); N = zeros(row, col); S = zeros(row, col); W = zeros(row, col); E = zeros(row, col); C = zeros(row,col); Q = zeros(row,col); Z = gasZ(Pressure, order); ...
function p = predict(Theta1, Theta2, X) %PREDICT Predict the label of an input given a trained neural network % p = PREDICT(Theta1, Theta2, X) outputs the predicted label of X given the % trained weights of a neural network (Theta1, Theta2) % Useful values m = size(X, 1); num_labels = size(Theta2, 1); % You need ...
% Function {out parameter}={function name}(in parameter} % % input parameter definition % im = input image % sizeofkernel = Size of Kernel % % output parameter definition % output = output image % function [output]=BoxFilter(im, sizeofkernel) % kernel generation part kernel = ones(sizeofkernel); [ksizey,k...
function majorityValue = MAJORITY_VALUE(binary_targets) % majorityValue = MAJORITY_VALUE(binary_targets) % Function that returns the mode of the targets. % INPUT : binary_targets - vector containing the targets of the train data. % % OUTPUT : majorityValue - the mean of the binary_targets. ...
function x = removeZeroModes(x, componentIndex) %REMOVEZEROMODES Orthogonalize x to Laplacian zero modes. % componentIndex contains a graph's components.In particular, if % componentIndex is, this method is equivalent to x = x - mean(x). numComponents = numel(componentIndex); if (isempty(componentIndex) || n...
function [ x, f ] = kde(data) % function [ x, f ] = kde(data) % Calculate the kernel density estimate for data set data, returning two % row vectors with 1001 elements % Make sure data is a column vector data = reshape(data, [ length(data), 1 ]); dataSTD = std(data); dataMin = min(data); dataMax = max(data); % Make...
function X = l12_min(A,B,b,bc,C,D) % L12_MIN Solve the "L12" minimization problem using second-order cone % programming. L12 is the L2,1 norm applied to the transpose of a matrix % (i.e., L12 computes the sum of row-wise vector norms). % % X = l12_min(A,B,b,bc,C,D) % % min ‖ (A X - B)ᵀ ‖_2,1 % X % ...
% THIS SCRIPT CALCULATES THE QUARTERNION GIVEN EULER ANGLES function quat = EulToQuat(angle) z = angle(1); y = angle(2); x = angle(3); quat = [cos(x/2)*cos(y/2)*cos(z/2)+sin(x/2)*sin(y/2)*sin(z/2); sin(x/2)*cos(y/2)*cos(z/2)-cos(x/2)*sin(y/2)*sin(z/2); cos(x/2)*sin(y/2)*cos(z/2)+...
function [len, validity, return_code] = READ_SAMPLING_MESSAGE(sampling_port_id, msg_addr) sample = get_sample_by_id(sampling_port_id); if sample == [] return_code = INVALID_PARAM; return; end if sample.length == 0 len = 0; validity = INVALID; return_code = NO_ACT...
function mapping = nearestDeepFashion(jsonFile) fileID = fopen(jsonFile,'r'); params = fscanf(fileID,'%s'); data=JSON.parse(params) % -- settings start here --- % set 1 to use gpu, and 0 to use cpu use_gpu = 1; % top K returned images top_k = data.TOP_K; feat_len = data.FEATURE_LEN; % % set result folder result_fol...
addpath('../general_functions') addpath('../../Chapter 1') clear variables %% Figure 5.2a : LL(2) with various \lambda values. d_iter=2:5; lam_range = linspace(0.01,1-10^(-8), 400); w_range = linspace(0,60,10^5); tol=10^(-6); EW_quot1 = zeros(length(d_iter), length(lam_range)); EW_quot2 = zeros(length(d_iter), length(...
function writeexp4(expfile,datdir,theta,phi,id,int,ledon,sndon,dummy,nrdtrials) % Save known trial-configurations in exp-file % %WRITEEXP WRITEEXP(FNAME,DATDIR,THETA,PHI,ID,INT,LEDON,SNDON) % % WRITEEXP(FNAME,THETA,PHI,ID,INT,LEDON,SNDON) % % Write exp-file with file-name FNAME. % % % See also GENEXPERIMENT ...
clear all if exist('ev3ShellHandle') clear ev3ShellHandle end %Square Parameter l = 50; % in mm %Circle Parameter r = l/2; % in mm centercircle = [25 25]; %in mm from 0,0 %Traingle Parameter init = [0 0]; mid = [25 50]; final = [50 0]; % Axis as defined in the project %y | ...
% virtuoso_importVCSV_AC % imports AC analysis data that is saved in a .vcsv file from Cadence Virtuoso % [time, voltage, signalNames, units] = virtuoso_importVCSV_TRANS(folder, filename) % % Inputs: % folder - The folder in which the data file is saved % filename - name of the .vcsv file to be importe...
function plotcontrol( title, s, T, data, labels, legendlabels ) if nargin < 6 legendlabels = labels; end Tsample = T( 1:s.sampleratio:(s.samplecohtimes*s.cohsteps) ); data = data( 1:s.sampleratio:(s.samplecohtimes*s.cohsteps), : ); fig = figure(); set( fig, 'Name', title ); clf; ...
% MAximize over the Cholesky decomposition, not the components of sigma! function loglike = likeliMC(gamma,mu,muu,var_mu,var_u,var_muu) data = load('C:\Users\padag\Documents\MATLAB\hw5.mat'); X = data.data.X; Y = data.data.Y; Z = data.data.Z; N = data.data.N; T = data.data.T; ...
function [P,Z] = eq_typeIII(B) % Function to compute equilibrium phytoplankton and zooplankton % concentrations for model using type III response in Freilich et al (in % review) Biogeosciences % Input: % B: parameters for biological model N_max = 30; P = zeros(1,365); Z = zeros(1,365); for year_day = 1:365 x0 = [...