text
stringlengths
8
6.12M
function [IRF,FVD,M,tot_weights] = pop_analysis(model,settings); % Compute impulse responses and forecast variance decompositions % implied by ABCD representation of model %---------------------------------------------------------------- % Preparations %----------------------------------------------------------------...
function res = opdracht_7_versie_1_CHECK(apStudentSol) res = 0; %%========== PLACE SOLUTION IN COMMENTS HERE %% Opdracht 7 % % % % % % % Gegeven onderstaande script met een bijzondere vector. % % % % % % % Vraag m.b.v. een standaard Matlab functie de afmetingen op van de % % % % % % % vector 'matx'. % % % % % % % Deze...
function variation_dim() %UNTITLED4 Summary of this function goes here % Detailed explanation goes here [x,y] = ginput(2); plot(x,y,'-*r'); end
v1 = [1 0 0]; v2 = [0 1 0]; u = [0.5 0.5 0]; % u = [1 0 0]; [V, c] = plane_to_subspace([1,0,0]',[0,0,0]'); % u = [-1,-1,0]; u = u./norm(u,2); rad2deg(acos(g_cos_distance_1d_2d(u, V(:,1), V(:,2), 1.1)))
width=4; ssq=1; [x,y]=meshgrid(-width:0.1:width,-width:0.1:width); dgau2D=-x.*exp(-(x.*x+y.*y)/(2*ssq))/(pi*ssq); surf(dgau2D);
function [RR, bestParam] = RRCVTuning(X, y, trainSize, numFolds, reg) % RRCVTuning exectues and tunes ridge regression for a range of possible % regularisation parameters (reg) using cross validation % % Exepcts the additional mandatory inputs: % X= matrix of predictors % Y= corresponding vector of responses (...
clear; x=importdata('data.txt'); minerr=inf;hc1=0;hc2=0; tic;ahcrou1=0;ahcrou2=0;ahcrou3=0; for hcrou1=linspace(1.14e-6,1.18e-6,4) for hcrou2=linspace(1.85e-6,1.88e-6,4) for hcrou3=linspace(4.85e-7,4.95e-7,4) y=model_function(hcrou1,hcrou2,hcrou3); st=find(y(:,1)==19); ...
%% Wrapper function to simulate the experiment for diff state spaces %% rng(2); withinChunkUpdate = 0; stateSpace = [3 6 9]; chunk = [3 2 1]; beta = [0.5 1 1.5 2 2.5]; numBetas = length(beta); chunk_freq = 0.1; agent.lrate_V = 0.2; agent.lrate_p = 0.01; agent.lrate_theta = 0.2; agent.test = 1; beta = [0.5 1 1.5 2 2....
function Process_multi_daq_Song(folder,song_range) %function Process_multi_daq_Song(folder_containing_multiple_daqs,song_range) %This function allows you to analyze mutiple daqs in a folder and returns %output in separate folders. if strcmp(folder(end),'/') == 0 folder = [folder '/']; end dir_list = dir(...
data = audioread('go.au'); figure(1) n = linspace(0,(length(data)-1)/8000, length(data)); plot(n,data) title("'go' utterance") xlabel('Time(s)') ylabel("'go' utterance") f = linspace(0, 8000, 512); %f1 = (0:511)/512*8000; X = DFTwin(data,405,2720,512); %X = DFTsum(data,405,2720,512); figure(2) subplot(2,1,1...
function dir_ls = filter_to_time_series(dir_ls) %FILTER_TO_TIME_SERIES Takes in a dir struct, outputs the same dir % struct with all the folder names that includes % 'time_series' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%Main ...
x=0:1:15; x1=1*(x>=1&x<=10); x2=1*(x>=2&x<=10); N1=length(x1); N2=length(x2); x3=conv(x1,x2); n1=0:1:N1+N2-2; subplot(3,1,1); stem(x,x1); xlabel('X'); ylabel('x1(x)'); title('signal x1(n)'); subplot(3,1,2); stem(x,x2); xlabel('x'); ylabel('x2(x)'); title('signal x2(x)'); subplot(3,1,3); stem(x,x3); xlabel('x'); ylabel(...
clear [slices1, left1] = pizzaParty(15, 3); % slices1 => 1 % left1 => 9 % Output variable(s) should be identical to that produced by the solution file % [slices2, left2] = pizzaParty(100, 25); % slices2 => 2 % left2 => 0 % Output variable(s) should be identical to that produced by the solu...
function X = GaussElimination(A,B) % GaussElimination: Gauss elimination with pivoting (partial) % input: % A = coefficient matrix % B = right hand side vector % output: % X = solution vector [row,column] = size(A); % NOTICE if row ~= column error('Matrix A must be square'); end newC...
function img_dilate = remove_noise(img) img_dilate = imopen(img, strel('disk',5));
function network = lcod_train( X, Wd, Zstar, alpha, T, num_of_classes, learning_rate, max_iter, conv_thres, conv_count_thres, error_check_iter ) %TRAIN Summary of this function goes here % X: training input signal nxm (m input of size n) % W: dictionary nxk (k basis vector size n) % Zstar: kxm (m sparse code with coeff...
%% set data folder if ispc dataroot = 'C:\Users\rhc307\data'; else dataroot = '/data/raeed'; end cdslib = fullfile(dataroot,'cds-library'); % files = dir(fullfile(cdslib,'*COactpas*')); % names = vertcat({files.name})'; names = {... 'Han_20171206_CObumpcurl_basel...
function f=getsltc(path,slno,tlocs,imlocs,imsize,detord,ext) % Usage ... f=getsltc(path,slno,tlocs,imlocs,imsize,detord,ext) if nargin<5, imsize=[64 64]; end; if nargin<7, ext=''; end; if nargin<6, detord=0; end; if length(tlocs)==1, tlocs(2)=tlocs(1); tlocs(1)=1; end; for m=tlocs(1):tlocs(2), a=getslim(...
% Input: a structure with any subset of the following fields (a user will be prompted % for whatever details that are not supplied) % .animal - a string % .series - a string or a number % .selectedExperiments - a cell array of strings or a column vector...
%根据主题产生文档 clear all;close all;clc; imsize = 5;%图片尺寸 noiselevel = 0.01;%加入噪声 numbarpermix = [0 ones(1,3)]/3;%什么用途 % numbarpermix = [0 ones(1,2)]/2; numcluster = 2; numgroup = 4;%文档个数 numdata = 20;%每篇文档中单词数目 % load trainss [trainss,thetas] = genbars2(imsize,noiselevel,numbarpermix,numgroup,numdata,numcluster);
clc clear close all labeltsize=35; fw = 'normal'; %%是否加粗斜体之类 fn='Times New Roman'; linewide1=3; mkft = 15; load 1K.mat figure(1); hold on plot(SNRout,Pd_PGLRT_mc,'k-o','linewidth',linewide1,'MarkerSize',mkft) plot(SNRout,Pd_PRAO_mc,'r-x','linewidth',linewide1,'MarkerSize',mkft) plot(SNRout,Pd_PWALD_mc,'b-x','linewidth...
function threshs = getIntelligentThresholds( vals ); threshs = unique(vals) - 1e-16;
function [ new_pos ] = LOCAL_SEARCH( pos, Xmin, Xmax ) % Mutates the integer part of the particle global proc global ps global deepso_par new_pos = pos; % switch proc.system % case 41 % % Select which type of variables will be mutated % prob = deepso_par.localSearchContinuousDiscrete; % if r...
%pStarSolver.m %Purpose: uses Newton's method to iteratively compute the pressure in % Regions 3 and 4 of the exact shock tube solution %Parameters: startVal initial guess for p-star % tol the tolerance value for Newton's method % (iterations will stop when the abso...
function Flag = isVAR(X) % isVAR True if variable is VAR object. % % Syntax % ======= % % Flag = isVAR(X) % % Input arguments % ================ % % * `X` [ numeric ] - Variable that will be tested. % % Output arguments % % * `Flag` [ `true` | `false` ] - True if the input variable `X` is a VAR % ...
function f = curry(fn,varargin) args = varargin; f = @(varargin)fn(varargin{:},args{:}); end
function [] = SimulateAdaptvCurrent(simfunction,PopParams_in,Irange,numI,brange,numb,ii,bb,varargin) %UNTITLED2 Summary of this function goes here % Detailed explanation goes here % %INPUTS % simfunction simulation function. function should be passed through % as @SimFunctionName. And should ...
function [pvals,tvals]=kjm_natbar(data,dt_cols,bar_off) % this function makes modified vertical barplots that also show individual % datapoints, with errorbars showing the standard error of the mean % it expects: % data{M} in cell array format, with each of M array elements containing a column vector % dt_cols...
classdef Processor < ether.process.Node %PROCESSOR Summary of this class goes here % Detailed explanation goes here properties(Constant) Unknown = 1; ImageVolume = 2; ProblemResult = 3; end properties(SetAccess=protected) targetType = ether.process.Processor.Unknown; end properties(SetAccess=private...
% Read image s_dir = pwd; cd Images; X1 = imread('aivazovsky78g.tif', 'tif'); [N, M] = size(X1); cd(s_dir); % resample N2 = N/2; M2 = M/2; X2 = X1(1:2:N, 1:2:M); % display the image subplot(2, 2, 1); imshow(X2); title('downsampled image'); % reconstruct image X3 = X2(ceil(0.5:0.5:N2), cei...
function [rate_all,peakrate,nofailrate,mean_holdingvoltage,mean_r_m,std_r_m,mean_time_constant,std_time_constant,... mean_c_m,std_c_m,numberspikes,thresholds,imp,pulse_duration,pause_duration,delay,increments,currents,pf_all,std_noise]=... fi_rate_old(module,recdate,cellnum,trials,points,sample_rate,shouldplotF...
% use cylindrical coordination function [imgOut, descriptor, alpha] = imgWarp(img, description, f) [row, col, channel] = size(img); col_warped = 2 * ceil(f * atan(col / 2 / f)); imgOut = zeros(row, col_warped, channel, 'uint8'); alpha = zeros(row, col_warped, 'uint8'); for r = 1:row for c = 1:col r_tmp = row ...
function Prediction = CorrFilter_SVR_LOOCV(Subjects_Data, Subjects_Scores, CoefThreshold, Pre_Method, ResultantFolder) % % Subject_Data: % m*n matrix % m is the number of subjects % n is the number of features % % Subject_Scores: % the continuous variable to be predicted % % Pre_...
classdef h5_wc_reader < handle properties sr min_index max_segments raw_filename sr_infile t0_segments max_index segmentLength spikes_file end methods function obj = h5_wc_reader(par, raw_filename) obj.max_segments = [];...
%% Housekeeping clear %% Run Simulink Model Simulation_Time = 300; out=sim('Dynamic_Model',Simulation_Time); %% Import Data from Simulink % Data for Plot 1 x1 = out.tout; y1 = out.simout.signals.values; % Data for Plot 2 %L = length(y1(40000:end,1)); x2 = out.tout; y2 = out.simout2.signals.values; % Data for Pl...
% Dylan Jackson % ME 3165-308 % 2/12/2018 % Thomas Algorithm clear;clc;close all % Domain h=.25; n=100; dy=h/n; U=zeros(n+1,5); rho=1000; L=.1; % Boundary conditions U(1,:)=0; U(n+1,:)=.01; % Pressure Gradient dpdx=[-1e-3,-.5e-3,0,.5e-3,1e-3]; vis=8.9e-4; b=ones(n,5)*-2; d=ones(n,length(dpdx)...
% Generate n samples from a multivariate normal distribution using the % provided mean (mu) and covariance matrix (sigma). function samples = gen_samples(mu, sigma, n) dim = numel(mu); % Sample the unit normal distribution samples = sample_unit_normal([dim, n]); % Color noise using inverse whiteni...
[curXs, curYs] ... = meshgrid(coverageMapsEHataXLabels{idxH}, ... coverageMapsEHataYLabels{idxH}); [curLats, curLons] ... = utm2deg(curXs(:), curYs(:), ... repmat(UTM_ZONE, length(curXs(:)), 1)); %% hCurPLMap = figure; hold on; hTxs = plot3(cellAntsLatLon(:,2), cellAntsLatLon(:,1), ... ones(length(...
% small_parallel_STEP_in.m ADVISOR 2003-00-r0116 input file created: 22-Feb-2014 22:22:02 global vinf vinf.name='small_parallel_STEP_in'; vinf.drivetrain.name='parallel'; vinf.fuel_converter.name='FC_SI41_emis'; vinf.fuel_converter.ver='ic'; vinf.fuel_converter.type='si'; vinf.torque_coupling.name='TC_DUMMY'; vinf....
classdef Constants %CONSTANTS Temporal constants properties(Constant) DAYS_IN_LEAP_YEAR = 366; DAYS_IN_YEAR = 365; HOURS_IN_DAY = 24; MINUTES_IN_HOUR = 60; SECONDS_IN_MINUTE = 60; end methods(Static) function dayFraction = stepToDay(s...
function pca_on_feature(X) % Scaling X = bsxfun(@minus, X, mean(X)); X = bsxfun(@rdivide, X, max(abs(X))); [coeff, score, latent] = princomp(X); cumsum(latent)./sum(latent)
% 2. Target constant, speed not constant function [CFG, DATA] = EB2(CFG, DATA, test_idx) [CFG, DATA] = EB_Core(CFG, DATA, test_idx);
function fe = exact_pde1d(X,t,c,nu,L) % Calculate exact solution of f profile a = (X-c*t)/(2*nu*t)+L; b = 1/(4*t)+1; fe = 1/sqrt(4*pi*nu*t)*exp(-(X-c*t).^2/(4*nu*t)-L^2/4+a.^2./(4*b))*sqrt(pi)./sqrt(b); end
function ret = fsvolume_crop(subjectDir) % NAME % % function ret = fsvolume_crop(subjectDir) % % ARGUMENTS % % subjectDir in (string) the "root" directory to process % % ret out (int) Zero if no error has occurred % One if some error has occurred. % % DESCRIPTION % % 'fsvolume_crop' in its simplest sense crops a >...
%addpath(genpath(pwd)); run setup.m
function [SimulateResult, ExitFlag] = SIMULATE_TRANS(VfiTransResult, SimulateSsResult, Params, Rt, Wt, Trt, Tsst) % Taxing Human Capital % @Author: Wenlan Luo % Simulate economy, return distribution % unpack structure v2struct(Params); v2struct(VfiTransResult); r = []; w = []; Tr = []; Tss = []; % write TauGs to empt...
% Newman-Girvan community finding algorithm % source: Newman, M.E.J., Girvan, M., "Finding and evaluating community structure in networks" % Algorithm idea: % 1. Calculate betweenness scores for all edges in the network. % 2. Find the edge with the highest score and remove it from the network. % 3. Recalculate betweenn...
function [n_epitope, n_snap, t, traj_array] = load_TcellDat(filepath) % This function reads in data from the file Tcell_traj.dat found in the % directory 'filepath'. Tcell_traj.dat is producted by the Population % Dynamics code. It is a binary file that contains the time step, number of % naive, effector, and memory ce...
for i = 1:10 e(i) = [10^(-2*i)]; end for i=1:10 A = [e(i) 1 1 1]; b = [1+e(i);2]; z = LUFact(A,b); firstrow(i)= z(1); secondrow(i)=z(2); end; firstrow secondrow
% MLE of the Mixed Matern model clear % HEALPix grid [theta, phi, n] = HEALPix_sampling(2); % convert coordinates [x, y, z] = trans_coord(theta, phi); % initial computation [h_mat, r, P_cell, Q_cell, A_cell] = init_comp(x, y, z, n, theta, phi); % generate samples p = 2; % set the same seed rng('default') samples =...
echo off clear global k m M g l g=9.81 ; k=4 ; m=1 ; M=8 ; l=10; options = odeset('RelTol',1e-10); [t,theta] = ode45(@simple_pendulum_deriv,[0:0.1:40],[6 0 pi/4 0], options); [t,theta2] = ode45(@simple_pendulum_deriv,[0:0.1:40],[6.001 0 pi/4 0], options); fig1=figure('Name','Representation temporelle du mouvemen...
% judgment = IsInBounds(matrix,point) % % Tests whether N-dimensional vector of coordinates POINT is within the % bounds of matrix MATRIX -- i.e., whether it is a valid index for the matrix. % % Returns 1 if POINT is a valid index for MATRIX; returns 0 if POINT is % outside the bounds of MATRIX or if POINT is not...
function[datos_x_filtrado, datos_y_filtrado, mediana, sigma] = filtro_pendiente_nula(datos_x, datos_y, cant_sigmas) delta_x = diff(datos_x); delta_y = diff(datos_y); pendiente = delta_y./delta_x; % mediana = median(pendiente); % sigma = std(pendiente); % % umbral = mediana ...
function gctool_pre() % create *.dat file for gctool % make vinf global global vinf advisor_path=strrep(which('advisor.m'),'\advisor.m',''); gctool_path=vinf.gctool.fullpath(1:end-1); if ~vinf.gctool.user_defined % open file for reading and writing fid=fopen([advisor_path,'\gctool\gctool_model.dat'],'wt');...
% mlp_classify_bayes_output % for outputing var' estimate on toy 1d dataset % Copyright (C) 2015 Hao Wang % Adapted from code by KyungHyun Cho, Tapani Raiko, Alexander Ilin % %This program is free software; you can redistribute it and/or %modify it under the terms of the GNU General Public License %as published by the...
% eks2005_opgavea parfile='eksamen2005_a.cmd'; p=mgstat(parfile); G=read_gstat_par(parfile); [pred,x,y]=read_arcinfo_ascii(G.predictions{1}.file); % randomly select np points np=500; nx=length(x); ny=length(y); rand('seed',2); ix=round(rand(1,np)*(nx-1))+1; iy=round(rand(1,np)*(ny-1))+1; for i=1:np xobs(i)=x(ix(i))...
function [popX, popY, popZ] = populationProb_02(popX0, popY0, popZ0, decayX, decayY, deltaT) %POPULATIONPROB Function recieves arrays with number of atoms in arrays %such that if number n is in array popX0, the n-th atom is in the isotope %form X. Other input include half-lives of X and Y and the time interval. %The ou...
function [ret1,ret2] = get_facts_values( facts, values ) % facts = ArrayList<Fact> % values = {'value1','value2',...} ret1 = cell( length(values), facts.size ); ret2 = cell( length(values), facts.size ); for i = 0:facts.size-1 for j = 1:length(values) ret1{j,i+1} = jess_str_val...
%%%Script for 3a and b homework set 1 Due 2/11/19 %%%by Dean Geisel %%%for Dr. Mohamed Sulman %%%in MTH 7260 %------------------------------------------------------------------------- %%%The purpose of this script is to solve the matrix equation found in %%%problem 3 for the Vector of U values that form the n...
function h = include_model_sim_NEW(R,m,ind_item,varargin) [clist,ind] = colormap_model_sim_NEW(R,m); if ~isempty(varargin) i_ax = m.plotinfo.ax(varargin{1}); else i_ax = m.plotinfo.ax(ind_item); end switch m.plotinfo.color_coding case 'error' for i_it = ...
for i=1:35, run_plot_wind_at_h('wrfout_d01_2006-02-23_12:42:00',i,[1,6.1],[],1,10.0,10), end
function NormalizedPWR(base,trials) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % INPUTS: % base - baseline recording (usually 1 min recorded before trials) % trials - trials of experiemnt (dim samp X trials) % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Define parameters (if already defined outside of function the comment % ...
clear all; close all; clc; global eps SanityCheck mu var1 var2 tprThresh W H; W = 19; H = 19; tprThresh = 0.95; eps = 1e-6; SanityCheck = 1; mu = 0; var1 = 0; var2 = 0; % %% % %%%%%%%%%Simple Weak Classifier % % FTData = load('FeaturesToUse.mat'); % feature = FTData.fmat(:,12026); % % [theta,p,err] = TrainAndPlot(...
clear all; clc; Image=imread('image1.tif'); [m,n]=size(Image); % size of the image block_size=32; hash=[]; % initialization of the hash to be extracted from each % DCT-transformed block. for i=1:block_size:m, for j=1:block_size:n, blk=dct2(Image(i:i+block_size-1,j:j+block_size-1)); % get the block ...
function [lambdak] = mywblfit (Y) m1 = mean(Y); m2 = mean(Y.^2); m = fzero(@(m) (m1/gamma(1+1/m))^2*gamma(1+2/m) - m2, 10); alpha = (m1 / gamma(1+1/m))^m; lambdak = [alpha^(1/m), m]; end
q = [1,4,7,10; 2,5,8,11; 3,6,9,12] t = [1,4,7,10,11;2,4,8,10,12;3,4,9,10,13] q = norm_code(q) t = norm_code(t) dist = 1 - t' * q dist_2 = zeros(5, 4); for i = 1:5 for j = 1:4 X1 = t(:,i); X2 = q(:,j); dist_2(i, j) = bhattacharyya(X1, X2); end end dist_2 function d = bhattacharyya(X1, X2) %check...
% calculate rate of CH3O + NO2 -> CH2O + HONO % Updated 7/14/06 AEP % Based on JPL Data Evaluation #15 % rate=kNO2CH3Oa(T,M) function j=kNO2CH3Oa(T,M) j=1.1e-11.*exp(-1200../T);
% This code serves as a framework to optimize regional welfare among % aggregated customers while tracking the reference point of p* and q*. function hello(param) fprintf('\n\tHello %s!\n\n',param);
function fh = plot_by_school(x_isM, y_isM, xLabelStr, yLabelStr, saveFigures, cS) % Plot a bunch of data series for each school level %{ Line graph IN x_isM x values by [observation, school group] can be a single vector, applied then to all school groups %} if min(size(x_isM)) == 1 % Vector; expand ...
function env2matlab(ruta,envfile) % Convierte archivos .ENV/.SRF a una estructura de Matlab, guardando esta y % algunos parámetros más en el archivo data_struct.mat: % numsurfaces: almacena el número de superficies que definen la geometría % surfaces: se trata de una estructura de Matlab donde se guarda la información ...
function opts = getDefaultOpts_IRLS % ========================================================================= % Reference: % [1] C. Kuemmerle, C. Mayrink Verdun, "A Scalable Second Order Method for % Ill-Conditioned Matrix Completion from Few Samples", ICML 2021. % ===================================================...
function winning_full = comb_win2(SwPt,M_X,Grid,u1,Cont_list) num_p = 0; for i = 1:length(SwPt) num_p = num_p + length(Cont_list{SwPt{i}(2)}); end winning_full = zeros(2,num_p); counter = 1; for i = 1:length(SwPt) if(~isempty(SwPt{i})) origin = Grid.V{1}(SwP...
ts=[0 0.05] x0=[0.01 0 0 0]'; [t,x]=ode23('robotadapt123',ts,x0) [qd,e]=robout(t,x) plot(t,e)
% Pulizia clear; clc % Rappresentazione di % (s+3) % k ----------- % (s-1)(s²+4) z = [-3]; p = [1, 2i, -2i]; k = 1; funzione = zpk(z, p, k); % Zeri e poli della funzione zero(funzione) pole(funzione)
%2016-05-12 OFDM transmitter. carrier-less OFDM over the entire 0-22KHz band %2016-06-06 improved notations %2016-06-07 realised OFDM receiver, added BER calculation %2016-06-08 added white noise. Added jitter: algorithm is very sensitive to %jitter %2016-06-16 added OFDM signal BW = Sub-carrier BW*Nsc2_real, Number of...
%% EXTRACTION FEATURES v2.0 % This script performs the extraction of the created dataset features clear all close all clc % Folders of images - each user has one folder folders=dir('~/conAi/imgbasedtest/'); folders={folders.name}; folders=setdiff(folders,{'.','..','.DS_Store'})'; num=length(folders); %% % ...
function [mr]=mregs(X,Y,outlier,getts,prettyprint) % performs a multiple regression % where X is a matrix of column vectors and Y is a column vector % Useage: [mr]=mregs(X,Y[,outlier]) % where mr is a structure with relevant values % including Rsq,B,B0,Ypred,dfr,dff,F,p if nargin<3, outlier=zeros(size(Y)); en...
function T = kine(robj, q, link) % Syntax % % T = kine(robj, q); % T = kine(robj, q, link); % % Description % % Return the orientation and position or the equivalent homogeneous % transform for the last (if not supplied) or the ith link. For example: % % % forward kinematics up to ...
function exportdataset(dataset,filename,delimiter) % exportdataset(dataset,filename,delimiter) % Save the struct 'dataset' as a delimited ASCII file. Variables saved as % columns, with column/field names specified in dataset.elements fp = fopen(filename,'w'); if length(delimiter)==2 && all(delimiter == '\t') de...
function [success] = downloadCnmfGithubRepositories(varargin) % Biafra Ahanonu % Downloads CNMF and CNMF-E repositories. % started: 2019.01.14 [10:23:05] [success] = ciapkg.download.downloadCnmfGithubRepositories('passArgs', varargin); end
% Code belonging to figure 3 of Ma et al. (2011), Behavior and neural basis % of near-optimal visual search, Nature Neuroscience 14 (6), 783-90 % Generates distributions of decision variable and ROCs % Change line 20 to switch between homogeneous and heterogeneous % distractors clear all; close all; set(0,'De...
%This function generates the headfile needed for archiving function []=gen_archiving_headfile(headfile_name, repeat, key_hole, total_nproj, undersampling_factor, recon_type, runno, civmid, projectcode, specimenid, dimx, dimy, dimz, fovX, fovY, fovZ, im_plane, FA, TE, TR, BW, baseline_time) %==========INPUTS======...
% Run script for solving Darcy's system (fine scale) with finite volume % method in the mixed form, two point flux approximation (TPFA) % clear all; % tic; %% Set up the parameter nx = 101; ny = nx; hx = 1/(nx-1); hy = 1/(ny-1); % load coef.mat p = @(x)cos(pi*x(:,1)).*cos(pi*x(:,2)); v1 = @(x)-pi...
function [l1,l4,refinedTop,refinedBottom] = testAscenderDescenderFunc(ImgRef) % ImgRef = imread(strcat(PathName,FileName)); [nRw,nCol] = size(ImgRef); if(nCol > (3*30)) % the image width has to be greater than (3*30) nParts = ceil((nCol/(3*30))); % for dividing the imae into parts eachPartWidth = ceil(nCol/nP...
function [all_theta] = oneVsAll(X, y, num_labels, lambda, iterations) % X ya ha sido extendida initial_theta = zeros(columns(X), 1); options = optimset('GradObj', 'on', 'MaxIter', iterations); all_theta = zeros(columns(X), num_labels); for i = 1:num_labels all_theta(:, i) = fmincg(@(t) (lrCostFunction(t, X, (...
function output = getObjectiveValue( input,Neval,mode ) if(mode==1) output = mean(input) + std(input); else inp_mean = sum(input)/Neval; output = inp_mean; end end
clear all load('Ic.mat'); load('tempSatno.mat'); Tamb=tempSatno; Tpv = Tamb + (25+35)/2 * Ic/1000; niZ = 0.96; niN = 0.97; deltaPdc = 0.005; niT = (1-deltaPdc*(Tpv-25)/100); Psc = 265*30; Pdc = Psc*niZ.*niT*niN.*Ic/1000; niEuro = 0.98; niavg = mean(niEuro*niZ*niN.*niT); Pac = niEuro*Pdc; Pac...
%BME 3053C Final Project %Cell Detection and Counting %4/10/2020 %This code is used to identify the number of cells in an image that contain %magnetic nanoparticles. clc;clear; pix=imread('Cell3.png'); [h,w,p]=size(pix); binary=false(h,w); new=pix; I=pix; %Changes the image to binary for ii= 1:h fo...
function fin() disp('Bonjour Monsieur et bienvenue dans la fonction Pseudospectre qui correspond au programme de Gershgorin:') %%% Variables %%% n = 3; %Taille de la matrice qu'il sera possible de changer A=ones(n,n); eps=10; %%% Fonctions %%% % 1. Premiere fonction Random % Fonction qui va donner un nombre aleat...
%This script separates the blue and red channels for easy camera-projector %calibration %Go to images location images_loc = '/Users/jacoverster/Desktop/Test_scan_data/2017_11_15/'; nr_of_images = 13; image_basename = 'canon'; fileType = '.JPG'; disp('Writing images...') for i = 1:nr_of_images cd(images_loc) ...
embed = imread('embed.png'); figure imshow(embed); %p = rgb2gray(lena); %imshow(I); [m,n] = size(embed); Blocks = cell(m/8,n/8); counti = 0; for i = 1:8:m-7 counti = counti + 1; countj = 0; for j = 1:8:n-7 countj = countj + 1; Blocks{counti,countj} = lena(i:i+7,j:j+7); end end %Blocks...
load filterBank.mat; load imStack.mat; % i created this. textons=createTextons2(imStack,F,5); % imput the images. gumballs=imread('gumballs.jpg'); gumballs_gray=rgb2gray(gumballs); snake=imread('snake.jpg'); snake_gray=rgb2gray(snake); twins=imread('twins.jpg'); twins_gray=rgb2gray(twins); coins=imread('coins.jpg')...
classdef DENNSplitGain < SplitGain % NNSplitGain evaluates split functions used in decision trees using % k-th nearest neighbor (in 1D). % % Kozachenko (1987): Sample estimate of the entropy of a random vector. % (english description - Beirlant (2001): Nonparametric entropy estimation: % An overview) properties ...
function template=fingerTemplateRead %dialog for opening fingerprint files [templatefile , pathname]= uigetfile('*.dat','Open An Fingerprint template file'); if templatefile ~= 0 cd(pathname); template=load(char(templatefile)); end;
%% Staple diagrams clc clear all figure(1) clf dataBoarding = dlmread('boardingData500.txt'); randomBoarding = dataBoarding(2:5:end,1:2)/60; backToFrontBoarding = dataBoarding(3:5:end,1:2)/60; outsideInBoarding = dataBoarding(4:5:end,1:2)/60; flyingCarpetBoarding = dataBoarding(5:5:end,1:2)/60; meanTime = [randomB...
function OneWheelAccel() %rho = 1.225; %[CfdragT, CfdownT] = AeroMap(AP); %Fdrag1 = 1/2*rho*CfdragT*Drag_Var; %Calculates Fdrag prime which is simply the collection of constants such that Drag Force = Fdrag1*Velocity^2 %Fdown1 = 1/2*rho*CfdownT*Down_Var; CarMass = 270*0.25; TireCf =...
function coords = polar2cartesian(screen_properties,theta,magnitude_mm) %convert magnitude in mm to x and y components [x_mm,y_mm] = pol2cart(theta,magnitude_mm); %convert mm to pix independently for x and y x_pix = x_mm*screen_properties.width_res_pix/screen_properties.width_mm; y_pix = y_mm*screen_properties...
f=imread('cameraman.tif') fd=double(f) F=fftshift(fft2(fd)) [P,Q]=size(F) D0=input('Enter D0:') w=input('enter w:') for u=0:P-1 for v=0:Q-1 D(u+1,v+1)=(((u-(P/2)).^2)+((v-(Q/2)).^2)).^0.5; H(u+1,v+1)=exp(-((D(u+1,v+1).^2-D0.^2)/(D(u+1,v+1)*w)).^2); Hr(u+1,v+1)=1-H(u+...
function funv = nsm_funv(x, model) % This function evaluates the function value of the nonsmooth regularizer rg = model.regpara; pn = model.penalty; switch pn case 'ell1' funv = rg*norm(x,1); case 'ell2' funv = rg*norm(x,2); otherwise error('nsm_funv: nonsmooth regula...
% freq = [3000,2500,2000,1500,1000,800,700,600,500]; % dist = [30,50,70,100,150,200,250,300]; % PDR = [1 0.995884 0.98 0 0 0 0 0; % 1 0.971098 0.96 0 0 0 0 0; % 0.980263 1 0.925925 0 0 0 0 0; % 1 0.689655 0 0 0 0 0 0; % 1 0 0 0 0 0 0 0]; % marks=['+','o','*','x','square']; % % figure('N...