text
stringlengths
8
6.12M
video_root = 'thumos15_testing'; frame_root = '/research/action_data/thumos2015/thumos15_testing_frames'; video_list = dir([video_root filesep '*.mp4']); parfor i = 1:length(video_list) [~,vname,~] = fileparts(video_list(i).name); avi2jpg([video_root filesep video_list(i).name], frame_root); testing_video_...
function [train_set, test_set] = split(bag_in,percent) bag1 = bag_in(1:60,:); bag2 = bag_in(61:end,:); % set training and testing set rand_bag1 = randperm(60); rand_bag2 = randperm(60); bag1_train_idx = rand_bag1(1:60*percent); bag2_train_idx = rand_bag2(1:60*percent); bag1_test_idx = rand_bag1(60*percent+1:end); bag2_...
function BpNetTrain(originalNetData,originalNetLabelData,originalTestNetData,originalTestNetLabelData)%,testInputData,testOutputData,ReturnTestMinMaxInputData1,ReturnTestMinMaxOutputData1 %BP网络 %%%%%%%%%%%%%根据数据自动检索并确定隐层神经元数目,以最小误差为标准,可调用函数%%%%%%%%%%% [dataTotalP,dataTotalT]= dataAdd( originalNetData,originalNetLabe...
function [F,U_L] = DCT(f) %UNTITLED3 Summary of this function goes here % Detailed explanation goes here blockSize = 4; [M,N] = size(f) F = zeros(blockSize,1,'single'); cos_u = zeros(blockSize,1); U_L = zeros(blockSize,blockSize); for u = 0 : blockSize-1 if u == 0 C = 1/sqrt(2); else C = 1; ...
function Labeling_X1() %Labeling_64 Divides images into segemnts for waste class labeling % % segementAxis = Number of segments along x and y axis of the image. % % Show the image to select class between 0 and 1. Class 0 indicates no % waste in the bin and class 1 indicates the presence of waste. If class % 0...
function [A,b,output] = external(A,b,do); % RIVERALK adds alkalinity from 34 rivers fprintf('%s','RIVandBUR...') load data/ao.mat; load data/RIVER.mat load data/burial/BUR.mat % turn the shoebox into a linear vector % umol ALK kg-1 yr-1 riverb = RIVER(ao.iocn); burialb = BUR(ao.iocn); burialb(isnan(burialb))=0; %...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Author: Trinh, Khanh V <khanh.v.trinh@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: ...
classdef SpectrumTrimmerInterface < handle %SpectrumTrimmerInterface Interface for spectrum trimmers methods (Abstract) trimmedSpectrum = Trim(obj, spectrum) end end
function msspectra = retrieveMSSpectra(obj,varargin) % RETRIEVEMSSPECTRA: Read MS Spectra from an mzXML object % % Syntax: % msspectra = retrieveMSSpectra(mzXMLobj) % msspectra = retrieveMSSpectra(mzXMLobj,scannum) % msspectra = retrieveMSSpectra(mzXMLobj,'mslevel',MSLEVEL) % msspectra = retrieveMSSpect...
% This file defines three functions: % Smooth_sse: Smoothing data using the inner coefficient optimization % Profile_sse: Optimizing parameter values using outer optimization % sse_setup: Set up error sum of squares functions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% func...
classdef Leg < handle properties len %joint lengths offset_coord %ground frame offset coordinates offset_angle %ground frame offset angle ee %end effector coordinates theta %joint angles body %defines every poin...
function M = linearSourceTerm2D(k) % Matrix of coefficients for a linear source term in the form of k \phi % % % SYNOPSIS: % M = linearSourceTerm2D(k) % % PARAMETERS: % % % RETURNS: % % % EXAMPLE: % % SEE ALSO: % % extract data from the mesh structure Nxy = k.domain.dims; Nx = Nxy(1); Ny = Nxy(2); G=reshape(1:(Nx+2)...
function [weights] = getrbfrep(par, H) x = getnodes(par); tree = gettree(par); fdsize = par.fd; ep = par.ep; rbf = @(ep,rd2) exp(-ep^2*rd2); N = length(x); weights = zeros(N,fdsize); for j=1:N imat = tree(:, j); rd2 = max(0,2*(1-x(imat,1)*x(imat,1).' - ... x(imat,2)*x(i...
%% Compute and store states for two dendrites coupled to a cell body %addpath('../Matlab/mole-master/mole_MATLAB') % path of mole library addpath('/Users/pshoemaker/Desktop/MOLE/mole_MATLAB'); dt = 5E-4; % time step for temporal integration ncells = 1; % single cell terminating dendrite nmorphs = 2; % no branched...
function output = get_cluster_info(handles) numTraces = size(handles.selected_data,1); temp_var_names = []; for k=1:numTraces temp_covar = []; for i=1:size(handles.selected_data{k,7}.covmats,2) temp_name = []; for j=1:size(handles.selected_data{k,7}.covmats{i}.varnames,2) ...
function [obsData,lData] = extractSpeechFeature(ampVector,fsVector,ampLengthVector, windowLength,numberOfCeptralBands) startIndex = 1; endIndex = 1; obsData = []; for i=1:12 %figure out where in the ampVector the current sample is. startIndex = endIndex; endIndex = endIndex + amp...
% UNTITLED Summary of this function goes here % Detailed explanation goes here function [pK_G] = GWishartDensity(K,A,b,D) %%%%%%%%%%%%%%% SET CONSTANTS %%%%%%%%%%%%%%% NUM_SAMPLES = 100; %%%%%%%%%%%%%%% VALIDATE INPUTS %%%%%%%%%%%%%%% % Make sure K, A, and D are square matrices with same dimension assert(size(K,...
function plot_tunes() % h.txt : Straight, columns are energy (eV), 2*cos(2*pi*nux), 2*cos*(2*pi*nuy) % i.txt : Arc, columns are energy (eV), 2*cos(2*pi*nux), 2*cos(2*pi*nuy), ToF (s) data = load('4pass_tune_measurements.mat'); data = data.trial_run; h_data = importdata('h.txt'); i_data = importdata('i.txt')...
function DCM=calDCM(ang_vect) % input % ang_vect: angles/rad % output % DCM: direction cosine matrix % reference: Titterton D H, Weston J L. Strapdown Inertial Navigation Technology[M], 2nd ed. 2004, p312. % zsh 20140903 as = antisymm(ang_vect); mag = norm(ang_vect); if mag == 0 DCM = eye(3); else DCM =...
dataset = load('../data/traintest.mat'); T = length(dataset.train_imagenames); vision = load('visionRandom.mat'); K = size(vision.dictionary, 1); idf = zeros(1,K); for i=1:K count = sum(vision.trainFeatures(i,:) > 0); idf(i)=log(T/count); end save('idf_random.mat','idf'); vision = load('visionHarris.mat'); id...
function [ R, p ] = TransToRp( T ) %Usage: %Input - A valid transformation matrix T of SE(3) %Output - Rotation matrix R (SO(3)) and position vector p R = []; p = []; epsilon = 10^(-5); if (numel(size(T)) ~= 2 || size(T,1) ~= size(T,2)) disp('T is not a valid transformation matrix either because it has more than...
function [I1_TF,I2_TF]=mutual_transform_2d_double(I1,I2,I1_moved,I2_moved,range,HistogramBins,Hkernel, SampleDistance) % This function transform one image modality into another. % % [I1_TF,I2_TF]=mutual_transform_2d_double(I1,I2,I1_moved,I2_moved,range,HistogramBins,Hkernel, SampleDistance) % % Function is written by ...
% Windows client serving UDP communication requests from % ModulationTrialSequencePupillometryNulledOnLine.m (Mac) % These two programs must be run in tanden to conduct the pupillometry experiments. % % 03/01/2016 NPC Wrote it (by modifying OLFlickerSensitivityVSGpupillometry) % 03/04/2016 NPC Added UDP communi...
% characterizeTrigger Charaterize digitizer trigger time % % This method characterizes the trigger time of a specified digitizer as % recorded by ZDAS. % result=characterize(object,filename,record); % The second input is the name of a ZDAS (*.hdf), PFF (*.pff), or text (all % other extensions) where the digitizer's ...
function [no_of_pts] = HFSS_Setup(fileID,freq,sfreq,efreq,fstep,Type) % HFSS_Setup generates a script to generate a setup with selected sweep % type. It will create the setup with the following configurations: % Maximum Number of Passes = 20 % Maximum Delta S = 0.02 % Minimum Number of Passes = 2 % Minimum Conve...
function trace = trace_simulator(varargin) %TRACE_SIMULATOR Simulate AP2 traces based on various model parameters % List of model paremters: % poff - percent of off, photobleached, or unlabeled AP2 molecules % flint - fluorophore intensity under a normal distribution % dt - control timestep size for binding probab...
lam=1-10^(-15); d=2; w_range=linspace(0,100,10^5); [Fbar, FRbar] = FRbar_LL_exp(lam, d, w_range); Fbar2=(lam*exp(2*lam*w_range)-exp(2*lam*w_range)+1+lam)./(-lam*exp(2*lam*w_range)+exp(2*lam*w_range)+1+lam); Fbar3=lam./(-lam*exp(lam*w_range)+exp(lam*w_range)+lam); plot(w_range, Fbar) hold on plot(w_range, Fbar2) plot(...
fid = fopen( 'printfile.m' ) ; while 1 linie = fgetl(fid); if ~ischar(linie), break, end disp(linie); end fclose(fid);
function [results] = hsic2nloop(X,Y,Z1,Z2,N,l,nloops,pathout,pathds) %This function launches nloops conditional hsic tests and store the output %INPUTS % X: dim x % Y: dim y % Z1: dim 1 of z % Z2: dim 2 of z % N: subdataset size in indtestimpl_nloop_sval % l: number of loops in indtestimpl_nloop_sval % nl...
function mickey_core(~,~,hfig) CmsCoreProp=get(hfig,'userdata'); axes(CmsCoreProp.handles.coremap); global knum; global cn; pt = get(CmsCoreProp.handles.coremap, 'CurrentPoint'); i=round(pt(1,2)); j=round(pt(1,1)); knum=cpos2knum(i,j,CmsCoreProp.core.mminj); if (knum) sel_typ = get(hfig,'SelectionType'); s...
function [ exact ] = problem_solution(t,quadpoint,data) % Computes the exact solution % written by data.Pierson Guthrey % ------------------------------------------------- % INdata.PUTS (t,v1,v2,v3) : location in space-time % OUTdata.PUTS exact : the given exact solution evaluated at the location % Note: other ...
function [S] = readSEL(filename) % READSEL read selection from .sel file (as used by Mario Botsch and Olga % Sorkine in the accompanying data to their survey "On linear variational % surface deformation methods" % http://igl.ethz.ch/projects/deformation-survey/ % % Input: % filename path to .sel file ...
function STATE = renorm_load(datapath, varargin) global DATAPATH; global SUBJ; global ANALISES; if nargin < 1 datapath = [DATAPATH filesep SUBJ filesep ANALISES ]; end max = 50; if (nargin > 1) max = varargin{1}; end files = dir(datapath); n = size(files,1); if (n > max+2) n = max+2; end STATE = cell(...
%Tyler Matthews 1/244/19 %System Simulation Problem 02 clc; %CLEAR CONSOLE %INITIAL VARIABLES z = 0.5; N = 500; t = linspace(0,z,N); T = z/N; %X A = ((13333.3/2)*T^3 + 33.3333*T^2 - T); B = ((13333.3/2)*T^3 - 33.3333*T^2 + 2*T); C = (-1*T); %Y D = ((693333/2)*T^3 + 12133.3*T^2 + 185.333*T - 3); E = ((693333/2)*T^3...
function [note, octave] = Ffreq2note2(f_v) %function [note, octave, cents, thirdOct] = Ffreq2note2(f) % % Converti une frequence en note, la 440 = A4 % avec les 1/4 de tons % chromalist = {'C'; 'C+'; 'C#'; 'C#+'; ... 'D'; 'D+'; 'D#'; 'D#+'; 'E'; 'E+'; 'F'; 'F+'; 'F#'; 'F#+'; ... 'G'; 'G+'; 'G#'...
function [X_s,Y_s,Z_s,x,y,z] = innsbruck %% Coordenadas de las estaciones MLAT Latitude=[47 15 28.2; 47 18 46.4; 47 14 37.4; 47 15 11.6; 47 19 15.7; 47 24 34.6; 47 18 11.9; 47 18 49.3;];%47 12 31.4; Longitude=[11 21 9.8; 11 23 10.3; 11 10 51.9; 11 33 20.9; 11 44 30.8; 11 47 15.1; 11 04 23.1; 11 10 39.5;];%11 27 36....
function missed_extraction_watchdog(varargin) % function missed_extraction_watchdog(varargin) % % Routine that checks for missed extractions from booster event_timevec = []; last_waveform_cnt = 0; f1=figure; while 1 new_waveform_cnt=getpv('ztec2:Inp1WaveCount'); if new_waveform_cnt>last_waveform_cnt ...
% Unbalance Inductance L_unequal =[84e-6, 180.2e-6,186.8e-6; ... 180.2e-6, 67.4e-6, 67.3e-6+67.4e-6 ;... 186.8e-6, 67.3e-6+67.4e-6,67.4e-6]; M_unequal= [L_unequal(1,1), (L_unequal(1,2)-L_unequal(1,1)-L_unequal(2,2))/2 ,(L_unequal(1,3)-L_unequal(1,1)-L_unequal(3,3))/2 ;... NaN, L_equal...
function varargout = wavestats(Wxy,freq,time) nFreqPts = size(Wxy,1); nTimePts = size(Wxy,2); nFiles = size(Wxy,3); nChannelPairs = size(Wxy,4); tvmf = zeros(nFiles+2,nTimePts); tvpf = zeros(size(tvmf)); for fn = 1:size(Wxy,3) [tvmf(fn,:),tvpf(fn,:)] = instantaneouswavefreq(Wxy(:,:,fn),freq); end tvmf(fn+1,:) = ...
function [pos,J]=evalRobot2D(l,theta) % f1 pos(1,1) f2 pos(2,1) pos(1,1) = l(1)*cos(theta(1))+l(2)*cos(theta(1)+theta(2)); pos(2,1) = l(1)*sin(theta(1))+l(2)*sin(theta(1)+theta(2)); % Jocobean: theta(1) x theta(2) y f1_x = -l(1)*sin(theta(1)) - l(2)*sin(theta(1)+theta(2)); f1_y = -l(2)*sin(theta(1)+theta(2)); ...
func = @f15; D = 2; R = eye(D); Q = R; x_opt_val = zeros(D,1); f_opt_val = 0; f = func(D, x_opt_val, f_opt_val, R, Q); %% N = 100; %% X = linspacem(-5,5,N,2); T = zeros(size(X,1),1); %f(X); for i = 1:(N*N) T(i) = f(X(i,:)'); end %% D = size(X, 2); eg = 1.5; % sum-squared error goal sc = 1; % spread consta...
function h = graynext(d, g, n) % h = graynext(d, g, n) takes nonnegative integer array % g , interpreted as n-bit Gray Cyclic Binary Codes, % elementwise through one step forward, if d > 0 , % or otherwise backward through the Gray codes, so % h and g have the same size. If not a scalar, d ...
function sum_obj = calculate_obj_GAL234( expt_level, basal_level, induction_level, basal_frac ) % this function takes in the basal level and induction level of the simulation results, % and the experimental data (trait), then calculate the difference between them, % return the sum of the difference as sum_obj (the obje...
function pc=gauss2dxyfit_eval(indata,inarg) % % function gauss2dfitxy(indata,inputarg) % % Used in conjunction with gauss2dfit(), this function will simply % output the gaussian for comparing with the input data. The % purpose is simply to allow the user to visually arrive at a % set of starting input parameters % % i...
function c=poly(A) [nr,nc]=size(A); if nc==nr R0=eye(nc); R=R0; c=[1 zeros(1,nc)]; for k=1:nc c(k+1)=-1/k*trace(A*R); R=A*R+c(k+1)*R0; end elseif (nr==1 | nc==1) A=A(isfinite(A)); n = length(A); c = [1 zeros(1,n)]; for j=1:n c(2:(j+1)) = c(2:(j+1)) - A(j).*c(1:j); ...
classdef EvidenceState properties (Constant) Happened = 2; Unhappened = 1; Unknown = []; end methods (Access = private) function obj = EvidenceState end end end
function res = clipPolyline(poly, box) %CLIPPOLYLINE Clip an open polyline with a rectangular box. % % POLY2 = clipPolyline(POLY, BOX); % POLY is N-by-2 array of vertex coordinates. % BOX has the form: [XMIN XMAX YMIN YMAX]. % Returns the set of polylines created by the intersection of the % polyline POLY and...
%% load data %cd('C:\Users\Mirone\Desktop\Aarhus Uni\Dropbox\Exe\Exe_matlab') clc; clear; close all; pwi=csvread('pwi.csv'); dwi=csvread('dwi.csv'); mask=csvread('mask.csv'); %% show image % pwiIM=imshow(pwi,[0 33]); % dwiIM=imshow(dwi,[0 800]); pwiIM=imagesc(pwi); %show image in color limit scale to sig...
function drawProb2() figure; x = linspace(-7,7); y = 7*ones(1,100); plot(x,y,'k','LineWidth',1.5) hold on; plot(x,-y,'k','LineWidth',1.5) plot(y,x,'k','LineWidth',1.5) plot(-y,x,'k','LineWidth',1.5) xx = linspace(-40,40); yy= zeros(1,100); plot(xx,yy,':k','LineWidth',0.3) plot(yy,xx,':k','LineWidth',0.3) a...
classdef (Sealed) RunnerSimpleStats < graph.runner.Runner %RUNNERSIMPLESTATS A runner that computes simple graph statistics. % This class computes some descriptive meta data of a graph. % % See also: RUNNER. %=========================== PROPERTIES ============================== p...
function L = XYZ_to_Luminance(bitDepth, X_Y_Z_Value) % Convert R'G'B' to Luminance % DCI-P3 gamut / D65 white point / PQ EOTF % Input: % bitDepth - e.g. 8/10/12 % R_G_B_Value - e.g. [4095,4095,4095] input = X_Y_Z_Value(:,2); L = PQ_EOTF(input, bitDepth);
function hfigs = openFigures(file) %OPENFIGURES Open multiple figures from a single .mat-file % OPENFIGURES, by itself, opens a multifigure .mat file saved by % SAVEFIGURES. A file selection dialog is opened specifying the file. % % OPENFIGURES(FILE) Opens figures in .mat-file FILE. FILE is a % multi-...
% This class is initialized in runGui.m. The constructor function creates a Log % object and initializes it; the run function creates a set of pseudo-global % objects, creates the GUI components, sets up the connections between the GUI % components and their functionality, and disables most interface capabilities % unt...
function folders = dir_folders(path, fullPaths) %DIR_FILES Returns the folders in a directory. % Usage: % paths = dir_folders % lists folder in pwd % paths = dir_folders(path) % paths = dir_folders(path, true) % returns full paths % % See also: dir_files, dir_paths, dir % Default path if nargin < 1; pa...
function [GF] = getGaussianFilter(N, M, sigma) Size = max(N,M); GF = fspecial('gaussian',[N,M],sigma); GF = sqrt(GF); GF = fftshift(GF); end
% % function: draw all beacon uncertainty ellipse % % date: 12.13, zhan load localmap_2938 %load EKF_SLAM_2008_Oct_29 St=localmap_st; num_beac=(size(St,1)-3)/2 P=localmap_P; figure(1) %axis ([-1 11, -6 6]) %axis square hold on for i = 1:(size(St,1)-3)/2 uncer_p = P(i*2+2:i*2+3, i*2+2...
% function [y x W] = warpfilter(ref, ts, kernel, varargin) % % produces smoothed and warped single-trial peth's in a window [-pre post] from each % element of the reference (ref) matrix. If there is only one column of % ref than no warping takes place. % all times are assumed to be in seconds % % % Inputs: % ref ...
function [myErr, matlab_simulation_variables] = MatlabStartSimulation(simulation_parameters) myErr.error_description = ''; myErr.severity_code = ''; % Reads in hourly biogas production values and the energy density from Excel sheet = 1; xlRange1 = 'A2:A8761'; xlRange2 = 'E11:E11'; matlab_simulation_variables.b...
function visualizevines(moves, vine, board) % VISUALIZEVINES Draws the board and the vine % % USAGE: % VISUALIZEVINES(MOVES,VINE,BOARD) % The MATLAB Contest Team % Copyright 2011 The MathWorks, Inc. imagesc(board) colormap(copper); colorbar axis off axis equal if ~isempty(vine) [r,c] =ind2sub(size(boar...
function data = load_data() DATASET_DIR = 'data\emailspam'; data.domain_names = {'U00', 'U01', 'U02', 'U03'}; for i = 1 : length(data.domain_names)-1 t = load(fullfile(DATASET_DIR, sprintf('data_%d.mat', i))); data.Xs{i} = t.features; data.ys{i} = t.labels; end t = load(fullfile(DATASET_DIR, sprintf(...
function [ammended_houghcircles] = removebadcircles(houghcircles,image) j=1; [m,n] = size(houghcircles); for i = 1:m row = houghcircles(i,:); x= row(1); y= row(2); RGB = impixel(image,x,y); if (RGB(1)>40) && (RGB(2)>25) && (RGB(3)>25) ammended_houghcircles(j,:) = houghcircles(i,:); ...
warning off; clc;clear; users = ["DM02";"DM03";"DM04";"DM05";"DM06";"DM07";"DM08";"DM09";"DM10";"DM12"]; xlData = ["User","DT_Accuracy","DT_Precision","DT_Recall","DT_F1","SVM_Accuracy","SVM_Precision","SVM_Recall","SVM_F1","NN_Accuracy","NN_Precision","NN_Recall","NN_F1"]; action = "Find"; for usr = 1:length(users) us...
#Ejercicio 1 function xdot = fder (tt,vv) Qe = 6 Qs = 8 xdot=Qe-Qs; endfunction x=lsode("fder",V0,t); #set term dumb; plot(t,x) xlabel("temps (min)") ylabel("Volum (l)") title("evolucion temporal del volumen") legend("vol") grid on
function [ X_i ] = conjugate_gradient( A, B, tol ); % Suppose \bar{A} is square and non-singular; % tol = tolerance level % B = A' * B; % A = A' * A; X_i = B; % B - A * X_0, with X_0 = 0 R_i = zeros(size(B)); P_i = zeros(size(B)); R_i = B - A * X_i; if norm(R_i) < tol return; end % Initialization P_i = R_i; ...
function activate_ap(speed, host, port) % ACTIVATE_AP(SPEED, HOST, PORT) % % Activate Autopilot in Flightgear over socket connection (HOST, % PORT) and set target speed = SPEED [mph]. % Run Flightgear on HOST (e.g. '127.0.0.1' = localhost) with % parameter "--props = PORT". import java.net.Socket import java...
% Good for CPMGFastAuto (from Anagi) clear clc close all % USER-DEFINED PARAMETERS filename = 'data.1d'; filedir = '/Users/tyler/Google Drive/Data/Anagi/DropboxData/174-18-2-23-CPMG fast/'; nMeas = 25; nPks = 3; pks = zeros(nPks,nMeas); locs = zeros(nPks,nMeas); alpha = 1e10; T2lims = [1e-4 1e0]; omitEchoes = 0; ...
% --------------------------- tests: %<<<1 %!shared infostr %!assert(isempty(infogetmatrix("#startmatrix::A\n#endmatrix::A",'A'))) %!assert(infogetmatrix("#startmatrix::A\n1\n#endmatrix::A",'A') == 1) %! infostr = sprintf('A:: 1\nsome note\nB([V?*.]):: !$^&*()[];::,.\n#startmatrix:: simple matrix \n1; 2 ; 3 \n4;5...
function [weights,bias]=RBFTrain(means,bandwidths,tdata,epochs,eta) dimy=size(tdata)(2); weights=zeros(length(means),1); bias=0; gauss=zeros(length(tdata),length(means)); for i=1:length(tdata) for c=1:length(means) gauss(i,c)=gaussian(means(c),tdata(i,1:dimy-1),bandwidths(c)); endfor endfor for e=1:epochs...
function [pass,maxerr] = test(opt) % Test a distance-domain fit of a wormchain model t = linspace(0,8,300); r = linspace(1,8,300); parIn = [4.5,0.5]; P = dd_gauss(r,parIn); K = dipolarkernel(t,r); S = K*P; par0 = [2 0.2]; [~,Pfit,cistruct] = fitparamodel(S,@dd_gauss,r,K,par0,'solver','lsqnonlin'); pa...
% This script is a toy example of (1) how a given pattern translate into % biases of apparent transition probabilities of different orders and (2) % how sequence likelihood changes with (a) the order of transition % probabilities that is considered and (b) the prior that is used (flat or % more or less biased). % % Co...
asfval = {5}; pgfval = {5}; mufval = {5}; astime = {5}; pgtime = {5}; mutime = {5}; for i = 1 : 5, filename = ['sORL50acc',num2str(i),'.mat']; load(filename,'GdASCG','GdPG','T_execution','V_fval'); asfval{i} = GdASCG.V_fval; astime{i} = GdASCG.T_execution; pgfval{i} = GdPG.V_fval; pgtime{i...
function [xrange, prob, pde, CDF] = f_ProbParameters(vector, xbins) % % % Inputs: a VECTOR with the values to distribute among a linear range % which goes from minimun value of this vector to the maximun valute of % this vector spaced into number of POINTS bins. % % % % % % Outputs are vectors: xrange, prob, pde CDF, ...
ncells = 10; % количество Ячеек N = 20; % количество шагов по времени L = 1/3; % влево S = 1/3; % на месте R = 1/3; % вправо c = zeros(ncells,1); % Массив значений концентрации cmax = 100; % Максимум концентрации c(ncells/2) = cmax; % Начальное значение концентрации x = 2:ncells-1; axis([1 ncells 0 cmax]),...
function [denoised, noise] = denoise(noisy_signal,prior,std_noise) % Given a noisy image and a similar prior image and the standard deviation of % the noise (assumes gaussian distribution) denoise the iamge by building a % steerable freq pyramid and using probabilistic algorithms to build a coring % function (h...
function y = measurement_MotorModel(x,varargin) %MEASUREMENT_MOTORMODEL % % Measurement equations for a motor with friction as a state % % y = measurement_MotorModel(x0,u,J,Ts) % % Inputs: % x - motor state with elements [angular velocity; friction] % u - motor torque input % J - motor inertia % Ts - ...
function out=cutSlice(RAW,win) cutOut=@(raw,idx) reshape(raw(idx),size(idx)); %% cut piece fields=fieldnames(RAW); for ff=1:numel(fields); field=fields{ff}; out.(field) = cutOut(RAW.(field),win.idx); end end
% ------------------------------------------------------------------------- % ************************* RDEVPop Package ******************************* % File: ODEFun2D.m % Author: Nick Henscheid % Date: 10-2019, 2-2020 % Info: Computes the ODE RHS for the Fisher-KPP equation, assuming % method-...
function k = prediction(inputx, weight1, weight2, bias1, bias2, targets) % Applying Feed Forward % Hidden Layer neth = inputx * weight1; neth = neth + bias1; %neth = normal(neth); outh = sigm(neth); % Output Layer neto = outh * weight2; neto = neto + bias2; %neto = norm...
#! /usr/bin/octave -qf # set gnuplot as default plotting object (historical reasons) graphics_toolkit("gnuplot") # set format for displaying - we like to see whole numbers #format long # input arguments: arg_list = argv(); # arg_list{1} - paht to mission info data file # arg_list{2} - paht to GPS data file # add fu...
% we are trying to analyse if the ships have any effect on the hums through analysing a single ship before and after hum. %use the program to call the function with parameters of the file name, center, width of the ship sound and it %gives the power of both the initial time and the time after ie left and right of the ...
function I = imShrink( I, ratios ) % Used to shrink a multidimensional array I by integer amount. % % ratios specifies block dimensions. For example, ratios=[2 3 4] shrinks a % 3 dimensional array I by a factor of 2 along the first dimension, 3 along % the secong and 4 along the third. ratios must be positive integers....
clc; clear; load('gesture_data'); % % figure(1) % plot_xyz_struct(LL_to_UR_) % % figure(2) % plot_xyz_struct(UL_to_LR) % % figure(3) % plot_xyz_struct(LR_lowerWave) % % figure(4) % plot_xyz_struct(LR_upperWave) % % figure(5) % plot_xyz_struct(wave_) % % figure(6) % plot_xyz_struct(come_) % % figure(7) % plot_xy...
function LoadLevel(levelno) global LevelStructure; LevelElements = {'crate_on_empty' 'crate_on_target' 'donald_on_empty' 'donald_on_target' 'empty' 'target' 'wall'}'; LevelCharacters = {'$' '*' '@' '+' '_' '.' '#'}'; LevelImages = {'crate_on_empty.jpg' 'crate_on_target.jpg' 'donald_on_empty.jpg' 'donald_on_ta...
function orbitalangledlg(selected, state, control, consts) %%orbital angle dialog % for the rocket around a selected body e.g. sun, moon, earth, mars % compute the orbital angle i.e. the angle between the orbital radius % vector and the velocity vector rootmsg='Orbital Angle:'; switch selected ...
function v = iPH() persistent vInitialized; if isempty(vInitialized) vInitialized = CoolProp_wrap(0, 72); end v = vInitialized; end
function [ ] = SampleRecord(filename,duration) %SampleRecord Summary of this function goes here % Ruben Bloom % 2-6-2014 % duration = 5; samplerate = 16000; r = audiorecorder(samplerate,16,1); input('Press enter when ready to record') record(r) input('Press enter to end recording') stop(r) % play(r) recording = ...
%% All the different initial positions and angles which give a period-6 orbit in the square and maximise the area % result in the same continuation! h = 1; gamma = pi/2; period = 6; init_alpha_1 = atan(2); bigmat_0p25 = parallelogram_newton_solver(h, gamma, init_alpha_1, 0.25, period); bigmat_0p75 = parall...
function n = vectorNorm3d(v) %VECTORNORM3D Norm of a 3D vector or of set of 3D vectors. % % N = vectorNorm3d(V); % Returns the norm of vector V. % % When V is a N-by-3 array, compute norm for each vector of the array. % Vectors are given as rows. Result is then a N-by-1 array. % % NOTE: Computes only...
function correlation( file,isTraining,obj ) xDoc = xmlread(file); rootNode = xDoc.getDocumentElement.getChildNodes; node = rootNode.getFirstChild; nbMetric = 0; while ~isempty(node) if strcmpi(node.getNodeName, 'metric') data = []; metricName = []; returnedMetric = node.getAttribute('retu...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % 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:...
clear all close all cd('E:\MATLAB\PANDA\Donders\Setups\supplementary'); fname = 'magFCheck-min30-2013-02-21.dat'; [e,c,l] = pa_readcsv(fname); sel = l(:,5)==1 & l(:,6)~=0 loc = l(sel,[6 7]); indx = find(ismember(loc(:,1),[3 9])); nSamples = c(1,6); nChan = size(c,1); pos = [95 90 40 30 20 10]; n =...
function model_train = save_trained_model(name, model_train) save(name, 'model_train') end
function dagA = fasOpt(A, exact) if nargin < 2 exact = 0; end %A = (A - A')/2; %A = A.*(A>=0); nvert = size(A,1); ind = (1:nvert)'*ones(1,nvert); tind = ind'; pos = [tind(:), ind(:)]; tA = A'; weights = tA(:); dz = weights ~= 0; weights = weights(d...
function [out2,out,im1,angle2,mid_pt,index] = chord_hand(bin,L,delta) %generate skin pixels % [blue_image,bin] = generate_skinmap(I) ; %cleaning up the image % se = strel('disk',6); % bin=imerode(bin,se); % bin=imfill(bin,'holes'); % se=strel('disk',1); % bin=imdilate(bin,se); % imshow(bin); % bou...
function data = read_OD(fullname) % READ_NIRS reads NIRS time signals from OxyMon excel data % format. % % NIRS = READ_NIRS(FILENAME) % % The output spike structure contains % NIRS.label = 1xNchans cell-array, with channel labels % NIRS.trial = 1xNchans cell-array, with channel labels % NIRS.wave...
clear clc load('E:\Machine Learning\Final Project\kit_latest\kit\train\train.mat'); load('E:\Machine Learning\Final Project\kit_latest\kit\test\test.mat'); result=Naive_Bayes_words(words_train,words_test,gender_train);
%% PARAMETRES GENERALS DONATS %Camara combustio h=43e6; %Condicions ambientals T0=249.15; %[K] P0=4.7320e+04; %[Pa] Rgas=287; gam.cold=1.4; CP.cold=1004; R.cold = CP.cold-CP.cold/gam.cold; gam.hot=1.4; CP.hot=1004; R.hot = CP.hot-CP.hot/gam.hot; gc = 1; %In engineering, gc is a unit conversion factor used to con...
function ya = tridiag( a, b, c, f ) % Solve the n x n tridiagonal system for y: % % [ a(1) c(1) ] [ y(1) ] [ f(1) ] % [ b(2) a(2) c(2) ] [ y(2) ] [ f(2) ] % [ b(3) a(3) c(3) ] [ ] [ ] % ...
function rootdir = atroot %ATROOT returns Accelerator Toolbox root directory w = which('DriftPass.c'); if ~isempty(w) d = fileparts(w); fileparts(w); ind = strfind(d,[filesep,'simulator', filesep, 'element'])-1; rootdir = d(1:ind); else error('Unable to find AT root directory - DriftPass.m not on M...
function result = MeanDN(PMMWimg) tempImg = PMMWimg; [M,N] = size(tempImg); AvgValue = zeros(1,M); for i = 1:M AvgValue(1,i) = mean(tempImg(i,:)); end result = AvgValue; end