text
stringlengths
8
6.12M
nr_states=size(lightbulb_problem(1).mdp.states,1); S=lightbulb_problem(1).mdp.states; pi_meta = zeros(10,nr_states); for c=1:numel(costs) cost = costs(c); voc1 = zeros(nr_states,2); for i=1:nr_states st = S(i,:); t = sum(st); mvoc = 1/(t*(t+1))*(st(1)*(max(st(1)+1,st(...
% The function generates an alignment model that can be used with % the function using it ;). % % PROTOTYPE: % amodel = generateCMR_model(mpath) % % Outputs: % model ... a structure containing the model that we need for alignemnt; % the structure contains the following fields % % Inputs: % mpath ...
%======================================================================= % Function to apply traction free conditions on top and bottom % surface. The right surface has dirichlet BC while the left surface is % far field. %======================================================================= function [u,v] = b...
classdef CellFunctions methods(Static=true) function resultArray = applyFunctionToAllCells(fn, cellArray) % INPUT: % fn: function handle. % cellArray: the operands. % OUTPUT: % resultArray: a cell array of results. % cellFun only applies functionals to all cells, unlike this function. c...
function [ mu, sigma ] = normfit( v1, v2, p1, p2 ) # normFit fits a normal curve with parameters mu and sigma # over the interval (v1, v2) such that v1 is at the cdf p1 # and v2 at p2. v1 < v2, p1 < p2 if (v2 < v1) || (p2 < p1) error('Invalid parameters: Necessary p1 < p2, v1 < v2'); endif if (p1 > 1) || (p2 ...
%% Obejctive functional % [yteor] = AMIGO_ODcost(od,inputs,results,privstruct) % % Arguments: od (current value of decision variables) % inputs,results,privstruct % yteor (value of the states for the given % decision variables) % *Version details* % % AMIGO_OD version: ...
function [Structure1] = PPR_Trains_Godfrey(Structure1); %{ This is a very simple function that calculates the paired-pulse ratio (PPR) from the 40 pulse 100 Hz train stimulation. Divides the second pulse of the train stimulation by the first pulse. This function is used in the following script: Analyze_Trains_Godfrey...
function [ th1, th2 ] = nntrain( x, y, hiddenNodes, iterations ) inputNodes = size(x, 2); outputNodes = size(y, 2); th1 = rand(hiddenNodes, inputNodes + 1); th2 = rand(outputNodes, hiddenNodes + 1); beta = 1; for i = 1:iterations for j = 1:size(x, 1) a1 ...
% Alexandros Dimas % University of Patras % Department of Mechanical Engineering and Aeronautics % Robotics Group % Spring 2020 % This function computes the Jeometric Jacobian Jv %{ Convention 1: MBA refers to pose of frame {B} as seen by {A}. Similar notation is used to describe relative position and orientation of...
%%for self energy & gap disorder function [dosmap,rev,randlist]=spec_seg_sp(a,mu,delta,alpha,gamma,vc,dim,sigma,randlist,period) % a=1; vzlist=linspace(0,2,401); %vzlist=0:0.001:1.05; % nv=20; if randlist==0 randlist=(sigma*randn(dim,1)+1); while (nnz(randlist<0)~=0) randlist=(sigma*randn(dim,1)+1)...
%% Compute global Pb and hierarchical segmentation for an example image. addpath(fullfile(pwd,'lib')); %% 1. compute globalPb clear all; close all; clc; imgFile = 'data/101087.jpg'; outFile = 'data/101087_gPb.mat'; gPb_orient = globalPb(imgFile, outFile); %% 2. compute Hierarchical Regions % for boundaries ucm = ...
function [theta, J_history] = gradientDescent(X, y, theta, alpha, num_iters) %GRADIENTDESCENT Performs gradient descent to learn theta % theta = GRADIENTDESCENT(X, y, theta, alpha, num_iters) updates theta by % taking num_iters gradient steps with learning rate alpha % Initialize values m = length(y); % number of...
function [r_d] = desired_pos_abs(xi_ref, r_relative) % desired_pos_abs computes the desired absolute positions depending on the % reference frame and the relative coordinates of the desired positions % outputs x_d and y_d in a vector r_d % inputs are xi_ref = [x_coordinate_frame, y_coordinate_frame, % theta_coordinate ...
function [pulses] = RF_getPupCall(varargin) % usage: [pulses] = RF_getPupCall % % Find square pulses. If not argument it provide, it tries to find pulses % in intan analog-in file. % % <OPTIONALS> % analogCh List of analog channels with pulses to be detected (it support Intan Buzsaki Edition). % data ...
classdef RotationBody3D < handle properties (SetAccess = private) attitude = [1; 0; 0; 0] rate = [0; 0; 0] % expressed in body frame inertia end methods function obj = RotationBody3D(inertia) obj.inertia = inertia; end function attitude = getAtti...
function drawResult( obj ) % timeFrac = [0.56 0.6 0.645 0.68]; %case 0.096 % timeFrac = [0.6175 0.66 0.705 0.75]; %case 0.181 timeFrac = [0.64 0.675 0.74 0.78]; %case 0.045 Angle = {[-36,55],[-69,38],[41,47],[43,45]}; conicalPos = NdgPo...
[x, fx, X_sample, F_sample, result] = policySearchGeneralMDP(nr_arms,nr_balls); cd('../../') w_BO = x; extractGeneralBOpolicy;
function [ template_signals,template_lengths ] = create_templates( train_signals,train_labels,train_lengths,warping_window_size,debug ) disp(' Creating Templates...'); actions = zeros(max(train_labels),[],size(train_signals,2),size(train_signals,3)); lengths = zeros(max(train_labels),[]); observati...
clear all; close all; addpath('lib'); global par; par.n_text_ar = {'2','4','6','6'}; par.m_text_ar = {'1','2','3','2'}; for ind = 1:length(par.n_text_ar) par.n_text = par.n_text_ar{ind}; par.m_text = par.m_text_ar{ind}; par.n = str2double(par.n_text); % number of channels par.m = str2double(par.m_text...
function D = semanticRules(ensemble) semantic_list = {'M ';'H ';'VH ';'VVH ';'L ';'VL ';'VVL '}; % is a cell array rules_semantic = ensemble.rules; for i=1:size(ensemble.rules,2) index = ensemble.rules(i).belong; rules_semantic(i).antecedent = {}; rules_semantic(i).conse...
function FPath = FLSetup(CVol) FlowArea = 3.71612; FPath.Num = length(CVol.IDs) - 1; FPath.FlowAreas = repmat(FlowArea,FPath.Num,1); FPath.OpenFrac = repmat(1.00,FPath.Num,1); FPath.Dh = repmat(1.9367,FPath.Num,1); FPath.Seg = repmat(1,FPath.Num,1); FPath.Lengths = GetFPathLengths(CV...
function out=Xcone(etax,etay,etaz,R,h) etap = sqrt(etax.^2+etay.^2); out = (2*pi*sqrt(-1)/etaz).*(exp(-sqrt(-1)*h*etaz).*I2(etap*R,etaz*h)-(R/etap).*besselj(1,R*etap) );
% function M=ncread_coriolis(filename) % returns a structured data corresponding to the file content. % GB 15.07.2010 % AB 14.02.2012 function M=ncread_coriolis(filename) ncid = netcdf.open(filename, 'NC_NOWRITE'); [~, nvars, natts, ~] = netcdf.inq(ncid); globalConst=netcdf.getConstant('NC_GLOBAL'); for attID=0:natt...
function sub_entrust_checkbox_mktpx(hObject, eventdata, handles) % 期权交易市场价的选择 % 吴云峰 20170329 set(hObject, 'Value', true) set(handles.sub_entrust.table_limitprice, 'Data', cell(0, 2)) set(handles.sub_entrust.checkbox_limitprice, 'Value', false) end
function x=newton_hybrid(f,g,h,x0,alpha,beta,epsilon) % Méthode hybride de Newton % % Input % ======================================= % f ......... fonction objectif % g ......... gradient de la fonction objective % h ......... matrix hessiane de la fonction objectif % x0 ......... point initial % alpha ..... ...
% ADVISOR data file: TX_MT643.m % % Data source: % % % Data confirmation: % % Notes: % This file defines the Allison MT-643 4-speed automatic transmission % including hydraulic torque converter, gearbox, and final drive. No data % was available for the torque converter so a constant 85% efficiency for % the system ...
function [Pss_off, Bss_off]=StableFocalPoints_off(P_env ,gamma_B, kappa_P, delta_P) Pss_off=(P_env*kappa_P)/(delta_P + delta_P*gamma_B); Bss_off=1; end
function [nm,s1,s2,s3,s4,nm_i,s4_i] = dataRead_spreadsheet(xl_name,sheet_name) %----------------- Begin code ------------- test1=xlsread (xl_name,sheet_name); % Read numeric data from 'all the data' sheet of 'test1.xls file' % test1=xlsread ('test1.xls','all the data'); test1(isnan(test1))=0; % NaN is replaced with 0...
function [res] = validate_negative(entry, number, op) n = length(entry); misplaceds = []; inplaceds = []; for i=1:n k = number(i); [mem,f] = ismember(k,entry); if (mem) if(f==i) inplaceds = [inplaceds, i]; else misplaceds = [misplaceds, i]; end end end ...
function [cor] = pevalc(data, cluster) uc = unique(cluster); for c = 1 : length(uc) dc = data(cluster == uc(c), :); n = size(dc, 1); pcc = 0; cora = 0; for i = 1 : n for j = (i + 1) : n pcc = pcc + 1; cora = cora + corr2(dc(i, :), dc(j, :)); end; end; cor(...
function cbar = colorbar_log(my_clim) %COLORBAR_LOG Apply log10 scaling to pseudocolor axis % and display colorbar COLORBAR_LOG(V), where V is the % two element vector [cmin cmax], sets manual, logarithmic % scaling of pseudocolor for the SURFACE and PATCH % objects. cmin and cmax should be specified on a LINEAR % sca...
function [frame,state] = bufferedVidRead(state,time,vobj) n_frame = vobj.vid.NumberOfFrames; f_idx = ceil((time-vobj.offset)*300); f_idx = max(f_idx, 1); f_idx = min(f_idx, n_frame); % Store desired frame state.frame_idx = f_idx; % If a new buffer is ready, swap if state.update state.buffer = state...
function plot_and_export_color % % if (matlabpool('size') == 0) %opens only if it is closed % matlabpool('open','local',4) % end load('others.mat'); load('non_dominated.mat'); M = 2; %number of objective functions % the following instructions are needed now before non_domination will alway...
% Mean 정규화 보정 스펙트럼 function [Spectral] = Mean_normalize (x) [XS1 YS1] = size(x); SpectralMean = mean(x,2); Spectral = zeros(XS1, YS1); for i = 1:XS1; Spectral(i,:) = x(i,:)'/SpectralMean(i,:); end
%-------------------------------------- % Chris Dalke % CSC 249 - Homework 02 %-------------------------------------- % Takes in an region image and % returns the number of labels in the image. %-------------------------------------- % Function Definition %-------------------------------------- % Gets the number of d...
%load Cactus_cfp8_3d_transB_5lev; %load ParkScene_cfp8_3d_transB_5lev; %load Kimono_cfp8_3d_transB_5lev; %load CrowdRun_cfp8_3d_transB_5lev; %load BQTerrace_cfp8_3d_transB_5lev; %load OldTownCross_cfp8_3d_transB_5lev; Ldc=coef(:,:,2); L5=coef(:,:,5); L4=coef(:,:,9:10); L3=coef(:,:,17:20); L2c=coef(:,:,33:40); L2b...
rp.height = 1000; rp.width = 1000; rp.phi = deg2rad(90); x = repelem(0,199); x=x.'; %AvgFace shpA = coef2object( x, model.shapeMU, model.shapePC, model.shapeEV ); texA = coef2object( x, model.texMU, model.texPC, model.texEV); %Genned Face shpG = coef2object( randn(199, 1), model.shapeMU, model.shapePC, mode...
function val = N(m,x,y) % ------------------------------------------------ % funcion de prueba N para un m dado % ------------------------------------------------ val=sin(m*pi*(x+1)/2).*sin(m*pi*(y+1)/2); end
function shotgun_seqs = s_to_shotgun(s, num_shotgun, l_shotgun) shotgun_seqs = reshape(s, l_shotgun, num_shotgun); end
%% Stelling 6 % % Met behulp van de functie mediaan() kan de mediaan % van een vector worden berekend. % Antwoord = 0;
function [Order,Error] = EsimatePolynomialOrder(Function,TestSeed) persistent ErrorTemp if (nargin < 2) TestSeed = 5.0E5; end TestValues = TestSeed:10^(log10(TestSeed)-3):1.50*TestSeed; Tolerance = 1E-8 ; FunctionValues = Function(TestValues); DerivativeOf = Differentiate(TestValues,FunctionValues)'...
function freqs = freqs_harm(BF,minf,maxf) n=round(BF/minf); F0=round(BF/n); freqs(1)=F0; last=F0; i=2; while last<maxf % i freqs(i)=freqs(i-1)+F0; last=freqs(i); i=i+1; end
function [atlas_data,ROI] = cluster2atlas(clusters,atlasnii,atlaslist,regions,varargin) % CLUSTER2ATLAS gets a reference atlas and clusters created by functional % clustering and maps the clusters to the given atlas. % % [ATLAS_DATA,ROI] = CLUSTER2ATLAS(CLUSTERS,ATLASNII,ATLASLIST,REGIONS) % gets the path to the clust...
% SERIAL_RECV_ARRAY This function receives a vector from the DSP Shield. % % X = SERIAL_RECV_ARRAY(S) receives data vector X over the serial % object S assuming INT8 data type. % % X = SERIAL_RECV_ARRAY(S, TYPE) receives data vector X over the serial % object S assuming TYPE as data type. Valid da...
classdef XY2 < sqc.op.physical.gate.X2m % -pi/2 rotation at at an arbitary axis in the xy plane % Note: halfPiAmp for different rotation axis are not exactly the same, % use this operation for coarse application or tunning only. % Copyright 2017 Yulin Wu, University of Science and Technology of China % mail4...
function hexagi_behaviour_test_LMShift(Subjects,ProcPath,StatsPath,FigPath) % Evaluates if the drop locations are shifted in the DIRECTION of the landmark in the test phase ~= landmark bias in memory for the test phase % Checks if the angular difference of the vectors % 1) the correct object location to the LM ...
function [selectivity, act_peak, act_total, actGauss] = calc_selectivity(win_row, win_col, dist_mat,p) % calc_selectivity -- calculates selectivity of grid to stimulus input. % Currently, calculates both in terms of classic logistic but also now new % guassian selectivity. % called by: present_stimulus % calls: NA % ...
function [msd hd] = surface_distance(truth, estimate, res_dims) % MEAN_SURFACE_DISTANCE - returns the surface distance metrics between a true % segmentation and an estimate % % [msd hd] = surface_distance(truth, estimate) % % Input: truth - the true segmentation % estimate - the estimated...
function zero_level = level_norm_edge(img,row_num) % input: img - gaussian distributed matrix, row_num - number of rows % included for average calculation % output: zero_level - average of all pixels on the edge of the image up to % row_num zero_level = mean([mean(img(1:row_num,:)) mean(img(end-row_num:end,:)) mea...
function L = lapla2(I, para, K) % function LAPLA2 returns the Laplacian of image I with weighting factor [m, n] = size(I); % following x-axis GE = I(:,[2:n,n]) - I; GE = weight(GE, para, K).*GE; GW = I - I(:,[1,1:n-1]); GW = weight(GW, para, K).*GW; Ixx = GE - GW; % following y-axis GS = I([2:m,m],:) - I; GS = weigh...
function result=SelectSensitiveSubc(Txant,Rxant,RawCSI,silentEndPoint) %选择出对当前环境变化敏感的子信道集合 %csi_entry在次函数中是一个csi_entry的在一个时间窗口的集合 %SilentPkt为静默时间段的csi_entry的集合 %silentRange为静默时间段 count_channel=1; length(RawCSI) %处理csi数据获取子信道集合 for num=1:length(RawCSI) csiSubc_choose(:,num)=abs((RawCSI(Txant,Rxant,:))); for i_chan...
%fileFormat = 1,xls, varargin 1= SheetName, 2 = RangeName function dataTable = ReadDataFile(fileFormat, filePath,varargin) if fileFormat == 1 if numel(varargin) == 0 dataTable = xlsread(filePath); elseif numel(varargin) == 1 % input a SheetName(or SheetNumber) dataTable =...
%function vol=Vidto3d(name,stru,elem,ITER) function vol=newvidto3d(name,stru,in) x = dicomread(name); Y=collectFrames(x,in); %FINAL=process(Y,stru,elem,ITER); vol=newvolume(Y,stru,in); newshow; end
clear all; % close all; clc; load('5_LDTWICDAR.mat'); [allAccuracyArr,mytotarr] = cellToArrForPlot(allResult); mean_avg_pre = meanAveragePrecision(allAccuracyArr); disp('5_LDTWICDAR'); disp(mean_avg_pre); [X4,Y4,Z4,M4] = plotAccuracyGraph_2(mytotarr); clear allResult; clear allAccuracyArr; load('DTWICDA...
pkg load symbolic function resultado = trapecio_compuesto(funcion, a, b, m) % Regla compuesta del trapecio para calcular la integral de una funcion % :param funcion: Funcion a integrar % :param a: Limite inferior % :param b: Limite superior % :param m: Cantidad de puntos a utilizar % :return: ...
function test_socmodel_co() test_rejectbadrange(); test_rejectbadsize(); test_comparetosaved(); end function test_rejectbadrange() params = [1 0.5 45 45 5 3 0.5 0.95]; im = reshape(101:125, 5, 5); % Numbers are too high assertExceptionThrown(@() socmodel_co(params, im), 'MATLAB:assertion:failed...
%load forDraw.csx manually using the GUI MULT=1.5; POINT_SIZE=1; AXIS_LIMIT=50; set(0,'DefaultFigureRenderer','opengl') C=failure; VecZero=zeros([size(C,1),1]); X=Load_UnloadCycleCount; Y=UncorrectableSectorCount; Z=ReadChannelMargin; %ReadChannelMargin %UncorrectableSectorCount %Load_UnloadCycleCount %CurrentPendi...
%generate test matrices sz = [100 100]; off = [3 2]; noisefrac = 0.1; I1 = rand(sz); I2 = rand(sz); I2(off(1)+1:end,off(2)+1:end) = I1(1:end-off(1),1:end-off(2)); ind = round(rand(ceil(noisefrac*numel(I1)),1) * (numel(I1)-1)) + 1; I2(ind) = I2(ind) + rand(size(ind)); I2(I2 > 1) = 1; [x,y,u,v] = cpiv(I1,I2, [10 10 ...
%Author:Eduardo Alho %Date:13/04/2018 % This script aligns pair of slices of a volume using mri_robust_register. % It chooses the final slice of the stack to register with the previous . %The default alignment mode is 3DOF, but affine can be also used. % Be careful with this option, it can propagate volume errors. %r...
/* Blake2s.c -- BLAKE2s and BLAKE2sp Hash 2015-06-30 : Igor Pavlov : Public domain 2015 : Samuel Neves : Public domain */ #include <string.h> #include "Blake2.h" #include "CpuArch.h" #include "RotateDefs.h" #define rotr32 rotrFixed #define BLAKE2S_NUM_ROUNDS 10 #define BLAKE2S_FINAL_FLAG (~(UInt32)0) static const ...
function commandlist = mcommandlist %MCOMMANDLIST Retrieves a list of available Maestro commands from the %manifest. % COMMANDLIST = MCOMMANDLIST will retrieve the command list. The COMMANDLIST is an nx3 cell array. The first column % is the full name of the command. The second column contains cell arrays of aliase...
function probeData(settings) % Function plots the PSD of rawdata. % It is used for checking if the data record is fine or problematic. %% Generate plot of raw data ============================================== [fid, message] = fopen(settings.fileName, 'rb'); if (fid > 0) % Move the starting point of pro...
disp('Question 7 is running ...'); %% global variables or settings %% A
function [] = plotDCAllBuses(dcFrac, storageFrac, optimalStorageFrac) b = bar([dcFrac, storageFrac], 'grouped'); set(b(2),'FaceColor','m'); set(b(1),'FaceColor','k') x_label = xlabel('Bus Location'); y_label = ylabel('Violation Frequency'); set(x_label, 'FontSize', 14); set(y_label, 'FontSize', 14); l = legend...
function acquireHutchen(length) settings = tfSettings(); sampleRate = 25000; analogIn = analoginput('mcc','1'); % set(analogIn, 'InputType','SingleEnded'); % Unused on mcc boards warning('off', 'daq:daqmex:propertyConfigurationError'); set(analogIn, 'SampleRate', sampleRate); addchanne...
function [fann] = Fit(obj,img,ann) %Fit Summary of this function goes here % Detailed explanation goes here fann = zeros([size(obj.sm{1}.mu_ann),obj.n_it]); img = obj.tm{1}.ColorTransformAll(img); [ann,detected,p] = obj.detector.Run(obj.sm{obj.n_level},img,ann); if detected n_...
% visim : runs visim with parameter file or visim structure % % Call : % visim('visim.par'); % % V=read_visim('visim.par'); % V.nsim=10; % visim(V) % % % To use an alternative visim exe file use : % visim('visim.par','visim_801_801_1_1'); % First the local folder is searched for an exe file with the propose...
function tf = concatenateFiles(obj, pathVal, fileList) % CONCATENATEFILES Concatenate the specified list of files into this file. % The target should not exist. The source files will be deleted if the % concatenate succeeds. Returns true if the call succeeds. pathVal is the full % pathname of the destination to concate...
% ------------------------------------------------------------------------- % save weights, accumulated gradient, params, history % ------------------------------------------------------------------------- function [weights, grad] = save_params(fname_mat, weights, grad, params, t, history) weights = gpu2cpu_struct(w...
%% Stelling 12 % % De volgende code geeft een foutmelding: % % --------Code----------- % stuwKracht= [42 31 35 12 31 42]; % stuwkracht(1) % ------------------------ % Antwoord = NaN; % vul hier het juiste antwo...
function [ Gth Gphi ] = horizontalDipole( I, th, phi ) %UNTITLED13 Summary of this function goes here % Detailed explanation goes here % define theta part of G Gth = 12*pi*abs(I) *(cos(th)*sin(phi))*sin(pi/2*sin(th)); % define phi part of G Gphi = 12*pi*abs(I) *(cos(phi))*sin(pi/2*sin(th)); end
function [Pa_b, Pb_a, Pa, Pb, Pab ] = cprob02(a,b) % function [Pa_b, Pb_a, Pa, Pb, Pab ] = cprob02(a, b) % % (c) 2005 Luis Hernandez-Garcia % University of Michigan % report bugs to: hernan@umich.edu % % Find the conditional probability of A being in the aRange interval % given that B is in the bRange interval % % t...
% Course : Matlab programming in numerical computation % Lec 3.1 : Differentiation in single variable % Comparing numerical differentiation formulae for f'(x) % Calculate f'(x) at x = 1 ; f(x) = tan-1(x) a = 1; trueVal = 1/(1+a^2); h = 10.^[-1:-1:-10]; %% Forwad difference formula fwdDiff = (atan(a+h)-atan(a))./h; errF...
function [D, IDs] = getSynapseSomaPathLength(neuron, synapseType) % GETSYNAPSESOMAPATHLENGTH % % Description: % Get distance from soma measured as path length % % Syntax: % [D, IDs] = getSynapseSomaPathLength(neuron, synapseType) % % Inputs: % neuron Neuron obj...
function [vSort,ix,iy,iz] = sort3d(m,strMode,strZeros) % General-Purpose Toolbox - a package of utilities used primarily for % in-house analysis workflows. This set of tools was developed as an % in-house package by the Stroke Rehab Team of the Functional Electrical % Stimulation (FES) Center in Cleveland, Ohio. T...
% start timing/trigger NetStation('Connect', '10.0.0.42'); WaitSecs(1); NetStation('StartRecording'); WaitSecs(1); NetStation('Synchronize', 45); WaitSecs(1); NetStation('Event', ['STI' num2str(theData.oldNew(Trial))], theData.VBLTimestamp(Trial), .01); %1 = OLD; 2 = NEW; theData.preSynchTime(Trial) =...
function hexagi_behaviour_transfer_MemoryBias_SGM(Subjects,ProcPath,StatsPath,FigPath) % Memory bias analysis - SGM % Calculate LM and boundary bias according to the SGM model by Schuck et al., 2015. % Boundaries: 1=Standard, 2=Large, 3=small % Plot the differences % Correlate memory bias and navigational prefer...
function [ indUpThreeMethod ] = isUpThreeMethod(obj, bars ) %% % 《日本蜡烛图技术》,1998年5月第一版,P141 %% Parameters lenLimit = 0.01*obj.zoomFactor; %% indFirst = (bars.yinYang==1)&(bars.barLen./bars.open>lenLimit); indFirst = indFirst(1:end-4); indLadder = (bars.barCeil(2:end-3)>bars.barCeil(3:end-2))&(bars.barCeil(3:end-2)>bars...
% clear; close all; clc addpath('Ex 24'); addpath('Ex 24/minFunc'); addpath('Ex 25'); %% generate data % need: % m1TrainData % m2TrainData % m1TestData % m2TestData % trainTargets % testTargets n = 10000; resz = 0.25; nq0 = 10000; nq1 = 10000; %[dataset1,dataset2,x,y,z,~,~] = get2data(n,str,resz); [dataset1,dataset...
function rho = visualize1d(folder, plottingparams, problemparams) FS = plottingparams.FS; % font size LW = plottingparams.LW; % line width PP = plottingparams.PP; % paper position rhoExact = dlmread('exactLineSource.txt'); rhoNumerical = dlmread(strcat(folder, '/rhofinal.txt')); rhoNumerical = rhoNumerical(3:end-2, ...
clear; % Population y0 S0 = 200000; E0 = 0; If0 = 1; Is0 = 0; R0 = 0; years = 100; y0 = [S0 E0 If0 Is0 R0]; options = odeset('RelTol', 1e-5); steps = 0:0.01:years; [t, y] = ode45(@(t,y) seiir_model(t, y), steps,y0,options); y = y(:, 3:5); labels = {'If' 'Is' 'R'}; %y = y(:, 3:4); labels = {'If' 'Is'}; plot_disea...
function [ output_args ] = mtspImageObs(data,grp,mz) %mtspImageOps - make a function that groups spectra in an image etc... % Best to sort the observations by grp [~,idx] = sort(grp); grp = grp(idx); % If we have specified the m/z value then sort by that too... if nargin == 3 [~,varIdx] = sort(mz); else varId...
function ramped_snd = rampMySound(snd,ramplen,Fs) ramplen = (ramplen/1000)*Fs; len = length(snd); ramp = 0:(1/ramplen):1; flip_ramp = fliplr(ramp); env = [ramp ones(1,len - 2*length(ramp)) flip_ramp]; ramped_snd = env.*snd;
function [idx_, dim, t] = twoPixelTest( D, data ) dim = randsample(D-1,2); datamin = min(data(:,dim(1)) - data(:,dim(2))); datamax = max(data(:,dim(1)) - data(:,dim(2))); % Random threshold for splitting within the range t = datamin + rand*(datamax-datamin); idx_ = data(:,dim...
clc clear %% Initial parametric analysis disp([ ' -------------------- Initial parametric analysis -------------------- ']) % ---- rA changing ---- rA = 0:0.0005:0.005; % parameters - average vales based on upper and lower bounds rB = ((0.005+0.02)/2); rC = ((0.02+0.021)/2); L = ((1.57+2.14)/2); kB ...
function Grad = CalcGrad(X) [X_rows, X_cols] = size(X); [Dx, Dy] = CreateDerivativeOperators(X_rows, X_cols); Gx = reshape(Dx*X(:), size(X)); Gy = reshape(Dy*X(:), size(X)); Grad = sqrt(Gx.^2 + Gy.^2);
%this program is to get the normalized histogram of the image function [his]=myhist(x) x=floor(x); r=size(x,1); c=size(x,2); his=zeros(1,256); %calculate the histogram for i=1:r for j=1:c his(x(i,j)+1)=his(x(i,j)+1)+1; end end his=his./c./r;
% MODULUS 4postFSPEC_t1 % regenerate frequency spectrum % using peak % if most of them contain only one peak % the origin filtered frequency spectrum is kept % if most of them contain more than one peak % for g1 find one with largest amplitude % for g2 second largest amplitude is looked for ...
function [ feat, featNames ] = extractFeatures_IDGait_RightAcc(rightAcc,sf,windowSize,overlap) %Reed Gurchiek, 2018 % extract features from left and right anterior thigh accelerometer data. % %---------------------------INPUTS----------------------------------------- % % rightAcc, leftAcc: % 3xn accelerometer...
% Program to make Moire patterns. % First Moire pattern is from interference (multipication) to two linear sine wave ripples. % This is equivalent to the Fourier diffraction pattern of two infinitely long slits. % The second Moire pattern is from interference (multipication) to two Sombrero function ripples. % This is ...
% Data normalization by columns % input: Raw Data (DataRaw) % return: Normalized Data (DataNorm) % More examples: https://github.com/vasanza/Matlab_Code % Read more: https://vasanza.blogspot.com/ function [DataNorm] = fNormalization(DataRaw) DataNorm=[]; for i = 1:size(DataRaw,2) DataNorm=[DataNorm (Dat...
function [correctlyClassified, classificationErrors] = Validate(activationFunction, hiddenWeights, outputWeights, inputValues, labels) %zwraca statystykę błędów %korzysta z funkcji decisionRule i Evaluate % INPUT: % activationFunction : Activation function % hiddenWeights : Weights o...
classdef Dirichlet < handle % Summary of this class goes here % Detailed explanation goes here %% Proteries properties value; boundary; nodes; edges; faces; interiors; index; name; u; end %% Methodes methods function obj = Dirichlet(value, boundaryName, mesh) obj.value = value; ...
function A = random_skew_symmetric(n) if n > 1 m = nchoosek(n,2); else m = 1; end A = zeros(n); for i = 1:n-1 for j = i+1:n A(i,j) = randn(1,1); A(j,i) = -A(i,j); end end end
classdef CMNN < handle %cross-modal similarity net properties net1 net2 margin batchSize nwts getX1 getX2 getT getNData end methods(Static) function checkInput(x) if iscell(x) ...
% EJERCICIOS RESUELTOS DE VISIÓN POR COMPUTADOR % Autores: Gonzalo Pajares y Jesús Manuel de la Cruz % Copyright RA-MA, 2007 % Ejercicio 5.23: Suavizado y Realzado: filtro speckle Frost %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % 5.11.8 Filtrado: ruido "speckle" %%%%%%%%%%%%%%%...
%---------------------------------------------------------------------------------- % levi silvers jan 2017 %---------------------------------------------------------------------------------- tindex=size(temp_ts,1); nyears=tindex/12; tref_gmn_ts=zeros(tindex,1); tref_trmn_ts=zeros(tindex,1); tref_windmn_ts=zeros(...
function [resultMat] = doTestAutoEncoder(deepNet,dataTable,dataPath) resultMat=testDeepNet(deepNet,dataTable,dataPath); end %% function testResponse = testDeepNet(deepNet,dataTable,dataPath) fileExtension = '.mat'; load(deepNet); numRows=size(dataTable,1); testResponse = cell(numRows,1); for i=1:numRows fileName...
% this script loads the content of databaseSpecTablebasespec, runs EKF on the mocap databaseSpecTable, % then saves the output into a target folder clearvars clc runModelParam = 0; runEkf_mocap = 1; runAnalysis = 0; overwriteExisting = 1; visualize_pose = 1; visualize_main = 1; basepathSource = 'D:\aslab\data\FullB...
%% Initialization COAX56 = 1; if (COAX56) pid = nav_msgs_Odometry('connect','subscriber','odom56','odom56'); iid = geometry_msgs_Quaternion('connect','subscriber','coax_info56','coax_info56'); tid = geometry_msgs_Quaternion('connect','publisher','trim56','trim56'); mid = std_msgs_Bool('connect','publish...