text
stringlengths
8
6.12M
function [normalized_data, varargout] = gaussian_normalization(input,varargin) % Normalisiere Input der Art, dass danach Mittelwert=0 und % Standradabweichung=1 gilt. args = varargin; nargs = length(args); if isscalar(input) == 1 % Fall eines einfachen Skalars m=0; std_deviation = 1; ...
function [t,x,days,K_disc,A,Kfun] = lockdown(data, K0_disc, K0_cont, options) % % [t,x,days,K_disc,A,Kfun] = lockdown(data, K0_disc, K0_cont, options) % % Lockdown è divisa in 3 parti: calcolo i k discreti, fitto i valori % discreti per ottenere una funzione continua k(t) inserendo i parametri % del fitting po...
function ubergraph global g_axis set(gca,'Color',[0 0 0]) set(gca,'Xcolor',[0.5 0.5 0.5]); set(gca,'Ycolor',[0.5 0.5 0.5]); set(gcf,'Color',[0 0 0]); grid xlabel('Hue') set(gcf,'KeyPressFcn',@key_press) g_axis = gca; end function key_press(obj,event) global g_axis l_xlim = get(gca,'Xlim'); l_ylim = get(gca,'Yl...
function testVariables = Windtunnel_one_dimensional() %Windtunnel_one_dimensional Summary of this class goes here % Detailed explanation goes here %These are the obligatory variables v.nYawInput = 1; v.xMin = -45; v.xMax = 45; v.xMinrad = deg2rad(v.xMin); v.xMaxrad = deg2rad(v.xMax); v.displayName = 'Windtunnel one ...
% 2D Dimension-by-Dimension domain decomposition sparse PA method of whole % image % F1: the input image data(take absolute value if it is complex) % part_x: the number of subdomains in x direction % part_y: the number of subdomains in y direction % res: position integer, change resolution of reconstruction % n_m...
function z=fh3(x,y1,y2,y3,y4) z=y4; end
function client = createCloudQueueClient(obj, varargin) % CREATECLOUDQUEUECLIENT Method to create a client for the Queue Service % % Copyright 2019 The MathWorks, Inc. clientJ = obj.Handle.createCloudQueueClient(); client = azure.storage.queue.CloudQueueClient(clientJ); end %function
function [Var,C,Z,Hsbl,Corners] = PlotAFront(fname_VARS,fname_DIAS,VarOp,Front,W,Res,flip,plotting) %This function plots an along-front average in C,Z (across %front-depth) space of the variable defined by VarOp (see %pcolPlotNC.nc) for the front defined by Front = [lon_w lat_w lon_e %lat_e depth time] (western and eas...
function theta = sGradDescent(X, y, theta, alpha, iterations) # # # Performs Stochastic gradient Descent to learn theta # theta = sGradDescent(x, y, theta, alpha, iterations) updates theta by # computing delta-theta over a given number of iterations # number of training examples m = length(y); err = zeros(size(t...
function AnalysisResult3d( obj ) %ANALYSISRESULT3D Summary of this function goes here % Detailed explanation goes here OutstepNum = obj.outputFile.outputStep; Nz = obj.mesh3d.Nz; Npz = obj.mesh3d.cell.Npz; Nph = obj.mesh3d.cell.Nph; Nptol = obj.mesh3d.cell.Np * obj.mesh3d.K; % analysis vertical velocity cellId2 = 2...
function [J, grad] = linearRegCostFunction(X, y, theta, lambda) m = size(X, 1); J = ((X * theta - y)' * (X * theta - y)) / (2*m) + lambda * (theta(2:end, 1)' * theta(2:end, 1)) / (2*m); grad = (sum(repmat(X * theta - y, 1, size(X, 2)) .* X)/m)'; grad(2:end) = grad(2:end) + lambda * theta(2:end) / m; end
function [ dataCost ] = computeDataCost( I, tau ) % dataCost(m, n, i) is the cost for assignning label i to pixel (m, n) [h, w, ~] = size(I); nLevels = max(I(:)); dataCost = zeros([h, w, nLevels+1]); for i=0:nLevels dataCost(:, :, i+1) = 0; end end
cfg(); global bects_default; addpath(genpath(bects_default.bectsnetworkstoolbox)) addpath(genpath(bects_default.fcnetworkinference)) addpath(genpath(bects_default.chronuxtoolbox)) addpath(genpath(bects_default.mgh)) DATAPATH = bects_default.datapath; OUTDATAPATH = [bects_default.outdatapathpwr 'test/']; mkdir(...
function dim3 = label_slice(dim3) % using block-slice sampling scheme to do the sampling se_Labels = dim3.seLabel; % data's sender's label re_Labels = dim3.reLabel; % data's receiver's label dataNum = dim3.dataNum; % data number numClass = dim3.numClass; % cluster number indexLabel = dim3.indexLabel; alphas = di...
function ret=getSMuRFenv(var) ret=getenv(var); if isempty(ret) error(['ERROR! environmental variable ',var,' not defined!']); end end
function [ to_be_summed_vector ] = Get_To_Be_Summed( binary_num1,binary_num2 ) %this function returns all the partial sums in multiplying to_be_summed_vector=[]; for i=1:length(binary_num2) if binary_num2(i) == '1' to_be_summed_vector=[binary_num1;to_be_summed_vector ]; else zeros_vector = num2s...
clear clc % close all % load results/simulation1/detectorCounts_z0mm.mat load 'C:\Users\Asier Marcos\Downloads\testData\testData/data2fluoro.mat' % load results/detectorCounts_z0mm.mat % load results/simulationData.mat %Lensmaker MCvoxelSize=0.1; %spimVolume=zeros(1000,1000,nzplanes); nzplanes=1; zPlanesmm=0; %phot...
function Cparams = FastBoostingAlgBis(FData,NFData,FTData,T,m,n) betas = zeros(T,1); thetas = zeros(T,3); Cparams.all_ftypes = FTData.all_ftypes; Cparams.fmat = FTData.fmat; w = [(1/(2*m)).*ones(m,1);(1/(2*n)).*ones(n,1)]; y = [zeros(m,1);ones(n,1)]; ii_ims = [NFData.ii_ims(1:m,:);FData.ii_ims(1:n,:)]; muc = zeros(2,s...
function [rs] = config_optimdrivebounds( upper, gauss ) rs = nan(1,28); if( upper ) % 1: sumIB /in [0,1] rs(1) = 1; % 2: sum_contribution /in [0,1] rs(2) = 1; % 3: symIB /in [0,1] rs(3) = 1; % 4: sym contr /in [0,1] rs(4) = 1; % 5: e...
% Decode the datas file_str=['parameters', modulation_type,nr_carriers,coding '.mat']; load(file_str) nr_OFDM_symbols = floor((nr_data_bits/rate-1)/(nr_used_car*nr_bits_x_symbol))+1; tic load('rx_data') plotspectrum(rx_data); [t_samp,phi_hat,gain_pilot_0, theta_est, sigma_sqr_noise_est]=sync_catch_channel(rx_dat...
function [ A, b ] = BTenvelope_for_sin( indices, varbounds, dims, shifts ) %returns sparse matrix and structure with vectors of lower and upper bounds %for linear envelopes of sine function. Each envelope is represented as %y=ax+b, l<b<u %initialize output structure b=struct('l',zeros(dims.nrows,1),'u',zeros...
function z=preproc_anthesia(z) % idx=subsrefDimInfo(z.di,'dim','ch','idx',[z.di(n2d(z.di,'ch')).extra.iseeg]); % % % sub-set down to 6 channels % % z=jf_retain(z,'dim','ch','vals',{'C3' 'C4' 'Cz' 'CP3' 'CP4' 'CPz'}); % z=jf_linDetrend(z,'dim','time','subIdx',idx); % remove slow drifts -- and make fftfilter work % ...
% Run time of Program is 78 sec on windows 10 system with i5 processor clc close all clear all tic; %% added % RRMSE without using reconstruction is 0.2923 load('../data/assignmentImageReconstructionPhantom'); fig = figure;set(gcf, 'Position', get(0,'Screensize')); imshow(mat2gray(abs(imageNoiseless))); t...
%% MULTIFRAME MOTION COUPLING FOR VIDEO SUPER RESOLUTION % % % Be sure to initialize the submodules and to compile them % following their instructions clearvars; %% Data properties dataFolder = 'data/video_scenes/'; flowFolder = 'data/flow_scenes/'; occFolder = 'data/occlusion_scenes/'; datasetName = 'bandage_1_...
fid = fopen('/media/sophie/db554c18-e3eb-41e2-afad-7de1c92bf4a5/paper_dataset_lists.txt'); file = fgetl(fid); while ischar(file) file D=MRIread(file); Masks=D.vol; Sm=size(Masks); Masks2=zeros(Sm(1),Sm(2),Sm(3),87); parfor j=1:87 Masks2(:,:,:,j)=(Masks==j); j end out...
function[ind] = ind_btw_nodes(p,q,sized) %IND_BTW_NODES - takes two nodes at points p and q and finds a set of indices %that run between them. % len= max(1,sqrt(sum( (p-q).^2 ))); x = 0:(1/len):1; P = round((1-x')*p + x'*q); ind= sub2ind(sized,P(:,3),P(:,2),P(:,1)); 1;
function build_dir(mccDIM) % for feature if ~exist('feature','dir') system(['mkdir feature']); end if ~exist('feature\sp_data','dir') system(['mkdir feature\sp_data']); end if ~exist('feature\ap_data','dir') system(['mkdir feature\ap_data']); end if ~exist('feature\f0_d...
% the coo implementation of expander matrix % Notes by Jared Tanner: % A somewhat better implementation would be to use sparse matrix format such as coo, % and also not to regenerate the random permutation for each column. It is preferable to % generate the matrix as in the attached, which generates a random permutat...
function myPATHs = get_myPATHs() %% PATH definitions % Get current computer name computer_name = char(java.net.InetAddress.getLocalHost.getHostName); switch(computer_name) case 'XC-OPTIPLEX9020' BASE_PATH = 'C:\Users\xyche\Documents\MATLAB\APET_matlab'; case 'xinyi-OptiPlex-7060' BASE_PATH = '/...
function r = plus(a, b) % % PLUS - Return a functor representing the sum of two functors a % and b. % r = Func('sum',a,b);
% Acquire saved PCA data. % Get resource path res_path = get_res_path(); % Define matrix resource path data_path = strjoin({res_path 'pca.mat'}, filesep); % Load data and exit load(data_path); % Plot AAT eigenvalues S_eig_val_col = sum(S_eig_val, 2); close all; figure('position', [0 0 1280 800]); plot(1:length(S_e...
function Y = abs(X) % Absolute value. % ABS(X) is the absolute value of the elements of X. When % X is complex, ABS(X) is the complex modulus (magnitude) of % the elements of X. % Convert inputs to SymExpression % X = SymExpression(X); % construct the operation string ...
function [subj] = raicar_prepareShow (subj, imagePerRow) % % function [subj] = raicar_prepareShow (subj, imagePerRow) % % Author: Zhi Yang % Version: 2.0 % Last change: July 18, 2007 % % Purpose: % prepare the result to show. transform the maps and anatomy image into mosaic format, % if the anatomy imag...
load training_data %% initialize parameters for the neural network input_layer_size = size(training_data,2); output_layer_size = 10; layer_size = [input_layer_size,2,10,output_layer_size]; theta = dnnRandInitializeWeights(layer_size); [W,b] = dnnParamToStack(theta,layer_size); lambda = 4; %% gradient check training_da...
function [parent_v, nats_v] = nest_meshes( xs_crs, tris_crs, xs_fine, tris_fine) %#codegen % Nest a finer mesh in a coarser mesh. % % [PARENTF, NATS] = NEST_MESHES( XS_CRS, TRIS_CRS, XS_FINE, TRIS_FINE) % Given a coarse mesh and a fine mesh, determine a nesting of the finer % mesh in the coarse mesh. Each face (a...
function CC_aux_update_gui(varargin) handles2=varargin{1}; handles=guidata(handles2.figure1); handles2=guidata(handles2.figure2); spikeData=handles.spikeData; spikeMatrix=handles.spikeMatrix; T=spikeMatrix(:,2); ClusterAllocation=handles.ClusterAllocation; cheetahColors=handles.cheetahColors; cluster_nr1...
clear, clc k = 8.617e-5; %boltzman constant eVK^-1 hc = 1.23984193; %eVĚ?m c = 3e8% m/s T = 6000 % K lamda = (0:.001:3); %generates wavelenth
function [samples, stats, structArray] = matbugs(dataStruct, bugsModel, varargin) % MATBUGS a Matlab interface for WinBugs, similar to R2WinBUGS % [samples, stats] = matbugs(dataStruct, bugsModelFileName, ...) % % This generates a file called 'script.txt' in the directory where % winbugs14.exe is kept (so you must hav...
function run_meaned(measure_type, varargin) % RUN_MEANED -- Construct and save an average of a complete signal % measure, as specified in the config file. % % run_meaned( measure_type ) constructs the average of % the specified `measure_type`. `measure_type` must exist in the .h5 % file under a /comp...
function s = sigmoid(z) s = z/sqrt(1 + z^2); end
function [ nc ] = assignementKMeans( listPts,centres ) X=listPts; Y=centres; %Calcul de la Matrice des distance D(i,j)=distance(X(i),C(j)) D = sum(X.^2,2)*ones(1,size(Y,1)) + ones(size(X,1),1)*sum( Y.^2, 2 )' - 2.*X*Y'; [ row_min, row_argmin ] = min( D, [], 2 ); %On r�cup�re les index des centres les plus...
function [S,i]=SecondOrderBalancedSequence(repetition,start_condition) %[S,i]=SecondOrderBalancedSequence(tItem,repetition,start_condition) % % Generates a so-called t1r1 sequence, see Aguirre for fMRI applications. % These sequences are balanced for second-order transitions. % The length of repetition determine...
% pseudo inverse computation function J_pinv = PseudoInv(jac) [U,S,V] = svd(jac); for i = 1:min(size(jac, 1), size(jac, 2)) if S(i,i) ~= 0 S(i,i) = 1 / S(i,i); end end J_pinv = V * S' * U'; end
function [eersteRijvector,tweedeRijvector,derdeRijvector] = opdracht_9(Matrix) eersteRijvector=Matrix(1,:); tweedeRijvector=Matrix(2,:); derdeRijvector= Matrix(3,:); end
load('speech_data.mat') cfg = []; cfg.toilim = [-0.26 -0.19]; for i=1:length(data_noCh) data_conv{i,1} = ft_redefinetrial(cfg, data_conv{i,1}); data_noCh{i,1} = ft_redefinetrial(cfg, data_noCh{i,1}); end %% dataC = ft_appenddata([], data_conv{:}); dataN = ft_appenddata([], data_noCh{:}); % Freqanalysis fo...
function labels = run_ICL(version, images, psds, autocorrs) %% check inputs if any(strcmpi(version, {[], 'default'})) version = ''; elseif any(strcmpi(version, 'lite')) version = '_lite'; elseif any(strcmpi(version, 'beta')) version = '_beta'; else error(['Invalid network version choice. '... ...
function [rfn, afn, zfn, dfn, sfn, efn, wfn, deltafn] = anglefns(pos1, pos2, duration) global BASE_HEIGHT HUMERUS ULNA HAND; rfn = @(t) (pos2(1)-pos1(1))*t/duration + pos1(1); afn = @(t) (pos2(2)-pos1(2))*t/duration + pos1(2); zfn = @(t) (pos2(3)-pos1(3))*t/duration + pos1(3); dfn = @(t) (pos2(4)-po...
%% try 702d24, 0b5a2e %sid = input('what is the subject ID? ','s'); close all;clear all;clc setup_environment saveIt = 0; delayDelivery = 14; % 14 samp delay between trigger stim and delivery approximately @ 24404 Hz %for sid = {'d5cd5','702d24','0b5a2e','0b5a2ePlayback','ecb43e','9ab7ab'} for sid = {'0b5a2e'} si...
function [PlotVar1DMaps, PlotVarDecoder, PlotVarPop, PlotVarBehavior] = DefinePlotVariable PlotVar1DMaps = Tstructure('PlotVar1DMaps'); PlotVar1DMaps.addprop('Shanknum'); PlotVar1DMaps.Shanknum = [0:7 0]; PlotVar1DMaps.addprop('Shanksuffix'); PlotVar1DMaps.Shanksuffix = {'CA1','CA1','CA1','CA1','CA1','CA1','CA1','CA1',...
function result = patternSearch(objFnc, numVars, lowerLimits, upperLimits, options) %PATTERNSEARCH Constrained Pattern Search algorithm % %Input values: % objFnc - The objective's function handle % numVars - Number of variables of the problem % lowerLimits - The variables' lower bound % up...
function [a,F] = runge_kutta_core(a,F,h,flag) %a:初期点 h;刻み幅 flag:false(片側)/true(全域) F:解 d = length(a); k = zeros(d-1,4); %holds function F-vector evaluations alpha = [0;1/2;1/2;1]; beta = [0,0,0,0; 1/2,0,0,0; 0,1/2,0,0; 0,0,1,0]; gamma = [1/6;1/3;1/3;1/6]; for i = 1:4 b = a + a...
function [ SNAPfNW weigM BasisS zSTRESSES]=SnapMatrixFINTcomp(BasisS,BBfRI,... weigM,nstrain,SingValStr) %dbstop('5') if nargin == 0 load('tmp3.mat') % end zSTRESSES = [] ; % nmodesU = size(BBfRI,2) ; nmodesS = size(BasisS,2) ; % Singular values for elastic/inelastic %[SSd,SS] =RetrieveSingV(NAME_SAVE_B...
function stride_average = strideAverage(trial, data) % find average of each input signal with respect to each of the legs stride_average = zeros([2 size(data)]); stride = trial.metrics.leg_stride; for s = 1:max(max(stride)) stride_average(1,:,stride(1,:) == s) = mean(data(:,stride(1,:)==s),2); stride_aver...
function [xs, betas, phis, regs] = reconPwlsApproxPathSeeking( y, w, geom, pfun, delta, psOS, optOS, ... img0, img1, beta0, beta1, dv0, updateRate, noFrames, numOptItn ) % Penalized-Weight-Least-Squares recosntruction for single energy sinograms % using Nonuniform SQS algorithm % input: % y - log sinogr...
% Processamento dos dados dos paths x e y % com o espectro rotatorio close all xy = load('xy.txt'); dt = 1./30.0; % x = diff(xy(500:1500,1)); % y = diff(xy(500:1500,2)); x = xy(500:1500,1); y = xy(500:1500,2); x_low_freq = lanczos2(x, dt, 2) y_low_freq = lanczos2(y, dt, 2) x = x - x_low_freq y = y - y_low_freq ...
function [mediaVetorCalculado, mediaGroundTruth, mediaErroAbsoluto, mediaAcuracia, tabelaEstatisticas] = calculatesStatistics( groundTruthVideo, vectorDifferentObjects ) % tabelaEstatisticas = [algo - GT - acertopercentual - c1 - c2] % Detailed explanation goes here erroAbsoluto = abs(vectorDifferentObjects - ground...
clc clear addpath( genpath( '.' ) ); foldername = fileparts( mfilename( 'fullpath' ) ); % methodName = 'KCVDCA'; videoFiles = dir(fullfile(foldername, 'data', 'input')); run('./SGAFsal.p');
function [OAL DoF] = AMIGO_Chi2LevelofAcceptance(alpha,ndata,npar) % AMIGO_Chi2LevelofAcceptance(alpha,ndata,npar) calculates the Chi2 objective function value limit % that would not be rejected on the significance level of alpha. fprintf('ndata: %d\n', ndata); fprintf('nestpar: %d\n', npar); DoF = ndata - npar; fp...
% Group Hard Iterative Thresholding Algorithm on Lorenz system. Test 5 data % sets. % Output: the probability of recovering correct terms and the relative error ranges % % Note: The $\ell_0$-model is the group hard-iterative thresholding algorithm % applied to only one data set at a time. % Copyright: Hayden Schaeffer...
%% 11/05/2021 % Script for EC and REA calculations at Ru de la Loge for summer camapign % v0 Clément clear all; close all; set(0, 'defaultFigureUnits', 'normalized', 'defaultFigurePosition', [0 0 1 1]); set(0,'DefaultFigureVisible','on') Param = load_parameters; % to define constant parameters %% I...
function [f,q] = fitpixelsizeanddistance(lam,pix,dist,Energy) % function f = fitpixelsizeanddistance(lam,pix,dist,Energy) % % % Created 11.10.2007 UV s = lam(1); % pixel size d0 = lam(2); % Distance error hc = 2*pi*1973.269601; q = 4*pi/hc*sin(0.5*atan(s*pix./(d0 + dist))).*Energy; f = sum((q - 2*pi/58.43*ones(size...
% read_snesim : Read SNESIM (v10) parameter file % % S = read_snesim_10(filename,read_data); % filename [string]: snesim parameter file (def:'snesim.par') % read_data [integer]: optionally read input/output data files % read_data=0; % read no data % read_data=1; % read output from visim % ...
function [xp, yp] = find_target_patch(I,M,m) %FIND_TARGET_PATCH finds the next target patch % % NOTE: ASSUMES MAX INTENSITY IS 255 % % Parameters % ---------- % I : 2D array % A grayscale image with missing pixels as -1. % M : 2D array % A binary image the same size as I with 0 for missi...
addpath('./class_methods'); addpath('./utils'); settings.bmark_path = '../Benchmarks'; % bmarks: wiki, pascal_sentence, nus_wide settings.bmarks = {'wiki','pascal_sentence','nus_wide'}; % methods: Class, deep_Class settings.iterN = 5; test_methods = {'Class','deep_Class'}; results = struct; if ismember('Class',test_m...
clear all; mesh = lect_mesh('../Meshs/dam1'); mesh = face_number(mesh); % Initialisation des variables de temps T = 200; dt = 0.4; % Pour dam0 dt = 0.1; % Pour dam1 %dt = 0.05; % Pour dam2 N_pt = floor(T/dt); V_t = init_sw(mesh); % ---- Variables pour la visualisation x = mesh.som_coo(:,1); y = mesh.som_c...
%% CREATE HYPERELLIPSOIDS/CUBOIDS FOR ALL CONSTRAINTS % AUTHOR : G. PAVAN BHARADWAJ % REFER TO LICENSE.pdf ON REPOSITORY FOR USAGE RESTRICTIONS % clear all; clc; clearvars;close all; yalmip('clear');cvx_clear; %% INPUTS % SURROGATE NAME surr = 'hanson_b'; % SHAPE (cuboid, ellipsoid, both) shape = 'both'; save_outp...
function this = plotStates(this) n = length(this.states); r = sqrt(n); figure; for i = 1:n subplot(floor(r), ceil(r), i); state = this.states(i); t = this.time; x = state.val; plot(t, x, 'r'); end
function [ value ] = calculatePi( n ) s = 0; for i = 1:n s = s + (1 / (n^2)); end value = sqrt(6 * s); end
%% TEAM: UN-UF-GERS-JEA % Cooperation: Universidad Nacional de Colombia, University of Florida, GERS USA and JEA %% TEAM MEMBERS: % Pedro Garcia, pjgarciag@unal.edu.co, PhD Student at UN % Diego Rodriguez, diego.rodriguez@gers.com.co, International Studies Manager at GERS USA and PhD Student at UN % David Alvarez, dl...
function counts_sec = CountSecondary(SimuPop) % counts_sec = CountSecondary(SimuPop) % % Counts secondary infections of primary infector. Checks whether primary % infector is in clinic for at least 25 more days and infection occurred 25 % days before end of simulation. chrono = SummarizeInfections(SimuPop); if isempt...
clear;clc; clear;clc addpath .. % %% Problem 1.1 % syms lw ls m g real % % Bc1 = [0;1;0;0;0;0]; % Bc2 = [0;1;0;0;0;0]; % Bc3 = [0;1;0;0;0;0]; % Bc4 = [0;1;0;0;0;0]; % % g_oc1 = [1 0 0 0; % 0 1 0 -1; % 0 0 1 0; % 0 0 0 1]; % % g_oc2 = [0 1 0 -1 % -1 0 0 0; % 0 0 1 0; % 0 0 0 1]; % % g_oc3 = ...
classdef Test_MoyamoyaPaper < matlab.unittest.TestCase %% TEST_MOYAMOYAPAPER % Usage: >> results = run(mlanalysis_unittest.Test_MoyamoyaPaper) % >> result = run(mlanalysis_unittest.Test_MoyamoyaPaper, 'test_dt') % See also: file:///Applications/Developer/MATLAB_R2014b.app/help/matlab/matlab-unit...
function makeTuples( obj, key ) tuple = key; if strcmp(fetch1(Scans(key),'scan_prog'),'MPScan') %% MPScan % Load movie information tpr = tpReader(Scans(key)); % Align movies if ~isAligned(tpr) % return display('Aligning movie'); close(tpr); fileNameCore...
% Ayelet Zalic March 2018 %%% Shutdown script for He3 system global smdata; %% Retrieve instrument indices and close connections to machines k1ind = sminstlookup('Keithley 1'); k2ind = sminstlookup('Keithley 2'); dmm1ind = sminstlookup('Dmm 1'); dmm2ind = sminstlookup('Dmm 2'); dmm3ind = sminstlookup('Dmm 3'); l1...
function val = interP(b00,b30,b02,b32,u,v) val = (1-u)*(1-v)*b00+u*(1-v)*b30+(1-u)*v*b02+u*v*b32; end
function [show] = process_show( show, config ) %process_show load the show, get cosine matrix, calculate cost matrices % can pass in a show index and we load it, or just the show % itself which will save time loading it if isnumeric( show ) show = get_show(show, config); end % execute a given show, r...
function [im_plotted, spectrum_plotted] = plot_spectrum(im,mode, isShowSpectrum) %PLOT_SPECTRUM Summary of this function goes here % Detailed explanation goes here % mode = 0, no padding, no windowing, directly plot spectrum % mode = 1, add fadding pading, then plot spectrum and crop % mode = 2, add pure hamming wind...
function [mz,logDS] = xxxTranNormScal(man,mz,sp) % xxxNormTranScal - Perform the generic norm/tran/scal procedures % % man - the structure to the side menu % mz - mz vector of the data % sp - the actual data in NON-IMAGE format % % xxx becomes the default prefix for all 'common' files that are relevant % to both desi...
clear all close all clc for alpha_rudder = -pi/4:pi/500:pi/4; c_rudder_lift_appr = 1.9*(1-exp(-abs(alpha_rudder)*9))-2.4*abs(alpha_rudder); if abs(alpha_rudder) <= 2*pi/180 % Hysteresis around "dead into the wind" c_rudder_lift = 0; elseif abs(alpha_rudder) <= ...
I = imread('coins.png'); I = im2double(I); I1 = imnoise(I,'gaussian',0.02); I2 = imnoise(I1,'salt & pepper'); figure subplot(221) imshow(I) subplot(222) imshow(I1) subplot(223) imshow(I2) fun1 =@(x) mean(x(:)) fun2 =@(x) median(x(:)) mean1 = nlfilter(I2,[3,3],fun1); mean2 = nlfilter(I2,[5,5],fun1); median1 = nlfilte...
function [] = fun2( maxVal , maxY,I) bw0 = im2bw(I,0.99); se = strel('rectangle' , [30 30]); bw0=~bw0; myerodedimg = imerode(bw0, se); myerodedimg = imdilate(myerodedimg,se); [L,num]=bwlabel(myerodedimg); if num<3 display('101'); bw0 = im2bw(I,0.8); se=strel('rectangle' , [30 30]); bw0=~bw0; myerodedimg = ime...
% ampModulation.m % Dan Hirlinger % 10/14/2020 clear; clc; % tremolo [x,Fs] = audioread('AcGtr.wav'); N = length(x); Ts = 1/Fs; % synthesize LFO t = [0:N-1].' * Ts; f = 10; % Hz [.1:10] depth = 70; % pct range [0:100] A = depth/200; dc = 1-A; lfo = A * sin(2*pi*f*t) + dc; y = zeros(N,1); for n = 1:N y(n,1) = x...
function [fx, fy, fz, tx, ty, tz] = ott_calc_force(pos, rot_matrix) % Calculate optical forces and torques given beam-shape coefficients % and T matrix of particle. % Inputs: % x, y, z : coordinates of particle relative to beam % r11, ..., r33 : elements of rotation matrix describing particle % orientati...
function [xy,uv_vec] = Compute_Wuv(obj,ann,res) %Compute_Wuv Summary of this function goes here % Detailed explanation goes here if exist('Wuv.mexw64','file') [xy,uv_vec,e] = Wuv(ann(:,1),ann(:,2),res,obj.tri,obj.c_alphas, ... obj.c_betas,obj.c_gammas,obj.c_uv, obj.rf.n_face_pixels1, ... ...
function [S, e, t, x,U] = nearest_real_eigenvalues(M, maxiter, timemax) % Computes the nearest matrix with real eigenvalues to a real matrix A (or at least a local minimum) % % [B, e, t, Q, U] = nearest_real_eigenvalues(A, maxiter, timemax) % % B = arg min_{X has real eigenvalues} ||X-A||_F % % B has Schur form B = Q...
% function MAC = cal_MAC (vec1,vec2) function mAc=cal_MAC(Phi1,Phi2) % This function calculates mac between phi1 and phi2 mAc= (abs(Phi1'*Phi2))^2/((Phi1'*Phi1)*(Phi2'*Phi2)); end
function [frame_left, frame_right] = load_frames_from_paths(path_left, path_right) frame_left = imread(path_left); frame_right = imread(path_right); end
function [w,a,E] = LS_solve( y, X, Zc, Tau ) [N,D] = size(X); [N,K] = size(Zc); DK = D*K; E = zeros(N,DK); for i = 1:N rank_one_mat = X(i,:)'*Zc(i,:); E(i,:) = rank_one_mat(:)'; end w = inv(E'*E + Tau*eye(DK) )*E'*y; %DK*1 a = (y-E*w);
classdef BCSolubilityUtil < handle properties molalityNaCl x_NaCl pitzerConstantsMu_ChemPotential_CH4Liquid pitzerConstantsLambda_2ndOrderInteraction_CH4Na pitzerConstantsXi_3rdOrderInteraction_CH4NaCl duanLKConstants shib...
function fig_handle=generatePredictedScatterPlot(xt_data,diff_atr,c_indx,s_indx) % Function to generate scatter plot between predicted and measured atrophy ai=sort([c_indx,s_indx]); fig_handle=figure('DefaultAxesFontSize',24,'color','w') scatter(diff_atr(ai)',xt_data(ai),'r*','LineWidth',3); lsline hold on scatter(diff...
function d = task4 d = zeros(10,10); d(1:2:10, 1:2:10)=1; d(2:2:10, 2:2:10)=1; endfunction
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%% Laboratorijska vaja %%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% 4. naloga - ploscni elektrodi %%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %dolzina stranice a (v x-smeri) v m: a=2e-2; %dolzina stranice b (v y-smeri) v m: b=8e-2; %razdalja med ploscama d v m: d=...
%Test_type: Callback for Test Type popupmenu val = get(H.test_type,'Value'); test_type = get(H.test_type,'String'); stim_val = get(H.test_type,'Value'); XStimParams.test_type = deblank(test_type(stim_val,:)); % 'String', ['None|Search for Cells|ABL|ITD|ILD|FREQ|McSpace|Mc2Source|Space|' ... %'Space2|Space...
function prefix = getPrefix(obj) % GETPREFIX returns the prefix of the a CloudBlobDirectory % Copyright 2016 The MathWorks, Inc. % Create a logger object % logObj = Logger.getLogger(); prefix = char(obj.Handle.getPrefix()); end
function EXP = BatchBayesDecoderParameters(EXP, DIRS) model = 'Data';%'Vision';%'Data';%'Local Distance';%'Global Distance';% if strcmp(model,'Data') latencylist = []; else latencylist = 300;%[0 200 400 600 800 1000 1200]; end Nperm_cellprop = 2; ParamsMeanErr = cell(1,max(1,numel(latencylist))); ParamsCorr = c...
function Inter2FileLR(node_names, inter, file_name, lnodes, rnodes) %UNTITLED2 Summary of this function goes here % Detailed explanation goes here if(~isempty(file_name)) fid = fopen(file_name, 'w+'); else fid = 1; end n_lnode = length(lnodes); n_rnode = length(rnodes); % Write node names fprintf(fid, ' ...
%% This function Generates and Compares the Multipath Errror Envelopes for %% GPS, E1B & DET % Created by Matthew Alcock and Dr Paul Blunt %% Clean the environment ================================================== close all;clear all; %% Load Tracking Results ================================================== % ...
function [q,cnt] = romberg(a,b,tol) n = 1; h = b-a; fv = [f(a);f(b)]; est(1,1) = 0.5 * h * (fv(1) + fv(2)); cnt = 2; err = 100*abs(tol); k = 0; while err > tol && k < 10 k = k+1; n = 2*n; h = h/2; fvnew = zeros(n+1,1); fvnew(1:2:n+1) = fv(1:n/2 + 1); for i = 2:2:n fvnew(i) = f(...
%%%%% LAB 5 DSP Parte 3 close all;clear; clc load test_training_signals.mat %%% Parte 2.2 %PARÁMETROS UMBRAL_RMS0 = (0.0120794 + 0.00765744)/2; UMBRAL_RMS1 = (0.0685488 + 0.0543576)/2; P = 15; % Número de polos en modelo AR % Importación de señal de prueba signal_no_pad = test_signal; signal = test_signal;...
% % ECE 278A Project % Efficient graph-based segmentation % % % % Steven Munn % from https://github.com/stevenjlm/segmentor function adj = adj_mat (xDim,yDim,kConnections) if kConnections==8 % Make the first diagonal vector for horizontal connections horizont...