text
stringlengths
8
6.12M
classdef simulation < handle % SIMULATION - A class to store an OpenSim modeling simulation. % % % Created by Megan Schroeder % Last Modified 2014-03-30 %% Properties % Properties for the simulation class properties (SetAccess = private) S...
%{ ret2p.LocalGlobalChirp (imported) # receptive field using dense noise -> ret2p.Trace --- mean_diff : longblob # difference in means, z-scored mod_idx : float # modulation index mod_idx_on : float # modulation index mod_idx_off : float # modulation index mod_idx_f : ...
function [M, Mx, My] = diffusionTerm2D(D) % This function uses the central difference scheme to discretize a 2D % diffusion term in the form \grad . (D \grad \phi) where u is a face vactor % It also returns the x and y parts of the matrix of coefficient. % % SYNOPSIS: % % % PARAMETERS: % % % RETURNS: % % % EXAMPLE: % %...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Test code for Fitzhugh-Nagumo equations %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Last modified 12 August 2013 % add paths to required functions addpath('../../fdaM') addpath('fhn') addpath('SSE') addpath('id') % set up objects required for analysis %...
global Lref iter Lref = 8; iter = 0; hold off x = linspace(-4,4,10)'; xcold = (x(2:end)+x(1:end-1))/2; for i = 1:10 k = -xcold.^2+17; x = springsystem(k); xc = (x(2:end)+x(1:end-1))/2; max(xc-xcold) xcold = xc; plot(xc,k,'o-') hold on end % E = sum(1/2*(x(2:end)-x(1:end-1).^2)) % ktest = reversespring...
%Practical 5 % Question 1 % approach 1 x = -4:4; f = -3*x.^4 + 10*x.^2 - 3; figure; plot(f) % approach 2 figure; fplot(@(x) -3*x.^4 + 10*x.^2 - 3, [-4,4]) % Question 2 %Question 3 L = 16; a = 6; b = a; c = L - (a+b); w1 = 400; w2 = 200; x = 0:0.5:L; RA = (w1*a*(2*L-a)+w2*b^2)/(2*L); RB = (...
kpks = zeros(1,SizeofCal); %fac(n+1) = factorial(n) fac(1)=1; fac(2)=1; for fa=3:1:Np+1; fac(fa) = fac(fa-1) * (fa-1); %fac(fa) = sqrt(2*pi*(fa-1)) * ((fa-1)/exp(1))^(fa-1); end hj = (t-r-u).*Np; %(max(0 , Np.*(t-r-jj-1) - u*Np*((1-(1/(u*Np)))^((jj+1)*Np)) ) ); pj = ( (1-(1/(u*Np))).^hj ); for k=1:1:Np-1;...
function [ output ] = fun_clus_withRW( kact_synI, bzf, kact_RW, bdpn1) %% Variables: % kact_SynI = basal methylation rate of SynI % bzf = ZF specificity multiplier % kact_RW = basal methylation rate of SynRW % bzf = DpnI specificity multiplier % % Test Variables % kact_synI = 5*10^-4; % bzf = 10; % kact_RW = 5*10^-4....
function [xf,stop] = impact_check(x) global N for k = 1:1:N state = [(x(1:5,k));x(6:10,k)]; next_state = [(x(1:5, k+1));x(6:10,k+1)]; [xf,flag] = impact(next_state,state); if flag == true stop = flag; break; else stop = fal...
clear; load('e_density_two_pass_2602.mat'); %load('e1_two_pass_2102_fai.5_mem.mat'); %load('e2_two_pass_2102_fai.5_mem.mat'); f_f=.1:.3:.9; f_d=.1:.3:.9;%:.3:.8; area=0.1:.1:.4; m1=0.1:.2:.9; fai=0.5; parameter_initialization2; o_p_power=van_coe*(c_d0-c_f0); max_deltaP=2*o_p_power; delta_p=0:1:max_deltaP; for a=1:leng...
%******************************************************************************* %* Program: init_RJ4b.m %* Description: Inititialization file for problem 4b [1]. %* Author: Andrew Kercher %* References: %* [1] Ryu, D. and Jones, T. W., "Numerical Magnetohydrodynamics in %* Astrophysics: Algorith...
function [theta_new, obj_new, obj] = optimizeThetaLS(Z, trainLabelsL, theta, set, para) % --------------------------------------------------------------------- % Optimization of the multiview combination coefficients THETA with the least square loss % --------------------------------------------------------------------...
function [ xPos, yPos ] = VlinkPositionsPerLimit( ... outsideMeasurements, VlinkLimit) %VLINKPOSITIONS Summary of this function goes here % Detailed explanation goes here % was sind die kooridnaten jeder oberen linken ecke der componenten %last position of solution vector x % is the summed sized of the larg...
function [phat,band]=ebbsdensity(x,ha,hb,p,order,span,M1,J1,J2,nterms,xgrid, ... ridgecoef) ; % % Estimate a probability density with local polynomials and EBBS bandwidths % % Last edited: 11/22/95 % % % Estimates the density on xgrid % % x = sample (dim = n) % % ha, hb = bandwidth range ...
clear; type compact; %initialization a=[12000 15000 18000 24000 35000 50000 70000]; b=[3000 2500 1500 1000 400 100 25]; %average salary level avl=mean(a); disp(avl); %higher hi= sum((a>avl).*b); disp(hi); %lower lo= sum((a<avl).*b); disp(lo); %average salary av=sum(a.*b)./sum(b); disp(av);
%cd('c:/Vision/Raw Files') ; ls cd('c:/shared/denoising_MR') ; clear all ; close all ; EEGnoise = pop_loadbv('.','Russell_test_2015-08-05_EEGnoEPI.vhdr') ; EEGnoise = pop_chanedit(EEGnoise,'lookup','C:\eeglab10_0_0_0b\plugins\dipfit2.2\standard_BESA\standard-10-5-cap385.elp') ; eeg2 = EEGnoise ; eeg2 = pop_res...
function varargout = doc_rootfinder(varargin) %DOC_ROOTFINDER Get the documentation string for a plugin. % % char = DOC_ROOTFINDER(char name) % % % % [varargout{1:nargout}] = casadiMEX(823, varargin{:}); end
%% settings = MatdbSettingsStore; settings.pathListCache = {'~/data/testMatdb/cache'}; settings.pathListAnalysis = {'~/data/testMatdb/analysis'}; settings.permissionsAnalysisFiles = 'uga+rX'; %clear %clear classes str = RandStream('mt19937ar','Seed',1); RandStream.setGlobalStream(str); %% Build tables if ~exist('cr...
function u = U2u(U, v) %U2U Summary of this function goes here % Detailed explanation goes here u = sqrt(U^2 - v^2); end
classdef Model < AbstractModel %Network.MODEL describes a model living on a network. properties (SetAccess = immutable) network % here lives the model end methods function obj = Model( network, type, vars ) obj@AbstractModel( type, vars ); assert( isa(network,'Network') ); ...
function [ Proximity2D, Proximity3D ] ... = compute2D3DProximity( image3D ) %computeStreamlines2D3DProximity extracts proximity to the nearest solid % % Input Arguments % - image3D : a (nx*ny*nz) uint8 matrix, 3-D binary image of % pore space (0 = pore, 1 = grain) % % Output Arg...
function [ P, P1, Pt1, Np ] = cpd_P( X, TY, sigma2, w) %CPD_P Computes the probability matrix for the CPD algorithm % % P = cpd_P(x, Ty, sigma2, w) computes the CPD probability matrix % % Inputs: % X N x D matrix of the data points % TY M x D matrix of transformed Gaussian centres % sigma2 Standard dev...
function [Lp_dB,Lp] = free_path_loss(f,range) %[Lp_dB,Lp] = free_path_loss(f,range) %Lp s the free path loss the signal experience %Lp_dB is given in dB %f is the frequency in Hz %range is the range in km lambda = wavelength(f); Lp = (lambda/4/pi/(range*1000))^2; Lp_dB = dec2dB(Lp); end
function HIV_REF=HIVrefLoader(FILENAME,SubInput,SkipBads) % HIVrefLoader % HIVrefLoader reads a FASTA formatted file which has the complete % HIV genomic region followed by the the NT sequence of each protien % region. This produces and HIV_REF which is compatible with all of % the Gener...
function [ExtrTotal] = Reduce(datosfinales) ExtrTotal = []; diary('Reducir.txt'); diary on max = length(datosfinales); ExtrTotal = []; tam = 0; sirve = 0; for i = 1 : max descarte = 0; disp(strcat('Revisando Intervalo: ',num2str(i))); % [valores] = ObtenerInfo(datosfinales{i,:}) % Ex...
clear %-------------------------------------------------------------------------- % fine grid size, coarse grid size, dim of coarse grid, num of coarse grid d=2; N=2^6; hg=1/(N+1); %size N, total N^2 points sizeH=2^2; H=sizeH*hg; dimH=sizeH^d; num=N^d/dimH; fprintf('d=%.0f, grid points %.0f^2, loc-dom size %.0f...
%GRIDSEARCH Function to do grid search % % GRIDSEARCH_KNN(A, S, E, C, P, I, K) % % % INPUT % A Training data set. % S Independent test data set. % E Evaluation technique. % C Classifer. % P List of parameter to change (e.g 1:5 or 5:5:50). % I Number of iterations to train bp...
function put_plot_obj_at_bottom(h) % put_plot_obj_at_bottom(int* plot_handle) % % put the plot obj. (handle) @ bottom (as if it was plotted first). useful % if you want to to move a patch or fill plot which is plotted later to be % _below_ s.t. it does NOT obcure other plots hall = get(gca, 'children'); Nh = length(...
function [ sign ] = separate( beta, tX, tY ) %SEPARATE Summary of this function goes here % Detailed explanation goes here PCA = pca(tX); sign = (tX*PCA(:,1:2))*(PCA(:,1:2)'*beta) - tY > 0; end
function evaluate(X, y, theta) figure; cumulative_plot(X, y, @(X) neural_network_tester(X, theta), 5); title('Neural Network Evaluation'); xlabel('Guess Number'); ylabel('Cumulative Percentage Correct'); axis([1 5 0 100]); figure; cumulative_plot(X, y, @guesser, 5); title('Random Gu...
%DEMOSPLITMESH Demonstration script for function splitMesh % % output = demoSplitMesh(input) % % Example % demoSplitMesh % % See also % % ------ % Author: oqilipo % Created: 2017-09-20, using Matlab 9.1.0.441655 (R2016b) % Copyright 2017 %% Quad mesh [v1, f1] = boxToMesh([1 0 -1 0 -1 0]); [v2, f2] = boxToM...
clear; type compact; %(a) % c = input('please input Celsius temperature\n'); % number of Celsius temperature % f = ((c*9)/5)+32; % disp(['The Fahrenheit temperature is:',num2str(f)]); %(b) disp('Celsius Fahrenheit'); for c = 20:1:30 %list number of Celsius temperature f = ((c*9)/5)+32; ...
% make final datafile for scaling results. clear; close all; format compact addpath /Users/dkane/Documents/RESEARCH/SAM/picking addpath /Users/dkane/Documents/RESEARCH/codes wid_all = fopen('SCALINGRESULTS/allscalingresults_Oct2013.dat','a'); wid_best = fopen('SCALINGRESULTS/finalscalingresults_Oct2013.dat','a'); ...
clc; clear; matrix = []; for delta = 0:9%构建训练区样本的矩阵,幅图像 label_path = strcat('D:\GIT\handwitten_recognition\train\',int2str(delta),'\'); disp(length(dir([label_path '*.png']))); for i = 1:length(dir([label_path '*.png'])) im = imread(strcat(label_path,'\',int2str(delta),'_',int2str(i-1),'.png')); %...
function [finalImg, Translations] = create_panorama(dir) images = load_images(dir); NUM_IMAGES = size(images, 4); % ============================================================================ % SIFT, RANSAC and extract translations for i=1:NUM_IMAGES-1 disp(sprintf('============================...
function rechi=kkrebook2(omega,imchi,alpha) %The program inputs are the vector of the frequency %(or energy) components, the vector of the imaginary %part of the susceptibility under examination, and %the value of the moment considered. %The two vectors must have the same length %and the frequency vector omega ...
clear all; close all; clc load medium_100_10k.mat; k=10; [idx , C, sumd, D] = kmeans(wordembeddings,k); tenClosestWordsIndexes = minimums(D,10); charVocab = char(vocab); closestWords = cellstr(charVocab(tenClosestWordsIndexes,:)); closestWords = reshape(closestWords,10,10); %% clear all; close all; clc load medium_1...
%% A Testbench for ALM % Frequency is proportional to the number of peaks relFreqConst = 2*pi*2.5; amp = 2.2; phase = -[0; 0.54; 2.07]; numSources = 3; height = 3; % All point sources are aligned at [x_i,y_i,z] xcoords = [2.4112 0.2064 1.6787]; ycoords = [0.3957 0.3927 ...
function y = NotchFilter(x, r) % function y = NotchFilter(x,r) % % Inputs: x - N x 1 complex vector which contains a wideband signal % contaminated by narrowband interference. % r - pole radius. This should be close to 1. The closer to 1 the % more narrow and deeper the notch. Please see data sheet f...
function varargout = nlpsol_default_in(varargin) %NLPSOL_DEFAULT_IN Default input for an NLP solver. % % [double] = NLPSOL_DEFAULT_IN() % double = NLPSOL_DEFAULT_IN(int ind) % % % % [varargout{1:nargout}] = casadiMEX(806, varargin{:}); end
% Show MySQL all connections and prompt to kill a connection. % dj.kill() lists all connections and prompts the user to enter an id to % kill. % % dj.kill(restriction) lists all connections satisfying the specified % restriction. Restrictions are specified as strings and can involve any % of the attributes...
%% Loading data files load('mfiles1/data3.mat'); [B,FitInfo] = lasso(X,Y); lassoPlot(B,FitInfo,'PlotType','Lambda','XScale','log'); hold on hline = refline(0, 2.9388) hline.LineStyle = '--'; hline2 = refline(0, 0.0648) hline2.LineStyle = '--'; hline2.Color = 'g'; hline3 = refline(0, 1.4252) hline3.LineStyle = '--'; hl...
% time_stamp_end = 1231 % find(Ekin_outputG(:,1)<60*1e3) % % P1=1+32; P2=4+32; % vperp_sq_outputG=vDsq_outputG; % Bfield_part_outputG=interp2(scale_X,scale_Z,Btot_XZ_map',Xpos_outputG,Zpos_outputG,'*linear'); mm_outputG=Eperp_outputG./Bfield_outputG; lambda_outputG=Bavg*mm_outputG./Ekin_outputG; % psi_value_output...
jjk=55; if jjk<10 g3=['snapshot_00' num2str(jjk) '.hdf5']; elseif jjk<100 g3=['snapshot_0' num2str(jjk) '.hdf5']; else g3=['snapshot_' num2str(jjk) '.hdf5']; end id_mid =double( h5read(g3,'/PartType0/ParticleIDs/')); C3_mid= double(h5read(g3,'/PartType0/Coordinates/...
%% Input lena = im2double(imread('lena.jpg')); cat = im2double(rgb2gray(imread('cat.jpg'))); %% Constants sigma = 3; fsize = 20; hthres = 0.15; lthres = 0; %% 1D filters x = linspace(-fsize / 2, fsize / 2, fsize); gx = exp(-x .^ 2 / (2 * sigma ^ 2)); gy = gx'; dgx = -x .* exp(-x .^ 2 / (2 * sigma ^ 2)); dgy = dgx'; ...
clear; % close all; addpath('~/yossi_local/visualRFNNMatlab/postprocessing_code/'); %set the seed to a reproducable number rng(142); % Fonts FontName = 'Times'; FSsm = 7; % small font size FSmed = 12; % medium font size FSlrg = 18; % medium font size % Line widths LWthin = 1; % thin lines % Colors col1 = [0,0,1]; %Cr...
% This function maps a bit sequence to a corresponding array of complex modulation % signs. % % The arrangement of elements inside the constellation array will % determine the encoding of the bit sequence. % % For example: % % The first element of the constellation array with an index of 1 correspond to either a bit ...
%% 第十二章 对象识别 %% 例12.1 gscale dftcorr 使用相关来匹配图像 clc clear f = imread('..\Pictures\images_ch12\Fig1201(a)(Hurricane Andrew).tif'); imshowMy(f) title('原始图像') w = imread('..\Pictures\images_ch12\Fig1201(b)(hurricane_mask).tif'); imshowMy(w) title('模板图像') g = dftcorr(f,w); gs = gscale(g); imshowMy(gs) [I, J] = find(g ==...
% myobj = Close(myobj) % % Closes the network connection to the StimulateOpenGL II % process. Useful only to cleanup resources when you are % done with a connection to StimulateOpenGL II. % Copyright (c) 2012 Howard Hughes Medical Institute. % All rights reserved. % U...
function Ja = Ja_calc(q) %% This function calcuates the robots inertial mass. % Input: % Orientation and extention of robot jonts. % % (4.89) Page 141 in Spong %% Parameters % Global variables in MATLAB if preferred (remove comments in that case) % global m1 m2 m3; % Masses % global l1 l2 l3; ...
clear all; close all; clc; %boundary im= imread('lincoln.tif'); imshow(im,[]); SE=strel('square',3); bound=im-imeroded(im,SE); figure; imshow(bound,[]);
load('output/results.mat'); numMethods = length(methodNames); columnOrdering = '| c || c | c || c | c || c | c || c | c |'; datasetHeader = ''; measurementHeader = 'Method Name'; %CAL500 datasetHeader = [datasetHeader ' & \multicolumn{2}{|c||}{CAL500}']; measurementHeader = [measurementHeader ' & Macro-FMeasure & Ma...
function export_region_echoes_to_xyz(layer_obj,active_reg,varargin) [path_tmp,~,~]=fileparts(layer_obj.Filename{1}); layers_Str=list_layers(layer_obj,'nb_char',80); output_f_def=fullfile(path_tmp,[layers_Str{1} '_regions' '.xlsx']); p = inputParser; addRequired(p,'layer_obj',@(x) isa(x,'layer_cl')); addRequired(p,'ac...
function cyclev(velocity) if nargin<1 velocity=[7E3 0 0]; end fid=fopen('pictetra.dat'); out=[]; line=1; while(line==1) A=fgetl(fid); if(strncmp(A,' nipop=',7)) out=[out ' nipop=1' char(10)]; else out=[out A char(10)]; end if(strncmp(A,'$begin plasmaparameters',23)); line=0; break; end end ou...
function result = f_importCSV(fname,labels) % - import numeric data from a comma-separated-values (*.csv) file % % USAGE: result = f_importCSV('fname',labels); % % fname = name of *.csv file to import % labels = 1: data file only includes column labels (default = 1) % 2: data file includes co...
% Standard GUIDE code function varargout = modelWindow(varargin) % MODELWINDOW MATLAB code for modelWindow.fig % MODELWINDOW, by itself, creates a new MODELWINDOW or raises the existing % singleton*. % % H = MODELWINDOW returns the handle to a new MODELWINDOW or the handle to % ...
function r_gabor(P, scr, t, stim, varargin) if length(varargin) == 1 dest = varargin{1}; end %%%Create and and display gabor patch%%% % NOTE THAT THIS DOESN'T RANDOMIZE PHASE. WTA ort = stim.ort + 90; % this is to try to make things more similar after adding ellipse cur_sigma = stim.cur_sigma; %phase = stim.phase;...
clear all, close all rew = @(x) .5*exp(- (x - 2) * 1 * (x -2)) + exp(- x * 4 * x) ; addpath('../gp') addpath('..') addpath('~/svnprojects/ClassSystem/Helpers/') addpath('../DERIVESTsuite/') addpath('../teach-grad-hess/') x = -2:.1:5; for i=1:length(x) r(i) = rew(x(i)); end xtest = rand(1, 40)*7 -2; for i = 1:leng...
function [ rule ] = EstimatePointDebtRule(FL, init) % **************************************************************** % ESTIMATE POINT DEBT RULE % **************************************************************** % Code for the nonlinear model described in the Appendix B in the % "Sovereign Default...
clear close all A=double(imread('couloir.tif')); figure, imshow(uint8(A),gray(256)) [h,w]= size(A); If=fftshift(log10(abs(fft2(A)))); fx=linspace(-0.5,0.5-1/w,w); fy=linspace(-0.5,0.5-1/h,h); figure, imagesc(fx,fy,If) H1=ones(3)/9; H2=ones(5)/25; sigma = 1.5; [X,Y]= meshgrid(-5:5); H3 = exp(-(X.^2+Y.^2)/(2*sigma^2))/(2...
sca; close all; clearvars; PsychDefaultSetup(2); screens = Screen('Screens'); screenNumber = max(screens); white = WhiteIndex(screenNumber); black = BlackIndex(screenNumber); [window, windowRect] = PsychImaging('OpenWindow', screenNumber, white); [screenXpixels, screenYpixels] = Screen('WindowSize', window); Scree...
function [ Out_data ] = ShiftRows( Input_data ) Out_data(1,1:32) = Input_data(1,1:32); Out_data(2,1:32) = [Input_data(2,9:16) Input_data(2,17:24) Input_data(2,25:32) Input_data(2,1:8)]; Out_data(3,1:32) = [Input_data(3,17:24) Input_data(3,25:32) Input_data(3,1:8) Input_data(3,9:16)]; Out_data(4,1:32) = [Input_data(4,2...
% Class for controlling actual robot. Contains callibration routines but % the constants hardcoded should be approximate. A new object closes all % previous conections, which means only the most recent object will work % (essentially singleton). % % move(cm) and turn(radians) work but curve(cm, radians, right) is a wor...
% Behavioral Reversal Learning Task written by Amanda Buch % Modified from shopping learning task written by Madeleine Sharp, MD % in the lab of Daphna Shohamy, PhD at Columbia University % Last Updated December 17, 2015 %MS changes made/questions (and see below): %1) nTrials/2 --> nTrials; 2) %2)multiple reversals? ...
clear all; [p1,t1]=LFPB_ViaPoint([0,2,2],[0,1,2],10,0.001); [p2,t2]=LFPB_ViaPoint([0,2,2],[0,1,2],10,0.001); subplot(3,3,4); plot(p1,p2,'-b');grid on;title('x-y'); axis([-5,5,-5,5]); subplot(3,3,2); plot(t1,p1,'-b');grid on;title('x'); subplot(3,3,3); plot(t2,p2,'-b');grid on;title('y'); subplot(3,3,5); p1=diff(p1);p2...
clear all; clc; hold on; x=linspace(-50,50,5); y=x; [Xr,Yr]=meshgrid(x,y); surf(Xr,Yr,0*Xr); [X,Y,Z]=sphere(4); surf(X,Y,Z+1); camx=0; camy=60; Xs=X+20; Ys=Y+20; Zs=Z; PlayerColor=[0 1 0]; %====================Definiranje na objekti==================== global generatedObjects; %broj na generirani objecti global numberO...
%% Giles: Automated fracture tracing script % Fracture tracing script based on contrast difference, currently only % tested on SEM BSE images. To use: run script. Change parameters according % to results. Details on the parameters are found in the pdf manual. The % script requires the image processing toolbox. % % Th...
clear all; close all; M=csvread('data_Accuracy_Diff_Sub_Diff_Ts.csv'); M=M.*100; X=[1:16]; y1 = M(1,:)'; y2 = M(2,:)'; y3 = M(3,:)'; y4 = M(4,:)'; y5 = M(5,:)'; plot(X,y1,'-b',X,y2,'-r',X,y3,'-b',X,y4,'-c',X,y5,'-m'); legend('sub1','sub2','sub3','sub4','sub5','location','northwest'); %xlabel('Time...
% 2017 Fall Numerical Optimization Homework #6 % 2017. 11. 08 % 20161216 HAN SANGJUN clc; clear; close all; max_iter = 5000; % when reach to end of loop, evoke error epsilon = 0.001; % for terminating condition %% Problem 2 - find minima f(x, y) = (1.5 - x + x*y)^2 + (2.25 - x + x*y^2)^2 + (2.625 - x...
function [LLi, E_X_posterior, COV_X_posterior] = velime_estep(C, G, estParams, const) % [LLi, E_X_posterior, COV_X_posterior] = velime_estep(C, G, estParams, const) % % Computes the posterior distributions of [x_{t-tau}^t,...,x_t^t] given % p_{t-tau-1}, p_{t-tau}, u_{t-tau+1}, ..., u_{t+1}, G_t. % % @ Matt Golub, 201...
function MatMPI_Sleep % Turn off warning that occurs when running Matlab on Linux with no % stdin source attached %warning('off', 'MATLAB:typeaheadBufferOverflow'); if (isunix) pause(0.01); else pause(0.1); end return;
clc clear a = input('a='); b = input('b='); for k=1:1:15 t(k) = k; x1(k) = a; x2(k) = b; c(k) =(x1(k)+x2(k))/2; if k>1 l(k) =((c(k)-c(k-1))/c(k))*100; m(k)=abs(l(k)); if m(k)<=0.0001 break; end end f1(k) = tan (x1(k)+x1(k)); f3(k) = tan (c(k)+c(k)); if f1(k)*f3(k)...
function gamma = IDM(Q, QP, QPP) % Calculate A(Q) syms L1 M1 MX1 MY1 MZ1 XX1 XY1 XZ1 YY1 YZ1 ZZ1 syms L2 M2 MX2 MY2 MZ2 XX2 XY2 XZ2 YY2 YZ2 ZZ2 Q=sym(Q); QP=sym(QP); QPP=sym(QPP); V0=[0;0;0]; V1=[0;0;0]; W0=[0;0;0]; V2=[L1*sin(Q(2))*QP(1) L1*cos(Q(2))*QP(1) 0 ]; W1=[0;0;QP(1)]; W2=[0;0;QP(1)+QP(2)]; J11=[X...
function [parameters error] = generate_parameters(founder_source, map, genotype) error = 0; parameters = []; physical_map = map.physical_map; scaled_map = map.scaled_map; [nrows, ncols] = size(scaled_map); if( nrows <= 0 || ncols ~= 2 ) error = 1; disp('error in processing marker list'); return; end n...
circle_radius = 800.e-3; arc_angle = pi/3; ellipse_radii = [75.e-3, 112.5e-3]; num_turns = 1.5; num_strips = 31; center_height = 20.e-3; max_width = 45.e-3; min_width = 20.e-3; gamma_func = cell(num_strips,1); dgamma_func = cell(num_strips,1); ddgamma_func = cell(num_strips,1); curv_func = cell(num_strips,1); t_bounds...
function [est_nb, classe, u] = estimate_signature(sb) % fonction permettant d'estimer la signature % sb : signature binarisee (vecteur ligne) % est_nb : le vecteur final contenant les nombres decodes l = length(sb); u = l/89; if (u > 1 && u < 2) disp('Shannon theorem not checked !'); est_nb = 0; classe = ...
% script to run PROCESSLBATCHMODE.m on the 2-sec data for autoscored using lactate % and manual scored using lactate and SWA % each vector of output contains tau values for 11 BA files and then 11 BL files ten_sec_directory = 'D:\mrempe\autoscore_and_epoch_length_study_data\10-Second_epochs\'; two_sec_directory = 'D...
function c=adunare(nr,ad) T=0; if length(ad)>length(nr) for i=length(nr)+1:length(ad) nr=[0 nr]; endfor else for i=length(ad)+1:length(nr) ad=[0 ad]; endfor endif for i=length(nr):-1:1 c(i)=nr(i)+ad(i)+T; T=floor(c(i)/10); c(i)=mod(c(i),10); endfor if T c=[T c]; endif endfunction
classdef node < matlab.mixin.Copyable properties % network parameters id_child = []; % M_child x 2 % id at (I) node array (c/g) of the layer + (II) data array (c/g) of the layer % id_parent = []; % M_parent x 2 % id at (I) node array (c/g) of the layer + (II) data array (c/g) of the layer ...
clear all a2_max=1; a1_max=4; load net_lqr k=1; for a1=-a1_max:0.1:a1_max, for a2=-a2_max:0.01:a2_max, % [AT,BT,CT,DT] = ssdata(rss(6,1,2)); Q = eye(6); R = eye(2); inputANN(:,k) = [a1;a2]; %inputANN(:,k) = [A(1,:)';AT(2,:)';AT(3,:)';AT(4,:)';AT(5,:)';AT(6,:)';BT(1,:)';BT(2,:...
%% create object obj = mypkg.mysubpkg.myclass(); % valid calls graph: % ------------------ % n,hn ==> [m, m2, s, so, s2, s2o, l, p; hm, hmo, hmvo, hm2, hm2o, hm2vo, hs, hsv, hso, hsvo, hs2, hs2v, hs2o, hs2vo, hl, hp] % m,hm,hmo,hmvo ==> [m2, s, so, s2, s2o, l, p; hm2, hm2o, hm2vo, h...
% GMSH2MATLAB2D.m % MATLAB script to convert Gmsh nodes, elements, and edges from output MSH % file into usable MATLAB arrays and vectors % % Creator: Casey T. Icenhour % Last Update: February 6, 2017 % % License: MIT License % % Reference: % % C. Geuzaine and J.-F. Remacle. "Gmsh: a three-dimensional finite ...
%CODINGCONVENTIONS specify coding conventions for MatGeom files % % General % % This file specifies coding convention for future files. Current files % do not necessarily follows the requirements, as they were created % before conventions. % % There are three levels of conventions: % MUST: an oblig...
clc; clear; close all; %% % theta = 0:pi/180:pi-pi/180; % afd = sin(theta); % %length(afd) % afd = [ .1*ones(1,90) afd .1*ones(1,90)]; % plot(1:length(afd),afd); % psi=k*d*cos(theta)+beta; % AF=sinc((Nelem.*psi./2)/pi)./sinc((psi./2)/pi); %% lambda = 1; d = lambda/2; M = 32; m = M/2; theta = 0:pi/18...
clear all, close all data.fileName = 'HandoverLearningOrientation_test'; data.epsilon = 0.7; data.initSamples = 29; data.updateSamples = 5; data.numHyper = 6; data.samples = []; data.policyMean = [.7 1.1 0, 0]; % data.policyMean = [.7 1.1 0, -20/180*pi]; % data.policyCov = {diag([.1,.3,50, .05].^2)}; data.policyCov = ...
% close all; clc; processStatus = [processStatus, newline, ... datestr(now), ' >> ', '[Start image outputing].']; processStatus = [processStatus, newline, ... datestr(now), ' >> ', 'Plotting graphs ...']; % plotting processes x = -pi:0.01:pi; figure...
clear; rng('default'); rng(1); n = 1000; m = ceil(n/5); s=ceil(n/10); x_true=[randn(s,1);zeros(n-s,1)]; % true sparse signal x_true = x_true(randperm(n)); density = 0.1; rcA = .01; A=sprandn(m,n,density,rcA); b = A*x_true + 0.1*randn(m,1); mu = 1; do_super_scs = 1; tic; cvx_begin cvx_solver scs cvx_solver...
function varargout = Erode_Surface_Label(varargin); % % Syntax : % [dilLabels] = Erode_Surface_Label(Surf, surfLabels, opts); % % This function erodes labels throughout a specified surface. % % Input Parameters: % Surf : Surface variable (file, struct or cellarray). % surfLab...
function [nee, nnn, nuu, nen, neu, nnu] = local_okada_strain_calc(flong1, flat1, flong2, flat2, long, lat, z, fdip, fld, fss, fds, fts, nu, fbd) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% local_okada_calc.m %% %% ...
function [res,receptor] = initreceptores(res,m_vars,f_vars,ops) hfig = figure('Name','ReceiversPlot');hold on xran = res.box(1,1):res.Del:res.box(1,2); yran = res.box(2,1):res.Del:res.box(2,2); zran = res.box(3,1):res.Del:res.box(3,2); res.nx = size(xran,2); res.ny = size(yran,2); res.nz = size(zran,2); res.n...
all_Trajectories = { Arc; Straight; BSML; % BSMLS; BSMR; % BSMRS; RSML; % RSMLS; RSMR; % RSMRS; }; all_Trajectories_String = { 'Arc' 'Straight' 'BSML' % 'BSMLS' 'BSMR' % 'BSMRS' 'RSML' % 'RSMLS' ...
function J = square_jacobian_area(alpha_star, P_star, period) % Function computes the Jacobian at a certain point using central % differencing for the derivatives. eps = 1e-6; % For the finite difference. We use the central finite difference method % How many iteations should we go ahead? (How many compositions...
clear all; addpath ('../') addpath ('../include') % Load input default_arena_input % Generate common arena parameters arena_generate default_arena_write default_arena_plot
%% Biomedical Digital Image Processing % Image sharpening with Laplacian operator % Date: 2017.09.23 % Created by Eunseo Cho clc; clear; close all; %% Get data and size from the image image = imread('brainmri.jpg'); image = rgb2gray(image); % convert to gray scale image [m,n] = size(image); figure(1); subplot(231); ...
function save2nifti(fname) % Loads a .mat file format, and saves it to the same directory with a % .nii format % Use before applying BET with FSL % The variable name must be 'MRA_stack' % Otherwise throw an error load(fname, 'MRA_stack'); niftiwrite(MRA_stack, fname); end
function dist = point_to_line(pt, v1, v2) if length(pt)==2 pt=[pt 0]; v1=[v1 0]; v2=[v2 0]; end a=v1 - v2; b=pt - v2; D=norm(cross(a,b)) / norm(a); A=sqrt((v1(1)-v2(1))^2+(v1(2)-v2(2))^2+(v1(3)-v2(3))^2); B=sqrt((pt(1)-v1(1))^2+(pt(2)-v1(2))^2+(pt(3)-v1(3))^2); C=sqrt((pt(1)-v2(1))^2+(pt(2)-v2(2)...
function [Sch_rank,W] = Srankt() M = load('SG1.csv','-ascii'); %size of the matrix R = length(M(:,1)); C = length(M(1,:)); Investment=ones(R,1); %decision of initial investment Sch_rank=zeros(R,2); D_sch=zeros(R,1); D_lev=zeros(C,1); Rate_lev=zeros(1,C); %assing rate level Rate_lev(1,1)=-1; Rate_le...
function [lambdak,V,flag] = JacobiRot(Ak,e,imax) %JacobiRot execute the Jacobi rotation flag = true; if Transp(Ak) - Ak ~= 0 flag = false; lambdak = []; V = []; return end error = inf; count = 0; len = length(Ak); V = eye(len); p = 0; q = 0; U = eye(len); while and(error > e,count < imax) if count...
%%model comparisons clear; %%experimental data from Ref %Rising the bar: increased hydraulic pressure allows unprecedented high %power density in pressure retarded osmosis %c_d0 is 0.6 mol/L(35g/L) %A=2.49;%Lm-2h-1bar-1 %B=0.39;%Lm-2h-1bar-1 %S=564*10^-6;%m %k=99;%Lm-2h-1 deltaP_exp_06=[4.8 9 13.8 19.0 22.8]; Jw_exp...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % CSC C11 - Assignment 3 - Classification by Gaussian Class Conditionals % % This function uses a trained GCC model to classify an input dataset % % Inputs: % % input_data - The training data set (one input sample per row) % centers - C...