text
stringlengths
8
6.12M
function ind_chan_s5 % ind_chan_s5 has the same properties as ind_chan but for S5 files with % differents size nodes. % % See also ind_chan % Mikael Andersson 2012-01-11 %% get data from cmsplot hfig=gcf; cmsplot_prop=get(hfig,'userdata'); subgeom = cmsplot_prop.subgeom; core = cmsplot_prop.coreinfo.core; if core.i...
function [p,pv] = positencodeL(ev,x) if isinf(x) mi = find(isinf(ev.value),1,'first'); else [mv,mi] = min(abs(ev.value-x)); end p = ev.raw(mi); pv = ev.value(mi);
%This is a predication model based on GM(1,1); clear; clc; syms a b; c=[a b]'; t1=2000;%the beginning year; t2=2014;%the end year; deltat=5;%the years you want to predict A=[202 219 221 325 347 333 360 407 441 476 479 482 490 522 541]; %A=A'; %A is the original data; B=cumsum(A); n=length(A); for i=1:(n-1) C(i)=(B(...
function s=getWatchedStatesfullerStickP2X7(y) s=[y(:,3),y(:,4),y(:,5),y(:,12),y(:,13),y(:,9),y(:,8)]; end
load('BPMData_30tours.mat'); % %% % figure % mesh(AM.Data.Sum) % % %% % Sum = AM.Data.Va + AM.Data.Vd + AM.Data.Va + AM.Data.Vd; % Kx = 11.4; Kz = 11.4; % XPos = Kx*(AM.Data.Va - AM.Data.Vb + AM.Data.Vd - AM.Data.Vc)./Sum; % ZPos = Kz*(AM.Data.Va + AM.Data.Vb - AM.Data.Vc - AM.Data.Vd)./Sum; % % % %% Signal % plo...
close all; clear all; % Problem 4 (b) N = 121; H = exp(-j*(N-1)/2*(2*pi/N*[0:N-1])); H(17:106) = 0; h = ifft(H,121); figure(1); stem([0:N-1],h); axis([0 N-1 -0.1 0.3]); title('Impulse response for an LPF - N=121'); Hf = fft(h,4096); figure(2); w = [0:4095]*2*pi/4096; subplot(2,1,1) plot(w(1...
% written by professor Jay McClelland function [] = selectAction( ) %UNTITLED2 Summary of this function goes here % Detailed explanation goes here global w a p; %% compute the normalized activation % a.net = a.wts * w.vS.visInput'; % scnet = p.smgain*a.net; % a.act = exp(scnet)/sum(exp(scnet)); %% compute ...
function [beta] = estimate_beta(p,l,x,y) X = []; beta = []; %% x : Column vector rows_X = size(x,1); cols_X = size(x,2); powers_X = 0:p-1; for i=1:cols_X X(end+1,:) = power(x(i),powers_X); end beta = pinv(X'*X+l*eye(rows_X))*X'*y; end
%load('Complex_Noise.mat'); MatFiles=dir('*_analysis_matlab.mat'); name=strcat(MatFiles(1).name); Calcium=load(name, 'DenoisedTraces'); Calcium=Calcium.DenoisedTraces(:,1:2500); MatFiles(1).number=size(Calcium,1); Fitness=load(name, 'idx_components'); Fitness=Fitness.idx_components+1; GoodCalcium=Calcium(Fitnes...
function mask = syn_generateMask(row, col) % We try to generate a round mask mask = zeros(row, col); max_radius = min(row, col)/2; cx = row/2; cy = col/2; radius = max_radius - 3; % radius is 3 pixels smaller than the maximum radius for i = 1 : row for j = 1 : col dist = sqrt((i - cx)^2 + (j - cy)^2); ...
% This function obtained wake velocity of all of the wake pannels % by considering the induced velocity by wake pannels and wing pannels function [u]=wakevelocity(Nx,Ny,Nw,dlw,dlx,dly,aoa,Lam,dih,x,y,z,xw,yw,zw,G,Gw) for i=1:2*Nw*Ny % coordinates of the wake pannel the convection speed is to be found ...
function stdSeries = tempvariabilitycalc(stYr,endYr,blkS) % Use HadCRUT4 ensemble to calculate the uncertainty in temperature % Ted Amdur % 1/25/20 [yrE,ens] = loadensemble; ens = ens(yrE >= stYr & yrE <= endYr,:); %Get the empirical standard deviation subN = floor(size(ens,1)/blkS); stdSeries = NaN(subN,1); for ii = ...
%% Make the plots for the mouse tsne coronal view clear variables close all % Load additional color data datadir = '/home/mvandegiessen/data/tSNE_ABA/AllenMouseBrain_coronal/'; colors = load([datadir 'voxels']); [cx,cy,cz] = ind2sub([67 41 58],colors.voxel.brain_idx); coords = [cx cy cz]; perp = '256'; %% Figure a % ...
classdef Hitbox properties vertices; faces; faceNormals; positionTransform; end methods function self = Hitbox(height, width, length, displacement, initialTransform) self.vertices = self.getVertices(height, width, length, displacement, initi...
function [iy, ix, err] = loo_interp(y, x, varargin) % leave-one-out interpolation. % % Arguments: % y - A matrix of samples over free variable x (NxM). % x - Free variable values (1xM). Should be monotonically increasing. % % Name/Value Arguments: % wout - Weighted outliers. When calculating the model, whether every...
function flipBitVideoSync(bit) %pds.datapixx.flipBitVideoSync flip a bit at the next VSync % % pds.datapixx.flipBit flips a bit on the digital out of the Datapixx % box, at the time the monitor refreshes the next time, but not back. % % NOTE: The Plexon system records only changes from 0 to 1, while the % Datapixx...
function dsp__plot_spect( obj, plots_are, panels_are, savepath, varargin ) c = obj.combs( plots_are ); formats = { 'epsc', 'svg', 'png', 'fig' }; for i = 1:size(c, 1) extr = obj.only( c(i, :) ); extr.spectrogram( panels_are, varargin{:} ); filename = strjoin( c(i, :), '_' ); for k = 1:numel(formats) fu...
function band_plotter(h,w)%,legend_string) %Authors: Alex Abulnaga, Sacha Welinski %Date: 2019-08-15 %Title: band_plotter.m %function overlap = band_plotter(xlimits,h,w) %Description: Given desired xlimits, and a set of parameters (h,w), % band_plotter plots the dispersion curves for ...
function px_fsl_melodic(fdp,para) % fdp.scan - see melodic -i % fdp.mask - see melodic -m % para.op - see melodic -o % para.tr - see melodic -tr % fdp.Sdes - see melodic --Sdes % fdp.Scon - see melodic --Scon if ~exist(para.op,'dir');mkdir(para.op);end cmd = ['melodic -i ' fdp.scan ' -o ' para.op ' -m ' fdp.mask .....
%% Lafa Unit Counter % Este código têm a finalidade de ler continuamente os valores de contagem % de 8 canais conectados ao FPGA. Através da GUI, o usuário pode escolher % a porta com utilizada para comunicação, o tempo de aquisição e a % quantidade de loops que serão realizados. %% clc clear all %% Parâmetros Configu...
function wav2jAER( wavfile, outputfile ) %WAV2JAER This function plays a wav file and simultanously records the %spikes from jAER. % % Author: Holger Finger % if nargin<=1 [filename,path]=uiputfile('*.dat','Select dat file'); if filename==0 return; end outputfile=[path,filename]; ...
function [ res ] = getMSAdata( str ) %GETMSADATA Summary of this function goes here % Detailed explanation goes here global c Imax cb; switch str case 'c' res = c; case 'cnum' res = length(c); case 'Imax' res = Imax; case 'cb' res = cb; otherwise res = -1; e...
%========================================================================= % % Program to investigate alternative identification strategies % %========================================================================= function coint_ident( ) clear all clc RandStream.setDefaultStream( RandStream('mt19937a...
function coasters = sixFlags(filename, height) fh = fopen(filename); line = fgets(fh); coasters = []; x=1; height(end) = ''; height = str2double(height); while ischar(line) [token rest] = strtok(line, ':') rest(1:2) = ''; rest(3) = ''; rest = str2double(rest); if rest <= height coaster...
function M = linearSourceTerm(k) % Matrix of coefficients for a linear source term in the form of k \phi % % k is a cell variable % % SYNOPSIS: % M = linearSourceTerm(k) % % PARAMETERS: % k - source term, CellVariable % % RETURNS: % % % EXAMPLE: % % SEE ALSO: % d = k.domain.dimension; if (d ==1) || (d==1.5) || (d=...
function f = F( x,y ) %要解的函数 f=x.^2-4; %求解 dy/dx=F(x,y) = x^2-4 %f=1-(2.*x.*y)./(1+x.^2); %f=2.*x.*y; end
lambdadt = derivativet(Lambda,NodesT,dt); lambdaGrad = zeros(NodesT,1); outervec = zeros(NodesT,1); for i = 1:NodesT func = flipud(u(:,i)); vec = zeros(NodesX,1); for j = 1:NodesX int = flipud(x(j)-x); vec(j) = trapz(int,func.*exp(2.*int).*exp(-(exp(interval)-mu).^2/(2*sigma^2))); end ...
%clear,clc a=loadTiff('\\vis_3d_stereo\c$\WinEagle\log\AutoRpt\CALINS\WISL0241\pair0\Thick\profile.tif_r.dat.tif'); b=loadTiff('\\vis_3d_stereo\c$\WinEagle\log\AutoRpt\CALINS\WISL0241\pair1\Thick\profile.tif_r.dat.tif'); c=loadTiff('\\vis_3d_stereo\c$\WinEagle\log\AutoRpt\CALINS\WISL0241\pair2\Thick\profile.tif_r.dat.t...
function printYieldForKOs(targets,swaps,kos,substrate,aerobicString) % make swaps empty [] for just knocks noSwaps = isempty(swaps); if noSwaps, swaps = cell(size(kos)); end model = setupModel('iJO',substrate,aerobicString,'thko'); out = zeros(length(targets),4); for i=1:length(targets) ...
% Use mean % provideIdx: indices for voxels that are provided in the test examples % A 1 x 3172 array of int, each in 1:5903, corresponding to % the voxels from the project part 1 data. % missIdx: The voxels that you need to predict. % A 1 x 2731 array of integer indices, and contains...
%% This is the experiment for the Color Graph conference paper %% Clean up the work space clear all format compact clc WaitBar = waitbar(0,'Trials are running, please wait <3'); WAITBARCOUNT=0; datetime('now') %% Load Trial properties for 10 trials load('TrialProperties10.mat'); % We are running 10 trials TRIALS=10; ...
close all clear setPlot %% IEC Site definition Vref = 60; % Reference wind speed zref = 87.6; % Hub height above ground Uref = 12; % Wind speed at zref Iuref = 0.15; % Turbulence intensity zmin = 5; % Minimum height for wind shear. From 0 to zmin, U is constant and equal to U...
function y = diffTn(n,z) %y = n*sin(n*acos(z))/sqrt(1-z^2); if n==0 y = 0; elseif n==1 y = Tn(0,z); elseif n==2 y = 4*Tn(1,z); else y = 2*n*Tn(n-1,z) + (n/(n-1))*diffTn(n-1,z); end %y = 1/2*(z+(z^2-1)^(1/2))^n*n*(1+1/(z^2-1)^(1/2)*z)/(z+(z^2-1)^(1/2))+1/2*(z-(z^2-1)^(1/2))^n*n*(1-1/(z^2-...
% This code reproduces the analyses in the paper % Urai AE, Braun A, Donner THD (2016) Pupil-linked arousal is driven % by decision uncertainty and alters serial choice bias. % % Permission is hereby granted, free of charge, to any person obtaining a % copy of this software and associated documentation files (the "...
pp=num2str(standard_descend(:,1)); %boxplot(standard_descend(:,2),pp); ppp=standard_descend(:,1);%price pppp=standard_descend(:,2);%distance for i=1:10 o=find(pppp==max(pppp)); ppp(o)=[]; pppp(o)=[]; o end boxplot(pppp,num2str(ppp)); grid on;
function [sigma, tau, sigma_tau] = make_rand_s_t(n, W) %UNTITLED6 この関数の概要をここに記述 % 詳細説明をここに記述 sigma = randi(n/2)*2-1; tau = randi(n); mod_ts_w = @(i) mod(tau + i*sigma ,W); sigma_tau = mod_ts_w(1:W)+w*(mod_ts_w(1:W) == 0); end
function bool = checkParamsFourP2X7() global a1 a2 a3 b1 b2; bool=1; if a1<0 || a2<0 || a3<0 || b1<0 || b2<0 bool=0; return end end
% Add the ImageGraph to path (in a folder named 'ImageGraphs'). Find it here: % http://www.mathworks.com/matlabcentral/fileexchange/53614-image-graphs addpath(fullfile(fileparts(mfilename('fullpath')), 'ImageGraphs')); %% Read the image and features from the sample file image = im2double(imread('docia.png')); feature...
function final_ising(L,conc_Mn,repeat) % L*L: size of the supercell eg.L=20, 20x20 supercell % conc_Mn: concentration of Mangnese dopants in the lattice % repeat: (an integer); each time this code will assume a different initial distributions of Mn-dopant in the lattice and will calculate average and std for Tc. cl...
function vf=flipRDM(v) sizev=size(v); if sizev(1)==1 vf=fliplr(v); elseif sizev(2)==1 vf=flipud(v); else vf=v; warning('Input was not a vector'); end end
clear all ;close all ; subs = {'alex','charest','esteban','fabio','gab','gabriella','genevieve','gina','guillaume','jeremie','julie','katrine','lisa','marc',... 'marie','mathieu','maxime','mingham','patricia','po','russell','sunachakan','tah','vincent'} ; elabs = load('C:\shared\all_white_normals\a2_good\elabs...
function [ke] = elestiff(xi, eta, coord, C) % This function calculate element Stiffness Matrix % INPUT: % ====== % C = Constitutive Matrix % xi, eta = Gausspoint % coord = Nodal coordinates of the element % % OUTPUT: % ======= % ke = Element stiffness matrix x = coord(:,1); y = coord(:,2); l1 = -0.5*xi*(1-xi); ...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Name : <Ben Coordes> % GT Email : <bcoordes3@gatech.edu> % Homework : hw10 % Section : <C02> % Collaboration: <I worked on the homework assignment alone, using % only course materials.> % % % File...
function [V] = symmetry(b, bids, bwidth) % SYMMETRY Estimation for 1(3)(b), assuming independent, symmetric values % Given a matrix of bids with bidders in columns and auctions in rows, % determine how much each bid is shaded under equilibrium play in a first % price auction. Uses normal kernel. ...
function [solnAlpha, alpha, betaAlpha, algParams, predStatus] = pred(soln, probData, gH, gH_Params, myLinSolve, algParams, opts) % This method performs a predictor step in the algorithm. % -------------------------------------------------------------------------- % USAGE of "pred" % [solnAlpha, alpha, betaAlpha, algPa...
% objective: computes negative log likelihood of entire training % dataset as a function of the model parameters, x, a vector defined % as % % x = [vec M; log ω; log c₉; log τ₀; log β] % % as well as its gradient: % % f(x) = -∑ᵢ log(yᵢ | Lyα z, σ², M, ω, c₀, τ₉, β) % g(x) = ∂f/∂x function [f, g] = objective(x, c...
function [alpha,beta] = solve_dynamics_SDP(alpha_prev,beta_prev,features,data,constants,Xc_i,Nc,max_slack,... J_Phi_f,W_p,W,partial_Wp) %Dynamics sub-problem yalmip('clear'); %% Get stuff n = constants.n; m = constants.m; Ntr = constants.Ntr; Xtr_i = constants.Xtr...
function img_out = FuncImageTransform(img, R, T) %% ͼ����ת % 根据R,T求解旋转角度和平移距离 % theta1 = acos(R(1,1)); theta1 = asin(R(2,1)); % theta = (theta1 + theta2) / 2; theta = theta1 / pi * 180; %��ݽǶȺ�ƽ�ƾ�����ת�����ͼ�� %��ת %ƽ�� % img_rotate = imrotate(img, theta...
function [voxels minX minY minZ] = triangle_voxelize(p1, p2, p3) %p1 = [randi(10) randi(10) randi(10) ] %p2 = [randi(10) randi(10) randi(10) ] %p3 = [randi(10) randi(10) randi(10) ] n = cross(p2-p1, p3-p1); n_norm = n/norm(n); %figure minX = floor(min([p1(1), p2(1), p3(1)])); maxX = ceil(max([p1(1), p2(1), p3(1)])...
function [xy, z] = deg2world(xyIn, z, zIsR) %deg2world convert from degrees of visual angle to world coordinates % calculates the world coordinates for an array of degress of visul angle % taking the depence of x and y degrees into account (i.e. that the % distance of the position e.g. y increases when x is large % ...
function [q] = QR_NL_Dyn(q,u,quad,qsim) %Pull in simulation parameters g = qsim.g; dt = qsim.dt; %Non-linear dynamics can be described by the following vectors: %% Translational accel = @(q,u) [sum(u(:,1),1)/quad.m*sin(q(5,1)); sum(u(:,1),1)/quad.m*sin(q(4,1)); sum(u(:,1),1)/quad.m*cos...
function [ IndicatorBW] = ColorOfIndicatorCheck(r,resizedArrena) %Arrena=imread('arrena3.jpg'); resizedArrena=imresize(resizedArrena,[480,480]); x=35; IndicatorColor=resizedArrena(:,:,1)<=(r(1,2)+x)&resizedArrena(:,:,2)>=(r(1,3)-x)&resizedArrena(:,:,3)<=(r(1,6)+x)&resizedArrena(:,:,1)>=(r(1,1)-x)&resizedArrena(:,...
function dig = mat2vect_diag(A) m = size(A); dig = []; for i = 1:(m-1) temp = diag(fliplr(A(1:i,1:i)))'; if(mod(i, 2) == 0) dig = [dig temp]; else dig = [dig flip(temp)]; endif endfor endfunction
function [regiond,Lnew,L_all] =regionFill(L_all,bw,~, ~, sp_text, cir_index) % V2.1.5 has different regiond init, and fixes left bar prob... % V2.1.4 has no shrink in function % V213 includes mergeRegionsSimple for faster ops % V2_2_2 includes size limit for growing a small region % V2_1_1 debugs V2 % V2_1 uses d...
function [Zindex] = Zfunc(Zindex,P,prob) P = cumsum(P,2); % comsum by the columns for i = 2:length(prob) if (prob(i) < P(Zindex,1)) Zindex = 1; elseif (prob(i) < P(Zindex,2)) Zindex = 2; elseif (prob(i) < P(Zi...
function colors = RYB_colors(n) % RYB_colors A good diverging colormap. % RYB_colors(n) returns an RGB matrix of n colors (default 7). % These colors form a diverging colormap (colors easily perceived to lie % on a sequence on either side of a central color). % % Example: % colormap(RYB_colors) % % See al...
% Tao Du % taodu@stanford.edu % June 22, 2014 function [ ] = write_camera_file( fc, cc, kc, alpha_c, filename) % write left camera fid = fopen(filename, 'wb'); % compute the height and width height = uint32(cc(2) * 2 + 1); width = uint32(cc(1) * 2 + 1); fwrite(fid, height, 'int32'); ...
% hanieh Soleimani % script for testing the trace of the matrix clear; close all; clc; rng('shuffle'); n =2; s = 70; % A = rand (n,n) A = [ 2 1 ; 1 2]; tr_A = trace(A); invA = inv(A); % det_A = det(A); traceA = 0; for i = 1:s randomV = sign(rand(n,1)-0.5); traceA = traceA +...
% the h1-subproblem and set g_h1. % h1 = lambda1*||x||_1 function z_h1 = h1_sub(g_f, g_h2, xk, d, lambda1) tau = xk - (g_f + g_h2)./diag(d); tau_sign = tau; tau_sign(tau>=0) = 1; tau_sign(tau<0) = -1; z_h1 = tau_sign.*max(0,abs(tau) - lambda1./diag(d)); %fval = (g_f')*z_h1 + yh1(z_h1, lambda1) + (g_h2')...
% Script to generate zts gratings and OSA addpath('./mgds'); cXLSTemplate = 'cellRef.xlsx'; mgds_SUPER = MGDS(); mgds_SUPER.init('ZTS_grating_OSA_package_mask', ... 'autogen structures', true); mgds = MGDS(); mgds.clearAll(); % Render to super MGDS: bProduction = true; bGratingLabelsOff = fals...
function y=compute_similarity_ou(A,B) %欧式距离方法比较 A.combine和B.combine 的相似度 fprintf('********开始计算%s和%s*******\n',A,B); X=load(['.\A\',A,'.combine']); Y=load(['.\A\',B,'.combine']); n=size(X,1); m=size(Y,1); answer=1000000000000; window=200; dis=window-1; for i=1:1:n-dis for j=1:1:m-dis % fprintf('*****开始计算(%s,%...
function [is_mono] = is_audio_mono(audio) % IS_AUDIO_MONO determine if the stereo is sterio (2 channels/columns) or mono (1 % channel/column). [~,n]=size(audio); if n==2 is_mono=false; elseif n==1 is_mono=true; else is_mono=false; end
clc; close all; im = 'Img_3.jpg'; % Read the image im22 = imread(im); [row,col] = size(im22); OutputMap = analyze(im); [m,n] = size(OutputMap); img = OutputMap; for i = 1:m for j = 1:n if(img(i,j) < 1) % Set the thereshold img(i,j) = 0; else img(i,j) = 255; ...
%% Calcolo del secondo funzionale di costo ( centro giunti) function dw2 = funzionale_dw2(Q,joint_lim) %Centri corsa q1_m= (abs(joint_lim(1,2))- abs(joint_lim(1,1)))/2; q2_m= (abs(joint_lim(2,2))-abs(joint_lim(2,1)))/2; q3_m= (abs(joint_lim(3,2))-abs(joint_lim(3,1)))/2; q4_m= (abs(joint_lim(...
function maxi = largest_product(n) for i = 1:1000-12 p = n(i)*n(i+1)*n(i+2)*n(i+3)*n(i+4)*n(i+5)*n(i+6)*n(i+7)*n(i+8)*n(i+9)*n(i+10)*n(i+11)*n(i+12); q(i)=p; end maxi=max(q);
function [F] = calcWKS(evecs1, evals1, numSamples) evals1 = abs(evals1); emin = log(abs(evals1(2))); emax = log(abs(evals1(end))); s = 7*(emax - emin)/numSamples; emin = emin + 2*s; emax = emax - 2*s; tn = linspace(emin, emax, numSamples); ce = sum( exp( -((bsxfun(@minus, log(evals1(:)) , tn(:)')).^2)./...
%%%%%%%%%%%%%%%% readDirectory %%%%%%%%%%%%%%%% % Parses the file names in the provided directory. Assumes that all % numbered images are in the image sequence to be analysed, and that an % unnumbered image, if present, shows the ROI for later processing. % % Inputs: % inDirectory - the directory the images ...
%% Category List % I/O doc2html('glycanMLread.m'); doc2html('glycanNetSBMLread.m'); doc2html('glycanMLwrite.m'); doc2html('glycanNetSBMLwrite.m'); doc2html('glycanStrread.m'); doc2html('glycanStrwrite.m'); %% Database Connection doc2html('dbLocalConnect.m'); doc2html('dbExactStructSearch.m'); doc2html('queryGlycome...
%% sprMDL auto testing clear %% build protiens proteinARGs = cell(0); % entire CH1 % proteinARGs = [proteinARGs, GenerateProteinARG(32,137,'protein/CH1/1sjj.csv')]; % proteinARGs = [proteinARGs, GenerateProteinARG(45,150,'protein/CH1/1tjt.csv')]; % proteinARGs = [proteinARGs, GenerateProteinARG(45,150,'protein/CH1/1...
%main montecarlo clear close all T = 300; % temperature, K HBAR = 1.054D-34; % reduced Planck constant, J*s kB = 1.3806488e-23; % Boltzmann constant, J/K Q = 1.6021766208e-19; % elementary charge, C eps0 = 8.854D-12; % vacuum permittivity constant, F/m eps_s = 12.9*eps0; % static dielectric constant, F/m hwpop...
%% % Alexandria University % Faculty of Engineering % Electrical and Electronic Engineering Department % % Course: Communications System Lab. % % Experiment 1: Bluetooth Protocol. %% clear; close all; clc; %% Generate random bit sequence of length 1 ? 10^6 bits M = 8; N = log2(M); N_bits = N*ceil(1...
%% Unicycle Model function [xVectorNext] = unicycleModel(xVectorCurrent,v,w) % For each vector component (x,y,theta), calculate the next position based % on the current position, forward linear speed, and angular velocity % The following equation is provided in the problem statement: xVectorNext = [xVectorCurrent(...
global baseParameters fparam parami nbin Acell calP2X7 iparam parami baseModel pMax pMin; pMax=containers.Map(); pMin=containers.Map(); %Create a cell array of strings with the names of the parameters. paramNames={'k1','k2','k3','k4','k5','k6','k7','k8','k9','k10','k11','k12','k13','k14','k15','k16','k17','k18','k19...
function hints = netHints(net,hints) % Copyright 2013-2015 The MathWorks, Inc. net = struct(net); net = nnet.codegen.weedProcessSteps(net); % Dimensions hints.numInputs = net.numInputs; hints.numLayers = net.numLayers; hints.numOutputs = net.numOutputs; hints.allWB = nn.wb_indices(net,hints,true); hints.learnWB = n...
function out = unfoldings(T, order, Ndim) % Computes all Unfoldings of a Tensor. % % |---------------------------------------------------------------- % | (C) 2006 TU Ilmenau, Communications Research Laboratory % | % | Martin Weis % | Florian Roemer % | % | Advisors: % | Dipl.-Ing. Gio...
function plotroute(city, route, current_distance, Iterations) % PLOTROUTE % PLOTROUTE(city, route, current_distance, temperature) plots the route and % display current temperautre and distance. global h; cycle = route([1:end, 1]); % update route x=city(:,1); y=city(:,2)+400; set(h,'Xdata',x(cycle),'Ydata',y(cycle)); ...
clear; quad2ini; anim = 0; a = 20; fileID = fopen('results3.txt','w'); vmatrix = zeros(8, 5); alfav = [0 0.5 0.7 0.9 0.95]; etav = [0 0.003 0.01 0.03 0.1 0.3 1 3 10]; etav = etav'; i = 1; j = 1; for alfa = [0 0.5 0.7 0.9 0.95] for eta = [0.003 0.01 0.03 0.1 0.3 1 3 10] quad2; fprintf(f...
%20160517 %increased dlmwrite precision, to 5 decimals, file maps_cost %always write 11 macrosectors, in line 671 % new (temporary) post to manage First Guess/SR mode function []=POSTmain_FG(f2,DSuperSet,aggregationInfo,pathANN,flag_region_dom,flag_optim_dom,flag_aqi_dom,... coordinate,emi,global_data,base_emi_low...
% ASTROTIK by Francesco Santilli % R2BP (Restricted Two Bodies Problem) % Solves the problem of Lambert with the method developed by G. Avanzini. % % Usage: [p,e,w] = lambert(r1,r2,q,t,mi) % % where: r1 = starting point radius [L] (r1>0) % r2 = ending point radius [L] (r2>0) % q = transfer angle [...
%****** Discriminant Analysis via Support Vector ***** % By Suicheng Gu at Peking University on Jan. 5, 2008 % Any questions, you can email me: gusuch@gmail.com %Input: X, training samples with size of N*d | d, dimension | N, number of samples. %Input: Y, training index with size of N*1, %Input: k, Number of eig...
function [pupil,mask,rmswfe] = displayWFE(rays, caption, rmttp, clim) %DisplayWFE Helper function for plotting wavefront error maps % rays can be a cell array, in which case the difference in wfe is plotted if nargin < 2 if isfield(rays,'surface') && isfield(rays.surface,'name') caption = [rays.surfa...
%PSTHs and some initial analysis %TH stands for three outcomes (suc/mal/wat) clear all; clc; global Dura Baseline Tm Tbase BSIZE Tbin tic load('RAWTH.mat'); RAW=RAWTH; %Main settings SAVE_FLAG=1; BSIZE=0.01; %Do not change Dura=[-4 10]; Tm=Dura(1):BSIZE:Dura(2); %Baseline=[-22 0]; Tbase=Baseline(1):BSI...
function v = f5_2(x) v = 1/2 + 1/4*(x^2) - x*sin(x) - 1/2*cos(2*x); end
clear clc %% Import historical data and define sampling and epoch parameters [header, recorddata] = edfread('chb01_03.edf'); Fs = 256; % sampling frequency T = 1/Fs; % sampling period N = length(recorddata); % num sample...
function I = Simpson(x,y) %Simson Fuction uses simpsons 1/3 rule to integrate a list of equally spaced x and y %values, last section will be integrated by trapazoidal methoud if needed % Inputs: % x - Array containing x values % y - Array containing y values % Outputs: % I - Value of integral ...
function [resVal] = softXorMod2(softVec) hardVec = mod(round(softVec),2); resHard = mod(sum(hardVec),2); distVal = abs(softVec - round(softVec)); if isempty(distVal(distVal>0)) resVal = resHard; else resSoft = mean(distVal(distVal>0)); resVal = abs(resHard-resSoft); % norm hard output with soft d...
function [ ] = writeVisTxt( filesDir, saveAddress ) %WRITEVISTXT Summary of this function goes here % Detailed explanation goes here % https://github.com/math314/cut-tree % roadID mapPointID (as a observe), or Gomory Hu tre cut fileExt = '*.txt'; files = dir(fullfile(filesDir,fileExt...
% mass flux timesteps = 41:10:401; ucam1D_cmfmc = []; ucam1D_cmfmcdzm = []; ucrm1D = []; % assemble var into var(randvar,sample) for it = timesteps load(['var_PC1_' num2str(it) '_mcc.mat'],'varCAM1D','parm') % create index variables if it==timesteps(1) idv = varindex({'varCAM1D'},parm) end ucam1D_cmfmc ...
function DateNumber = m2xdate(MATLABDateNumber, Convention) %M2XDATE MATLAB Serial Date Number Form to Excel Serial Date Number Form. % % DateNumber = m2xdate(MATLABDateNumber, Convention) % % Summary: This function converts serial date numbers from the MATLAB % serial date number format to the Excel ser...
function matrix_2d=recover_matrix(csv_file) fileID = fopen(char(csv_file),'r'); end
function [Ifx,errbnd] = quadva(fun,interval,reltol,abstol) % When INTERVAL = [A,B], computes the integral of a continuous function % f(x) from A to B for A < B. A can be -Inf and/or B can be Inf. FUN % accepts a row vector X and returns a vector Y with Y(m) = f(X(m)) % for m = 1,...,length(X). FUN can be a stri...
function [ceza1,ceza2] = haverlysPoolingKisit(x) h(1) = x(7) + x(8) - x(4) - x(3); h(2) = x(1) - x(5) - x(7); h(3) = x(2) - x(6) - x(8); h(4) = x(9) * x(7) + x(9) * x(8) -3 * x(3) - x(4); g(1) = x(9) * x(7) + 2 * x(5) - 2.5 * x(1); g(2) = x(9) * x(8) + 2 * x(6) - 1.5 * x(2); ce...
% Code for Basis function of gamma variates of different frequencies % D = basis matrix with columns of gamma variates of different frequencies % Size(D) = [m,n]; function D = basis_gamma(m,n) D = zeros(m,n); D(:,1) = 1; GG = spm_Gpdf(0:100,10,0.48); % Manual tuning for the first basis vector!!!! % figure;plot(GG) S...
function [SHstF, SHstM, SHstO, SPriS, SPriM, SPriB, SPriA] = vdoSalVox(hrVdo, hrFlow, wsSmp, wsFlow, wsAcc, wsBk, wsSeg, bins, wS, direS, sigS) % Computing video saliency based on spatio-temporal voxels. % % Input % hrVdo - video input handle % wsSmp - sampling % wsFlow - flow % wsAcc - acceleration ...
%% TO USE % Hit y for when there is a character, n for when there isn't and space % for when the whole region doesn't contain text %% Initialization clear ; close all; clc %% To train place all images in the directory/directories in variable paths paths = {'images/'}; % Extensions of images to check for in the paths...
function [pproc] = poisson3d(lambda) % POISSON3D generate and plot Poisson process in the unit cube % % [pproc] = poisson3d(lambda) % % Inputs: lambda - intensity of the process % % Outputs: pproc - a matrix with 3 columns with coordinates of the % points of the process % Authors: R.Gaigalas, I.Kaj...
classdef (Hidden, Sealed) WriterFactory < handle %WRITERFACTORY A factory of graph writer objects. % This class produces WRITER instances based on the desired graph % output format. % % See also: WRITER, FORMAT. %=========================== PROPERTIES ==========================...
function [ J_n ] = GenerateInverterConstants( g_n, N, Z_o, delta ) %UNTITLED2 Generates the admittance inverter constants for the transmission lines %from give low-pass prototype values, a given transmission line impedance, %fractional bandwidth, and filter order % g_n - low-pass prototype values % N - order of th...
function vol = tetrahedronVolume(vertices, varargin) %TETRAHEDRONVOLUME Signed volume of a tetrahedron. % % VOL = tetrahedronVolume(TETRA) % Comptues the siged volume of the tetrahedron TETRA defined by a 4-by-4 % array representing the polyhedron vertices. % % Example % vi = [0 0 0;1 0 0;0 1 0;0 0 ...
%{ # Synced spike times and tracking for each unit (all time relative to the session this recording belongs to) -> ephys.UnitSpikeTimes -> ephys.UnitSpikeTimes -> tracking.ProcessedTracking -> tracking.ProcessedTracking --- spike_times : longblob # (s) repeat of SyncedSpikeTimes (fo...