text
stringlengths
8
6.12M
% Reads in data files and stores these variables to a .mat file clearvars -except root_dir inflation_adj_flag winsor_flag; % creating certificate for web access, extending timeout to 10 seconds o = weboptions('CertificateFilename',"", 'Timeout', 15); % sets current date time to retrieve current information current...
function [ MOV ] = TotalNMRB( Model_Ref, Model_Test, Pro_Test ) %[ MOV ] = TotalNMRB( Model_Ref, Model_Test, Pro_Test ) % As described by ITU-R BS.1387-1 Section 4.5.1 global debug_var if debug_var disp(' TotalNMRB'); end Z = size(Model_Test.M,2); N = size(Model_Test.M,1); NMR = zeros(N,1); for n = 1:N NMR(n)...
% load('particles_omega_spread_corr_Glisa140213_fc1h2.mat') % load('../../data_tokamak/q_profile.mat', 'psi_rank_q1') alphas_mm=alphas_mm_part; phipos_outputG_wrap=wrap2pi(phipos_outputG); omega_outputG=theta_outputG-phipos_outputG_wrap; omega_outputG=wrap2pi(omega_outputG); Ekin_avg=round(mean(Ekin_outputG(:,end))...
function sOut = xSliceBool(sIn,sliceMode,dist_from_bottom, name) if(strcmpi(sliceMode, 'lower')) sliceMode = 'Lower Bit Location + Width'; if(dist_from_bottom < 0) strError = strcat('When sliceMode is ''lower'', dist_from_endpoint must be non-negative; dist_from_endpoint = ', dist_from_endpoint); ...
function mdpidx=ModDeeganPackel(th,w_vec) % ModDeeganPackel computes the modified Deegan-Packel index from the set of winning coalitions. % % Usage: dpidx=DeeganPackel(th,w_vec) % Define variables: % output: % mdpidx -- The modified Deegan-Packel index. % % input: % th -- Threshold to pass a bill (positive ...
%__________________________________________________________________________ % % REEFMOD-GBR MAIN SCRIPT FOR CALIBRATION OF BLEACHING MORTALITY % requires uploading the model in the workspace: % /data % /functions % /outputs % /settings % % Parameters tuned in the script f_single_reef_for_calibration_bleaching % Yves-Ma...
function [ newS ] = shuffle_positions( obj, S, dist_fun ) %% shuffle positions of struct S within grid if ~isfield(S,'x') || ~isfield(S,'y') error('x,y fields required.') end assert( all( size(S.x) == size(S.y) ) ); n = length(S.x); assert( n > 1 ); if ~exist('dist_fun', 'var') dist_fun = ones( obj.Nx, obj.Ny ); ...
function mParameter = OrderParameter(inputPattern,storedPattern,nBits) tmpSum = 0; for pBit = 1:nBits tmpSum = tmpSum + (inputPattern(pBit)*storedPattern(pBit)); end mParameter = tmpSum/nBits; end
function status = submit_files(login, password, method_http, filepath, submitFlag) % This function constructs the system command line to call the java upload % script to interact with RIRE website. The java script logs into the RIRE % website, creates new method there, uploades the files and optionally % submits ...
function sercmd = SerialBatch( cmds ) %PARALLELBATCH combines different commands together (intercaling a "&&") in %order to run them in serial way when they will be submitted to a terminal. % - "cmds": a cell-array (whose size must be larger or equal to 2) % containing the commands to run in a serial way. % Chec...
time_step_values=zeros(NB_PROCESS,1); gamma_TAE_values=zeros(NB_PROCESS,1); gamma_TAE_vD_values=zeros(NB_PROCESS,1); gamma_TAE_local=0; gamma_TAE_vD_local=0; nTAE TOROIDAL_FIELD_DIRECTION=sign(mean(mean(Bphi_XZsmall_map))) PSI_CORE_SIGN=sign(psi_scale(1)) % PSI_STAR_SIGN=sign(psi_star_initial(round(0.5*size_r))) % ps...
%% read binary usgs file fileHandle= fopen('./data/cup95RefEm.sli', 'rb'); cupLib = fread(fileHandle, [50, 38], 'single'); cupSpectrum = [1.990800, 2.000900, 2.010900, 2.020900, 2.030900, 2.040900, 2.050900, ... 2.060900, 2.071000, 2.081000, 2.091000, 2.101000, 2.111000, 2.121000, ... 2.130900, 2.140900, 2.1509...
% Version: Oct. 2004 % Author : Chen Yanover % Overloading size function for the sparse_cell class % % Modified by Hoi Wong (Mar 9, 2009) function varargout = size(sc,varargin) mat_size = size(sc.indMat, varargin{:}); if nargout<2, varargout = {mat_size}; elseif nargout==2, varargout = mat2cell(mat_size, 1, [1,...
% Updates Contents.m of AT directories % For ATROOT: Contents will include subdirectories % For other subdirectories, policiy is defined in case by case ATROOT = fileparts(atroot); OLDDIR = pwd; %Selects directories where to creat a Contents listOfFolderNames={ fullfile(ATROOT,'atmat', 'atdemos'), ... fullfil...
function [qp]=zn2pi(input) % [qp]=zn2pi(input) % Ziegler-Nichols PI controller for processes of 2nd order. % This function computes parameters of the controller (q0, q1, q2, p1, p2). % Controller is based on trapezoidal method of discretization. % Transfer function of the controller is as follows: % % ...
function randomSeq = randdnaseq(N) % returns a random dna sequence of length N randnum = randi(4,[1,N]); for x = 1:N if randnum(x) == 1 randomSeq(x) = 'A'; elseif randnum(x) == 2 randomSeq(x) = 'G'; elseif randnum(x) == 3 randomSeq(x) = 'C'; elseif randnum(x) == 4 randomS...
function [arrayMap electrodeXY electrodeImp] = neuroportArrayData(subjectName) % [arrayMap electrodeXY electrodeImp] = neuroportArrayData(subjectName) % % Omar Ahmed, 2012 % % This function loads in the original impendence values % It searches for an excel spreadsheet named [subject].xls in the neuroport_mapping folde...
%directory to read training data from dir_train = 'lpr-mit-live-normal/'; list_train = dir(dir_train); numSeqTrain = length(list_train)-3; %directory to read anomaly data from dir_test = 'lpr-mit-live-anomaly/'; list_test = dir(dir_test); numSeqTest = length(list_test)-3; A = []; mapObj = containers.Map('KeyType'...
function gen_curves(rows,cols,density) % %generate potential value curves % rw = gen_random_obs(rows,cols,density,25); g2x = [2 5:5:45 50:10:100]; g2y(1:16) = 0; g1x(1:400) = 0; g1y(1:400) = 0; for ri = 1:25 g1i = ri; disp(sprintf('Density = %d%% World Number = %d Lookahead = 2',density,ri)) [w ...
a = [1,2,3,4;5,6,7,8;9,10,11,12;13,14,15,16] for row=1:3 for col= 1:3 if(row>=2&&row<4) if(col>=2&&col<4) a(row,col)=a(row,col)*0; end end end end a
function [crossSpec, x_pwspec, y_pwspec] = obmCrossSpec(x, y, dt, np, ovrlap) % [crossSpec, x_pwspec, y_pwspec] = OBMCROSSSPEC(x, y, dt, np, ovrlap) % % inputs: % - x: vector with evenly spaced data. % - y: vector with same length as x, givent on the same grid. % - dt: sampling period. % - np:...
function [hyp, hyp_orig, px] = hyper_pseudo(x, y, m, steps); % Calculates the hyperparameters and pesudo inputs of a GP model % (Requires Ed Snelson's 'SPGP_dist' library, assumed to be in the path) % % Input: % x: training samples [n, d] % y: target samples [n, e] % m: number of pseudo samples % % Output: % hyp: lo...
% Ce script Matlab automatise la production de resultats % lorsqu'on doit faire une serie de simulations en % variant un des parametres d'entree. % % Il utilise les arguments du programme (voir ConfigFile.h) % pour remplacer la valeur d'un parametre du fichier d'input % par la valeur scannee. %% Parametres %% %%%%%%%...
function plotSuppFig9(save_fig) %PLOTSUPPFIG9 plot boxplots of threshold distributions within FDI % subROIs % % AUTHOR : Aman Aberra if nargin==0 save_fig = 1; end mat_dir = addPaths; % Simulation settings nrn_model_ver = 'maxH'; modes = [1,3,2]; % 1 monophasic, 3 half sine, 2 biphasic MagProX100 pulses laye...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Author: Hamza Bourbouh <hamza.bourbouh@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 out = applyfun(this , fun , dataname , fields) % out = applyfun(this , fun , dataname , fields) wells = this; if nargin < 4 fields = []; end if nargin < 3 || isempty(dataname); dataname = getdataname(this,fields); end if nargin < 2 fun = @mean; end ...
function showSample(X, y, row_size, predicted_y) rand_ix = randperm(size(X,1), row_size*row_size); if (!exist('predicted_y', 'var') || isempty(predicted_y)) showData(X(rand_ix,:), y(rand_ix)); else showData(X(rand_ix,:), y(rand_ix), predicted_y(rand_ix)); endif endfunction
function [X,y] = randomData(data,sub_size) %randomData Select random a subset of data from original data % The data includes both features and y vals % Get proper data set size n_train = sub_size; m_train = size(data,1); % Randomly pick training rows for set i between [1,m_train] rand_rows = round(rand(n_train,1)*(...
classdef Deconvolution %% DECONVOLUTION % $Revision$ % was created $Date$ % by $Author$, % last modified $LastChangedDate$ % and checked into repository $URL$, % developed on Matlab 8.4.0.150421 (R2014b) % $Id$ properties end methods function this = Deconvolutio...
function varargout = lab7(varargin) % lab7 MATLAB code for lab7.fig % lab7, by itself, creates a new lab7 or raises the existing % singleton*. % % H = lab7 returns the handle to a new lab7 or the handle to % the existing singleton*. % % lab7('CALLBACK',hObject,eventData,handles,...) calls the l...
function R=ImportSurferGrd(filename) % ImportSurferGrid reads an ASCII format surfer .GRD file and returns the % data matrix in R. NaN values, which are written as 1.7308+38 in surfer % are replaced with NaN to prevent crashing. % Input: % filename = name of the file to be read, including ".grd" extension % ...
% -*- matlab -*- function corners = bkm_kd_mkcorners(lb,ub,dim); D=length(lb); if D==dim p1 = zeros(D,1); p2 = p1; p1(dim) = lb(dim); p2(dim) = ub(dim); corners = [p1 p2]; else corners = bkm_kd_mkcorners(lb,ub,dim+1); corners1 = corners; corners2 = corners; corners1(dim,:) = lb(dim); corners2(dim,...
function [trapArea,OutTrueError,ErrorEst] = TrapezoidArea(x1,x2,y1,y2,fun,df2) trapArea=(1/2)*abs(x2-x1)*(abs(y1)+abs(y2)); OutTrueError=abs(integral(@(x)fun(x),x1,x2)-trapArea); ErrorEst=abs((x2-x1)^3/12*fminbnd(@(x) -1*df2(x),x1,x2)); end
% Variables expected to exist in workspace: % inputpath - Full path to the folder with feature and label files. % numcores - Scalar number of CPU cores to use. % Add codes to path. addpath(genpath('sthlm3_preprocessing')); addpath(genpath('sthlm3_classification')); % Settings. settings.plottype = 'tsne'; se...
function [num10] = bigger10 %UNTITLED Summary of this function goes here % Detailed explanation goes here prompt = 'What is your Number?'; nEingabe = input(prompt); if nEingabe == 10 num10 = 'Yeah it is ten'; else if nEingabe > 10 num10 = 'bigger then ten'; else num10 = 'lower then ten';...
classdef copse_force_CPlandrel < copse_force %CP land burial ratio doubles in permo-carboniferous (COPSE) properties %COPSE5_14 k_begin_Carb_yr = -355000000; % increase period begins k_end_Carb_yr = -290000000; % decrease period begins %The code then applies a ram...
figureTitle = ['Observation on ' ... ' the importance of image phase']; % figure(figureIndex), figure('Name', figureTitle,'NumberTitle','off'), plotIndex = 0; plotRowSize = 1; plotColSize = 3; titleStr = ['image1 amplitude' newline 'With Image2 phase realOnly']; plotIndex = plotIndex + 1; imagePlot...
function batch_fitting(roifile, protocol, model, outputfile, poolsize) % % function batch_fitting(roifile, protocol, model, outputfile, poolsize) % % This function does batch fitting to the voxels in an entire ROI created % with CreateROI function. % % This function supports parallel computation on multiple CPUs by tak...
% This code is used to extract skeletal block structures for a human posture % % Copyright by Meiyu Huang, 2018 % Qian Xuesen Laboratory of Space Technology, % China Academy of Space Technology, Beijing, China % Contact huangmeiyu@qxslab.cn function [skeletalblocks,skeletalblocksdepth,skeletonjoints,skeletonjo...
function [ found_food,re_seg ] = searchInSeg( seg_indx,squirrel1,n,thres ) global visual_run seg cache found_food = 0; re_seg = seg_indx; seg_cent = [seg(seg_indx).c.x,seg(seg_indx).c.y]; squirrel1.move2Pos(seg_cent,100); %%squirrel Moved to interested seg; [pos_w,~]=seg(seg_indx).generateVertices(n,thres) %this retu...
function packet = getPacket(size, b) %function packet = getPacket(size) %Returns a random array of 1's and 0's of length size packet = floor((2^b)*rand(1,size));
classdef (Enumeration) TYP_RES_ACTIVATION_S < Simulink.IntEnumType enumeration RES_UNACTIVATED(0) RES_UNDER_ACTIVATION(1) RES_ACTIVATED(2) end end
function [ normq ] = normq( q_in ) %UNTITLED Summary of this function goes here % normalize a matrix of quaternions normq = zeros(size(q_in)); for i = 1:length(q_in) psi = q_in(4,i); normq(4,i) = cos(psi/2); normq(1:3,i) = sin(psi/2)*q_in(1:3,i)/norm(q_in(1:3,i)); end end...
%========================================================================= % % Simulation example to generate the sampling distributions the MLE % and OLS estimator of a regression model with heteroskedasticity. % %========================================================================= function hetero_sampling...
function [ handle ] = LinSpectrogram( x, Fs, ms, contrast ) % [ handle ] = LinSpectrogram( x, Fs, ms, contrast ) % Create a magnitude spectrogram with linear frequency % The size is set to be useful for 2 column papers. % x = input waveform % Fs = waveform sampling frequency % ms = window period in ms % contrast = ...
%% n = 300; y0 = 36; % mean of prob distr deg sigma_y = 4; % real width of prob distribution deg %A = sqrt(2*pi)*sigma_y*56; % amplitude factor for prob distribution sigma_exp = 1.5; % experimental error y = normrnd(y0, sigma_y, n, 1); % prob distribution values dy = normrnd(0, sigma_exp, n,1); % experimental erro...
classdef logger properties end methods function obj = logger() end function log(obj,output) fprintf(output); end end end
figure hold on plotHeight = 0; lineWidth = 2; rushOutLineColor = 'r'; PlotObstacle(simParam.environment.obstacle, plotHeight); PlotLane(simParam.environment.lane, plotHeight); plot( result.state(:,1), result.state(:,2), 'o' ); for itrTime=1%length(time);%1:20:80;%length(time) trajectoryGlobalLattice=result.deb...
data = exp(cumsum(randn(1000, 4)/10, 1)); %% Test Monthly m = tseries(mm(2000, 1), data); fm = apct(m); actData = fm.Data; expData = 100*((data(2:end, :)./data(1:end-1, :)).^12 - 1); assert(isequal(actData, expData)); actStart = fm.Start; expStart = mm(2000, 2); assert(isequal(actStart, expStart)); %% Test Monthly...
function circle(center,radius) t=linspace(0,2*pi); plot(real(center)+radius*cos(t),imag(center)+radius*sin(t)); axis('equal'); end
function [ ] = vicsek(N,R,n,v_0,l,T ) % This function implements the Vicsek model for biological aggregations % in the way it appears in the paper 'Topological % Data Analysis of Biological Aggregation Models'. % %Input: N is the number of particles % R is the interaction radius % n is the noise % ...
% Graph of Neville theta functions. % Fig 20.14 from Beebe - The Mathematical-Function Computation Handbook, % Springer 2017 x = -8:0.01:8; qq = [0.05, 0.25, 0.5, 0.75]; for n = 1:4 q = qq(n); figure(n) clf hold on plot(x,NevilleThetaS(x*elK(ielnome(q)),q),'LineWidth',1.5) plot(x,NevilleThetaC(...
function map = loadarraymapstruct load arraymap map.azimuths = azimuths; map.dachannel = dachannel; map.elevations = elevations; map.mpxchannel = mpxchannel; map.speakernum = speakernum; map.termbank = termbank; map.termnum = termnum;
function wt_modulationIndex(hilbertTouch,hilbertWhisking,selectedCells) fieldsToCompare = fields(hilbertTouch.R_ntk.allTouches); figure(23);clf for g = 1:4 figure(23);subplot(2,2,g) currTArray = hilbertTouch.R_ntk.allTouches.(fieldsToCompare{g}); currWArray = hilbertWhisking.R_ntk.(fieldsToCompare{g}); ...
clear;clc;ca net = alexnet; orig = webread('https://media.bakingmad.com/app_/responsive/BakingMad/media/content/Recipes/Tarts/Apple-tart/1-Apple-tart-rectangle-web.jpg?w=840'); im = imresize(orig,[227 227]); prediction = classify(net,im); imshow(orig); title(char(prediction)); % Get all layers of network layers = ne...
fid=fopen('gallery.txt','rt'); list=textscan(fid,'%s %d'); name=list{1};label=list{2}; count=1; img_dir='/home/scw4750/github/IJCB2017/liangjie/zip/multipie_augment_90_pose/enlarge_multipie_stitch/gallery'; out_dir='/home/scw4750/github/IJCB2017/liangjie/alignment/multipie_augment_90/enlarge_mulitpie/gallery'; for i=1:...
function [ points_image, new_err ] = minimisation_erreur_projection( points_monde, points_image ) %% Minimisation de l'erreur de projection d'un problème % % INPUT : [points_monde, points_image] où points_monde est une matrice % N*3 de points dans le monde, et points_image est une matrice de N*2 % points dans le plan ...
function [Vo]=DesOffSet(v) #esto solo sirve si tenes asegurado q la funcion es simetrica respecto del 0 #en el caso de usarla para otra cosa del mismo estilo, habria q tocar el valor maximo de i #lo q hace esto es dividir tu intervalo en intervalos mas chiquitos y a cada uno los centra respecto del 0 #restandole el...
function [dX] = plant_TS_X_q(t, X, U, X0, U0, A, B, n, U0_glob, activ) %fuzed by U(1) % n > 1 dX = [0; 0]; act_sum = 0; for i = 1 : n if i == 1 act_sum = act_sum + activation(activ(1,i), activ(2,i), X(2), -inf); elseif i == n act_sum = act_sum + activation(activ(1,i), activ(2,i), X(2), inf); ...
function [score] = likelihood(a, b, p, Xtest) [N1,T] = size(Xtest); [K,M] = size(b); stemp = zeros(N1,1); Alpha = Forward(a, b, p, Xtest); for n =1:1:N1 atemp = Alpha{n,1}; for i = 1:1:K stemp(n,1) = stemp(n,1) + atemp(T,i); end stemp(n,1) = log(stemp(n,1)); end score = stemp; end
function [pm,chi2,reshist] = findLSmin_lite(cfun, p0, varargin) %[pm,chi2,reshist] = findLSmin_lite(cfun, p0, varargin) %[pm,chi2,reshist] = findLSmin_lite(cfun, p0, delta_p) %[pm,chi2,reshist] = findLSmin_lite(cfun, p0, delta_p, LMoption) %This is a wrapper of the least square code "lemafit.m" (X. Huang, 2003) which i...
clear all ; close all [tetanic,freq1] = audioread('C:\shared\sounds\Tetanic_13Hz_1000Hz_-6dBFS_0.05s.aiff'); [hz750,~] = audioread('C:\shared\sounds\750hz_sinwave_50ms.aiff'); [hz1000,~] = audioread('C:\shared\sounds\Single_sound_1000Hz_-6dBFS_0.05s.aiff'); tetanic(end:end+1100) = 0; nrchannels = 2; ...
function model = testUserParamsToMatrix() %TESTUSERPARAMSTOMATRIX Test for userParamsToMatrix % %See also userParamsToMatrix rng(100, 'twister') model = getTestData(true); userId = 1; u = getUserParams(userId, model); [Xres, index] = userParamsToMatrix(u, userId, model); X = getUserData(userId, model); assert(all(all(X...
clear; clf; % Introducerea punctelor definite % - vectorul x cu abscisele punctelor x=0:5; % - vectorul y cu ordonatele punctelor y=[0 0.5 4.5 0 2 0]; % Generarea vectorului xx cu pasul fin xx=0:0.1:5; % Reprezentarea grafica cu subplot-uri h=subplot(2,2,1) % Precizarea positiei si m...
function [codeBook, compressionRatio, spaceSaved, timeElapsed, entropy, T] = dynamicHuffman(charcount, alphabet,message,file) %% Setup % Expects charcount from souceCodingAlgo.m % Sort ascii codes by their frequency [codeFrequency, ~] = sort(charcount,'descend'); nonZeroElements = length(find(codeFrequency)); sortedCod...
function [] = Q9d() %UNTITLED Summary of this function goes here % Detailed explanation goes here [array_1,array_2]=Q7(); n=5; sum_avg_degree_1 = 0; sum_avg_degree_2 = 0; for i=1:20 sum_avg_degree_1 = sum_avg_degree_1 + ((array_1(i)*2)/n); sum_avg_degree_2 = sum_avg_degree_2 + ((array_2(i)*2)/n); ...
function x=Katz(adj) x = (eye(n)-(beta/max_eig)*adj)\ones(n,1); % http://guettel.com/rktoolbox/examples/html/example_networks.html
function tune = intfft(X,varargin); %INTFFT Calculates the tune from interpolated FFT of the trajectory. % INTFFT(X) X must be a column vector. % If X is a matrix - each column is treated as % a separate trajectory % INTFFT(X,GUESS,DELTA) searches for peaks in the FFT spectrum % only within the range (X-DELTA ...
function [y] = fFourthDerivadaDF(f,x,h) % Esta funcion encuentra la PRIMERA DERIVADA mediante la ecuación: % f'(x0) = (-f2+8f1-8f(i-1) +f(i-2) )/12h % PARAMETROS DE ENTRADA % (f) = 3*x.^4+5*x.^3-3*x.^2+8*x-12 % (x) = valores del eje x % (h) = numero de incremento % PARAMETROS DE SALIDA % [...
% INTERSECT_OTHER Given a triangle mesh (V,F) and another mesh (U,G) find all % pairs of intersecting faces. Note that self-intersections are ignored. % % [IF] = intersect_other(V,F,U,G,'ParameterName',ParameterValue, ...) % [IF,VVAB,FFAB,JAB,IMAB] = intersect_other(V,F,U,G,'ParameterName',ParameterValue, ...) % % Inp...
% Clear workspace and command window clear, clc format long % Set the loop variable loop = true; % Ensures that the menu reopens when finished with subprogram while loop % Opens dialogue box answer = questdlg( ... 'Please select an option', ... 'SIMION Monte Carlo Simulation', ... 'Create Dat...
function WindowCoeff = WindowSelect( WindowType,Length ) %UNTITLED2 此处显示有关此函数的摘要 % 此处显示详细说明 if Length<1 error(message('Error! Invaild Input Length @ Function:"WindowSelect.m"')); end if strcmp(WindowType,'Hanning')||strcmp(WindowType,'hanning')||strcmp(WindowType,'Hann')||strcmp(WindowType,'hann') WindowCo...
% written by professor Jay McClelland function [ choice ] = choose(strengths) %choose one of n alternatives according to it's strength % if any(strengths == Inf) % % if the strength for some elements are INF, just randomly pick one % choice = find(strengths == Inf); % if numel(choice) > 1 % ...
%% -- FUNCTION TO OBTAIN THE MODEL HISTOGRAM AND THE AVG DISTANCE -- %% function [ avgskin, avgback, PS_avg, PB_avg ] = avg(skin2D,back2D,im_num) % - DECLARATION OF VARIABLES - % avgskin = zeros(255,255); avgback = zeros(255,255); Pskin = 0; Pback = 0; % - CALCULATION OF THE AVERAGE HISTOGRAM - % for i = ...
%% Financial Model %% Variables M = zeros(1,51); % Money generated by electricity P = zeros(1,51); % Profit C = 0.14169; % Average price of electricity in Ontario is $0.14169/kWh I = 1.0142; % Average annual increase of electricity price is 1.42% S = 871.39; % Money saved annually for...
function f = yellowSquare(~) %%%%%%%%%%%%% % Build Image %%%%%%%%%%%%% % top left f1 = false(128,128); % top right % % % Gives yellow scales f21 = 1:128; f22 = f21+1; f21 = mod(f21,2); f22 = mod(f22,2); f2 = repmat([f21;f22],64,1); % % does not give yellow scales % z = binarySquare(32); % f2 = repmat(z,4,4); % bo...
function [docNode]=addGeometryLevel_TXT(docNode,FEB_struct) %% disp('Adding Geometry level'); rootNode = docNode.getDocumentElement; geometryNode = docNode.createElement('Geometry'); geometryNode = rootNode.appendChild(geometryNode); %% Adding node field disp('----> Adding node field'); parent_node ...
function rgb = brown rgb = [0.64705, 0.1647, 0.1647]; end
% Assignment 3 % Maarten Boon 10764399 function h = hough ( im , Thresh , nrho , ntheta ) % HOUGH % % Function takes a grey scale image , constructs an edge map by applying % the Canny detector , and then constructs a Hough transform for finding % lines in the image . % % Usage : h = hough ( im , Thresh , nrho , nthet...
%Load GUI data for desired subject and training day %Change lengths of for loops to fit size of GUI Data FirstThird = {}; LastThird = {}; PostSleep = {}; for i=1:40 FirstThird = [FirstThird; {data{i,:}}]; end for i=81:120 LastThird = [LastThird; {data{i,:}}]; end for i=121:180 PostSleep = [PostSle...
function val = cone_filter_inv_right_cone(X, leaflet) % % Inverts the cone filter at X % % Input % xi, eta % Leaflet Struct with cone filter parameters % % Output % X Vector of components % % Copyright (c) 2019, Alexander D. Kaiser % All rights reserved. % % Redistribution and ...
%Generalization error vs size of training set for naive Bayes classifiers %and logistic regression. Code by Matthew Dunham domain = 0:0.01:10; NB = @(x)x.^(-0.5); LR = @(x)(8./(x.^0.8))-2; linewidth = {'LineWidth',3}; hold all; set(gca,'XTick',[],'YTick',[],'FontSize',16); axis([-0.1,10,-1,10]); plot(domai...
function [idx,stats] = find_most_violated(W, X, Y, stats) max_violation = -Inf; num_viol = 0; num_constraints = 0; total_violation = 0; margin = 0; for i = 1:size(X, 1) for j = 1:size(X, 1) for k = 1:size(X,1) if ((Y(i) == 1) && (Y(j) == 1) && ...
%% vidtracks.m description % %**Update May 06, 2009** % %Function to take a 3D image array with frame indicies to a 4D image array %in color with frame indicies keeping the original images in monochrome %while adding colored pixels following the objects in the images and %(optionally) leaving 'trails' or the col...
% [Results] = CSC_CellCounting(Mask, opts) % is a function of the CSC package that counts cells in a binary image, % where the foreground represents segmented cells. % This function implements a counting process that is based on distance % transform and curvature approximation. For mor details about this % al...
% Resolución de un Campo de Direcciones % FECHA: 18 de Mayo 2021 % ED: y' = sin(x+y) clc, clear all; f = inline('sin(x+y)', 'x', 'y'); [x, y] = meshgrid(-3:0.5:3, -3:0.5:3); [n, m] = size(x); dx = ones(n,m); dy = f(x, y); quiver(x, y, dx, dy)
function count = count_AC(A_C,i,j) [a,~] = size(A_C); count = 0; for ii=1:a if A_C(ii,1) == i && A_C(ii,2) == j count = A_C(ii,3); end end
function [LH, probSpike, V, mean_predictedSpikes, RPE] = ott_gRW_RPE_curr(startValues, spikeRate, rewards, timeLocked) % firing rate only correlates with current reward; no real learning happens slope = startValues(1); intercept = startValues(2); sigma = startValues(3); rateParam = slope*rewards + intercept; ...
%% script_name % The |script_name.m| script ... TODO: Add description % % NOTES: % % NECESSARY FILES AND/OR PACKAGES: TODO: Add necessary files % % +somePackage, someFile.m % % AUTHOR: % FULL_NAME (WEBSITE) % % VERSION: % Created DD-MMM-YYYY %%
function [s,fval,exitflag] =... main_single_optimization(objective,... A_eq, b_eq, A_ineq, b_ineq, lb, ub) % This script transfer the respective input variables into an optimization % problem and sets the options of the optimization problem. %% check lower and upper bounds - set to default values if i...
function particle_pose = particle_filter(no_of_particle, particle_pose,U,dt,feature,Landmark_pos, C) particle_weight = ones(1,no_of_particle); for j = 1:no_of_particle %particle new position particle_pose(:,j) = sample_motion_model_velocity(particle_pose(:,j), U, dt); ...
%takes in a file name and the desired columns from the file in an array %returns the data from the specific columns of the file function data=txt2mat(fname,cols) data=textread(fname,'','headerlines',21); data=data(:,cols);
function [index] = findIndices(vector,target) % Finds the index of a target value in a vector y=1; index=0; % establish array 'index' of 0 values for i=1:1:(length(vector)) if vector(i)==target index(y)=i; % first value of array is i y=y+1; % next value of array is the next i end...
function Q = nevilles_mod(xpts,ypts,xeval) % Vandana Anand % MA 3457 / CS 4033 %Homework 2 Problem 3 % % Function using Neville's method to generate Lagrange interpolating % polynomials at xeval that recursively pass through the points (xpts,ypts) % % Input: xpts = x points % ypts = y points = f(xpts) % ...
function candycrush %CANDYCRUSH to run the eponymous game % % 2019, Alexander Heimel n_x = 6; n_y = 8; n_c = 5; board = zeros(n_y,n_x,'uint8'); figure show_board(board,n_c) changed = true; while changed changed = false; [board, changedg] = apply_gravity(board); [board, changedf] = fill_top_row(board,n_...
function load_documentation_figure(main_figure) pos_fig=[0.2 0.1 0.6 0.8]; doc_fig=new_echo_figure(main_figure,... 'Units','normalized',... 'Position',pos_fig,... 'Name','ESP3 Documentation',... 'Resize','on',... 'Tag','esp3_doc',... ...
%%% Preprocessing script for MNI dataset clear; % INPUT the names of the files into the structure for NIAK path_data = '/sb/scratch/pbellec/mni_mci/'; path_mnc = [path_data 'raw/']; csv_file = [path_mnc 'model_mni_mci.csv']; [tab,labx,laby]=niak_read_csv(csv_file); nb_subjects = length(labx); for num_subj = 1:nb_s...
function [P_4, T_4] = fourth_action(P_0, T_3, angle) %function rotates a cube for 90 degrees of the world coordinate %system on its own Z axis %rotation matrix T_rot = [cosd(angle) -sind(angle) 0 0; sind(angle) cosd(angle) 0 0; 0 0 1 0; 0 0 0 1]; ...
function Model = Model_Suspended_Load(id,dt,type,initial,varargin) % model class demo : quaternion model with 13 states if ~isempty(varargin) Setting = varargin{1}; end Model.type="Suspended_Load_Model"; % class name Model.name="load"; % print name Setting.dim=[25,4,16]; Setting.input_channel = ["f","M"]; ...
%% % \documentclass[12pt]{article} % % \title{ODEbox: A Toolbox for Ordinary Differential Equations\\ % Getting Started with the ODEbox} % % \author{Matthew Harker and Paul O'Leary\\ % Institute for Automation\\ % University of Leoben\\ % A-8700 Leoben, % Austria\\ % URL: automation.unileoben.ac.at\\ % \\...