text
stringlengths
8
6.12M
%% INIT %These files use simulation resuls stored in the "data" directory% %to update the simulation, run the simulation separately. (AFTER RUNNING% %THE COMMON FILE "PART5")% close all; clear; clc; psi_ref = 30; fig = 1; load('data/part_1_data.mat'); load('data/part_2_data.mat'); load('data/part3_data.mat...
function [PeakData, PeakNames,PeakPars] = feature_Peak(V, ttChannelValidity, Params) % MClust % [PeakData, PeakNames] = feature_Peak(V, ttChannelValidity) % Calculate peak feature max value for each channel % % INPUTS % V = TT tsd % ttChannelValidity = nCh x 1 of booleans % % OUTPUTS % Data - nSpikes x nCh pe...
%---------------Ergasia 1 - Extended Kalman Filter------------------------- clear; clc; % process noise covariance matrix q = 0.001; Q = [q, 0, 0, 0, 0, 0, 0; 0, q, 0, 0, 0, 0, 0; 0, 0, q, 0, 0, 0, 0; 0, 0, 0, 0, 0, 0, 0; 0, 0, 0, 0, 0, 0, 0; 0, 0, 0, 0, 0, 0, ...
% book : Signals and Systems Laboratory with MATLAB % authors : Alex Palamides & Anastasia Veloni % % % % problem 7 - Graph of % r(t)-r(t-1)+r(t-2)-2r(t-3)+r(t-5) t=-1:.001:10; x=t.*heaviside(t)-(t-1).*heaviside(t-1)+(t-2).*heaviside(t-2)-2*(t-3).*heaviside(t-3)+(t-5).*heaviside(t-5); plot(t,x); ...
function [mean_hsv] = getBaselineDescriptor(thisModel, vid, mask) n_f = 5; bins_hsv = [16 4 4]; parts = [0 0.5 1]; % compute bin centers min_max_hsv = [0 1; 0 1; 0 1]; centers_hsv = cell(1, 3); for i = 1 : 3, centers_hsv{i} = min_max_hsv(i, 1) + (min_max_hsv(i, 2)-min_max_hsv(i, 1))/bins_hsv(i)/2 : (min_m...
function y = erfaterms(x,iter) [xx,ii] = meshgrid(x,1:iter); y = 1 + sum(((-1).^ii) .* (ii*2-1) ./ ((2*xx.^2).^ii));
function [M,B,A]=ul2tank(w0) % [M,B,A]=ul2tank(w0) % % \dot{x}=M\sqrt{x}+Bu % tank_par a1=ao*sigmao*sqrt(2*g)/C; a2=al*sigmal*sqrt(2*g)/C; M=[-a1 a2; a1 -2*a2]; B=[0 1/C]'; if nargin>0, % A linear model (A: system matrix) [u0,x0]=offset(w0); A=M*diag(0.5./sqrt(x0)); end
% lx = Ilde(PL,PU,x) % % interval largest distance error of a realization x function lx = Ilde(PL,PU,x) [n,n] = size(PL); lx = 0; e = 0; for i=1:n for j=1:n if (PL(i,j)>0) Dij = norm(x(:,i)-x(:,j)); e = max(PL(i,j)-Dij,0) + max(Dij-PU(i,j),0); if e > lx lx = e; ...
%% clear all, close all, clc run('my_prefs') path0 = cd; %% load images options.WindowStyle='normal'; prompt={'How many images do you want to load:'}; def={'2'}; tmp = inputdlg(prompt, 'How many images do you want to load', 1, def, options); n_img = str2double(tmp(1)); filename = cell(n_img, 1); pathname = cell(n_img...
function imdb = TY_roidb_from_proposal(imdb, roidb, regions, varargin) % roidb = roidb_from_proposal(imdb, roidb, regions, varargin)s % -------------------------------------------------------- % Faster R-CNN % Copyright (c) 2015, Shaoqing Ren % Licensed under The MIT License [see LICENSE for details] % ----------------...
data; MW_EG = 62.07 / 1000.0; % (kg/mol) MW_DG = 106.12 / 1000.0; % (kg/mol) MW_PG = 76.10 / 1000.0; % (kg/mol) MW_2EH = 130.23 / 1000.0; % (kg/mol) options = optimoptions(@lsqcurvefit,'Display','iter-detailed',... 'FunctionTolerance',1e-6,... ...
function image_com = compensate( image, method ) %%%%%%%%%%%%%%%%%%% % 这个函数是用来对光照偏角太大的图片进行光照补偿的处理 % 传入的参数image是要进行处理的图片,method有两个值:vertical和horizontal % 其中vertical是对光源的左右变化进行处理,horizontal是对光源的仰角的变化进行处理 % 返回值image_com是处理好的图片 % image=imread('yaleB01_P00A+120E+00.png'); % image=imresize(image,[100,100]); load yale-b_...
% --- Executes during object creation, after setting all properties. function graph_input_CreateFcn(hObject, eventdata, handles) % hObject handle to graph_input (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called %...
% function [inst,t] = gtrack_step(handle, point, mNum, mIndex) function [t, targetDescr] = gtrack_step(point, mNum, targetDescr, targetIndex) global trackerProcObj; trackerProcObj.gtrackHandle.heartBeat = trackerProcObj.gtrackHandle.heartBeat + 1; if mNum > trackerProcObj.gtrackHandle.maxNu...
function [x_o,y_o,angle] = PoseCalculation (x,angle,v,theta) % Position of robot x_o = x(1)+ v(1); y_o = x(2)+ v(2); % orientation of robot angle = angle+theta; % new angle of robot
%% Tobit model - data o postu ziskanych medaily (souhrnny panel) clear close all clc % Pridani cesty k podpurnym funkcim v adresari Support % adresar pro vlastni funkce (pokud nejsou ve stejnem adresari jako skript) addpath('.\Support') % Nacteni data % structure array data_olympics, 1610 pozorovani %...
%% Test of fct_a init; test_mean_nrj = false; test_val_a = true; test_grad_sigma = true; % choice_a = 'spectrum_geo'; % choice_a = 'averaged_lyapunov'; % choice_a = 'kriging'; choice_a = 'var_w'; % type_data = 'klein' % type_w = 'klein' type_data = 'toy2'; type_w = 'toy8'; k_c = inf; % k_c = 1/3; alpha_adv_back=tru...
function CCT = computeCCT(taskFilename, masterLogFilename, slaveLogFilenames) [numTasks, totalNumFlows, numSlaves, slaveIDs] = ... getSimulationInfo(taskFilename) %; % --Master log entries: task number, coflowID % --Slave log entries: slaveID that generated this file (so every entry % will be the same, san...
% run beta_thal -0.5 to 2 (by 0.05) against SMA activation % beta_thal: THALAMUS saturation threshold clear; clc; beta_sma = 0.5*(ones(1,6)); beta_str = 0.4*(ones(1,6)); beta_thal = 0.5*(ones(1,6)); alpha_str = 5; alpha_thal = 6; beta_thal_var = -0.5:0.05:2; for cc = 1:length(beta_thal_var) beta_thal = beta_...
function result = f_compare_PT(tra_A,tra_B) % - compare two otolith profile transects % % USAGE: result = f_compare(tra_A,tra_B); % % tra_A, tra_B = otolith profile transect data created by f_cps2ppm_PT, % f_extract_PT, or f_interpolate_PT % % result = structure of results with the following fields: % ...
add_all_paths clear variables %% Generate the data for Figure 4.6a w_range=linspace(0, 200, 2*10^4); lam=0.7; d=2; N=34; Fbar_collector=cell(2, N); job_distributions=["Bounded Pareto", "Exponential"]; for i =1:length(job_distributions) job_distribution=job_distributions(i); if job_distribution == "Exponenti...
folder = fullfile('Put the link of folder containing samples'); ADS = audioDatastore(folder); sname='Sheet1'; startingColumn1='A'; nextRow=1; % i=1; filename = 'put name of file to write the extracted features'; while hasdata(ADS) x = read(ADS); % [x,fs]=audioread(x); fprintf('Fraction of files read: ...
function offsetchange6(handles,offsetaxis,up_down,Dv,isPA) % Custom callback function for HASgui that increments the offset of % the transducer up or down by Dx or Dy when pushbuttons are pushed. % % Changes: % 1/26/11 - Changed name to offsetchange5 and call to calcgeom5. % Added Dv and isPA ...
% This procedure find transition prob. for the different artificial forests % under actor-critic and logstic regression clear close all clc addpath('../utility/') fog = 6.6; load('../../data/processed/forest_experi_2.mat','environment') load('../../data/processed/state_action_prob.mat','tran_prob') m=environment.par...
function [ prev_peak ] = previous_peak_heuristic( current_peak, prev_peaks, prev_rl, prev_ru) % [ prev_peak ] = previous_peak_heuristic( current_peak, prev_peaks, prev_rl, prev_ru) % Find the previous peak that relates to the current one % Current peak is scalar % prev_peaks is vector % prev_rl is vector (region ...
function ove_test_1 %{ file_name = 'E:\HTP\FeNiCr\xrd2-Fe-Co-Ni-reduce20170815\FeNiCr-00098-00000_rm.chi' txt = importdata(file_name); tmp = txt.data; tmp = tmp(2:end); ele_num = numel(tmp); tmp = reshape(tmp,2,numel(tmp)/2); %} w_b = imread('G:\WorkSpaceOfGit\xrdParser\matlab_src\test\w_b.png'); b = imread('G:\WorkSp...
clc;clear all;close all; clc;clear; close all; %load Features_MNIST_SFN; load LetterData.mat; X = [B(1:500,:);R(1:250,:);H(1:250,:)]; %Letter %load('CancerData.mat') %load WINE_QUALITY.mat % X=[B(1:100,:);M(1:100,:)]; %CancerData % %X=[RED(1:500,1:end-1);WHITE(1:500,1:end-1)]; %WineData MIN=min(X);MAX=m...
% How to use cellLocations and faceLocations functions to define cell and % face values, variable in space % Written by Ali A. Eftekhari % Last checked: June 2021 % Cell Variable: m=createMesh2D(30, 20, 5.0, 3.0); [X, Y, Z]=cellLocations(m); c=createCellVariable(m, sin(X.value).*cos(Y.value)); figure(1); visualizeCell...
% run alpha_str 0 to 10 (by 0.1) against SMA activation % alpha_str: STRIATUM saturation slope clear; clc; beta_sma = 0.5*(ones(1,6)); %default is 0.5 beta_str = 0.4*(ones(1,6)); %default is 0.4 beta_thal = 0.5*(ones(1,6)); %default is 0.5 alpha_str = 5; %default is 5 alpha_thal = 6; %default is 6 alpha_str_v...
function reducedColorImage = OPTIONAL1_reduce_width(im,cumulativeEnergyMap,xleft,yindex) reducedColorImage=zeros(size(im,1),size(im,2)-1,3); verticalSeam = OPTIONAL1_find_optimal_vertical_seam(cumulativeEnergyMap,xleft,yindex); for a=1 : size(im,1) for b=1 : verticalSeam(a)-1 reducedCo...
function beta = calculateBeta(R, pp, xj, n, m, X) belief = zeros(1, length(xj)); beta = zeros(m, n); for j = 1:m for i = 1:n for k = 1:length(xj) belief(k) = calculateBelief(X(j, xj(k)+1), pp{k}(R(k, i), :)); end beta(j, i...
function Flow = pa_dtfanalysis(fname) % PA_DTFANALYSIS(FNAME) % % Analyze the acoustic recordings, and produce the directional transfer % funtion. % % See also PA_READHRTF, PA_SWEEP2MAG, PA_READCSV if nargin<1 close all clear all % fname = 'SB-PB-2008-02-20-0004.hrtf'; % fname = 'MW-BG-2010-05-06-0...
function [ kernelReal, kernelImag ] = gaborAnnulusKernel( size, lambda, sigma, radius ) %GABORANNULUSKERNEL Generates two annulus kernels - real and imag % size - kernel size % lambda - wavelength (ie. selected f0 from paper = 1/lambda) % sigma - gaussian deviation (around radius) % radius - donut r...
clc; clear all; format compact; k = 50; % rank of SVD approximation image = 4; % choose a number 1 to 4 identifying a file name names = ["dice","cat","piano","street"]; A = imread(names(image)+".jpg"); % A = imread('dice.jpg'); % Display the Orginal Image A = rgb2gray(A); figure(1) imshow(A) title(sprintf('Original ...
clear all clc n = input('Enter a number to test if it is prime'); f = divisors(n); j=length(f); if (j>2) disp('Its not prime') else disp('its prime') end
tic; %% Original Image img = load("../data/image_low_frequency_noise.mat").Z; figure, imagesc(img), colormap('gray'), daspect([1 1 1]), title('Original image'), axis tight; %% Zero padding dim = length(img); pad_img=cat(2,zeros([dim,dim/2]),img, zeros([dim,dim/2])); pad_img=cat(1,zeros([dim/2,2*dim]),pad_img,zeros([d...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % DIGITAL CODES LIST (0-255) % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % General instructions for codes % 0-255: standard trial codes % 256-511: ascii text % 1000-32000: custom user code range - use these for...
function [kTraj,MaxRadius] = tyTraj(gHzpercm,dt) % g in Hz/cm kTraj = zeros(size(gHzpercm)); kTraj(1,:) = gHzpercm(1,:); for ii = 2:size(gHzpercm,1) kTraj(ii,1) = kTraj(ii-1,1) + gHzpercm(ii,1); kTraj(ii,2) = kTraj(ii-1,2) + gHzpercm(ii,2); end kTraj = kTraj*dt; % to convert to 1/cm; kRadius = hypot(kTraj(:,1...
function s_cut = cut (s, n, overlap, padlast) % TODO Doesn't work when length (s) = n !!! if (nargin < 4) padlast = 0; end if (nargin < 3) overlap = 0; end if (overlap >= n) s_cut = []; return; end % make s a column s = s (:); N = length (s); if N <= n s_cut = s; return; end chunk = floor ((N - ...
% This script demonstrates the use of (two different algorithms of) ICA % for isolating maternal from foetal cardiac signal % First the Jade's algorithm is invoked % and then the FASTICA toolbox is utilized (from command line mode) % Note: you should add to the path the foetal_ecg_ica_example clear all, clos...
function ObjBW_smooth=as_smoothcontour(ObjBW) [ObjBoundary,~] = bwboundaries(ObjBW,'noholes'); ObjBoundary = ObjBoundary{1}'; ObjBoundary(:, end) = []; repeatFactor = 3; ObjBoundaryRepeat = []; for i=1:repeatFactor ObjBoundaryRepeat = [ObjBoundaryRepeat ObjBoundary]; end t...
function id=getPatternId(pattern,TxOrRx) if(strcmp(pattern,'AP8')) if(strcmp(TxOrRx,'Tx')) id=76; else id=33; end elseif(strcmp(pattern,'REC-465-5')) if(strcmp(TxOrRx,'Tx')) id=602; else id=601; end ...
% Script modelling ERP clear; close all; clc; nip_init(); %%%%%%%%%%%%%%%%%%%%%%%%%%% % Preproceso / simulacion % %%%%%%%%%%%%%%%%%%%%%%%%%%% % Numero de dipolos a considerar Nd = 4000; % 1000, 2000, 4000, 8000 % Cargar datos(lead field, mesh del cerebro etc... load(strcat('data/montreal',num2str(Nd),'_full3shell.ma...
function [ signal_concat ] = concat( signal, nb_spl_in, nb_spl_out ) if( nb_spl_out > nb_spl_in) disp('error in input arguments'); else signal_concat = zeros(nb_spl_out, 1); for i = (nb_spl_in - nb_spl_out):(nb_spl_in - 1) signal_concat(i - (nb_spl_in - n...
function mmapAPIGeneralCall % wait to get data: sbx is slow pause(5); % loading fake data global pixelTc imagingDetail exptDetail if isempty(pixelTc) getPixelTcFromSbx end % ================== % any preprocessing to be done on inputs should be done here. % need to check...
function [result, acc_matrix, train_acc_matrix] = optimize_hyperparameters(model, X, Y, parameter_ranges, numOfFolds, varargin) % Optimizes a set of hyperparameters for a given model 'model' % % Parameter_ranges must be a struct of parameter names and the set over % which to optimize. For example: % parameter_ranges.C...
function analysis = erroranalyis() res = csvread( 'res_save_fin.csv'); Opt = res(:, 1); R = res(:, 2); M = res(:,3); measure = res(:, 4); rf = res(:, 5); xgb = res(:, 6); cubist = res(:,7); for i=5:7 mean_abs_error = mean( abs( res(:,i) - measure)./measure) max_abs_error = max( abs(res(:,i) - measure)./meas...
function int_value = Gauss_vol_int_trial_test(coe_fun,Gauss_weight,Gauss_point,vertices,basis_type_trial,basis_index_trial,der_trial,... basis_type_test,basis_index_test,der_test,t) int_value = 0; Gpn = size(Gauss_point,2); %...
% % cal_wgts.m % NOTE1: every ray has a unique wgt % NOTE2: the sum of the wgts is 1. % % Input parameter: % % Output parameter: % weights_result % % function weights_result = cal_wgts() % function weights_result = cal_wgts() % % read the Num_Lgts and str_in from 'input.txt' % %fid = fopen('input2', 'r'); Num...
function area = physicalBorderArea2(borders, edges, seg, scale, isPadded) % PHYSICALBORDERAREA2 % Calculate the physical border area using the algorithm % from Moritz Retina paper. % % INPUTS borders: Structure array with PixelIdxList field or cell % array of linear voxe...
function px_dcm_checkcopy2(ip,op,protocol,Nruns,Nfiles,vector) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % px_checkcopy(ip,op,protocol,Nruns,Nfiles,vector) % % ip = 'I:\DataAnalysis\Runing\AnxietyModel\fMRI\DataSortTask'; % op = 'I:\DataAnalysis\Runing\AnxietyModel\fMRI\DataReady'; % protocol = {'A...
function [t, v] = HW1Q3(delt) %HW1Q3 %% Initialize Variables and Parameters g = 9.81; %gravity (m/s^2) cd = 0.25; %drag coefficient (kg/m) m = 68.1; %bungee-jumper mass (kg) t = (0:delt:12)'; %time vector, 0 to 12 seconds, interval of delt v = nan(size(t)); %initialize velocity variable as NaNs, same size as t...
function [Sholl STE] = mot_sholl (drawings, labels, opts) %A DYNAMO ANALYSIS FUNCTION %All Dynamo analysis functions take two arguments: % drawing: a Dynamo saved structure containing the fields 'states' and 'traits' % labels: a structure containing the annotation key used in drawing % opts: con...
function [cmbVal, Contrast, Distribution] = SaliencyFilter(colDistM, posDistM, meanPos) % The core function for Saliency Filter: % F. Perazzi, P. Krahenbuhl, Y. Pritch, and A. Hornung. Saliency filters: % Contrast based filtering for salient region detection. In CVPR, 2012. % % Note that we didn't implement the l...
function folder = fgmRoot() % fgmRoot - Folder containing the GUI MatlabFigureManager % % folder = layoutRoot(); % % The function returns the full path to the folder containing the % GUI MatlabFigureManager. % (c) 2018-2019 MIT License % Created by Stephane Roussel & Olivier Lev...
%just parses all trackmate results into a shared data structure saved in a %mat file and used later on location='D:\core\aditistuff\correctwindowed30_15_withnorm\bksub_manual\'; location='D:\core\aditistuff\FullDataSetFixTest\cropped_aligned\sub\'% %location='D:\core\aditistuff\correctwindowed30_15_withnorm_med...
%=========================================================================% % OMCal.m Module of MOVESTAR % % % % Script for calculating the operating mode of a vehicle. % % ...
function [ reverseStr ] = printToCmd( reverseStr,message ) message = strrep(message,'%','%%'); message = strrep(message,'\','\\'); fprintf([reverseStr, message]); %find extra chars %nof_extra = length(strfind(message,'%%')); %nof_extra = nof_extra + length(strfind(message,'\\')); %nof_...
clear close all clc load('data.mat') if 0 % fake parameters para1 = [0,-2]; papa2 = [0,-2]; end addpath('..\matlab\Scripts_m\fun_MHSampling\') addpath('..\matlab\Scripts_m\ex_PMCMC\') %% note % the problem is not identifiable % because the prior and the likelihood are both semetric % All the codes seems to be ...
%Comunicações Digitais - Simulação 1 % % % %Alunos: % % % %Gera a sequência de 100000 + 2 bits aleatórios: bits = randi([0, 1], 1,1E5 + 2); Es = 1; % energia do círculo interior Es2 = (1 + sqrt(3))^2*Es/2; % energia círculo exterior M = 4; % quantidade de sím...
%test_WKS % % % Copyright (c) 2013 Junjie Cao clc;clear all;close all; addpath(genpath('../../')); %% Load mesh M.filename = 'wolf0.off'; [M.verts,M.faces] = read_mesh(M.filename); M.nverts = size(M.verts,1); %% Laplacian eigen nbasis = 100; withAreaNormalization = true; adjustL = false; [M.eigvector,...
function [statExist] = checkFeatStats(boldDir,featName) % Checks for the existence of a 'zstat1.nii.gz' file in the stats % directory, to serve as confirmation feat ran correctly % % Usage: % [statExist] = checkFeatStats(boldDir,featName); % % Output: % statExist = 1 if exist, 0 if not % % Written by Andrew ...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Copyright 2012 Analog Devices, Inc. % % Licensed under the Apache License, Version 2.0 (the "License"); % you may not use this file except in compliance with the License. % You may obtain a copy of the License at % % http:/...
function varargout = rescal2(varargin) % RESCAL2 M-file for rescal2.fig % RESCAL2, by itself, creates a new RESCAL2 or raises the existing % singleton*. % % H = RESCAL2 returns the handle to a new RESCAL2 or the handle to % the existing singleton*. % % RESCAL2('CALLBACK',hObject,eventDa...
function np_cal % This program is for the arithmetic searching % and the calculation task clear all; % set course -------------------------------- fixTable = 1; setTrials = 1; %--------------------------------------------- if fixTable == 1 % this section is the base % variable help----------------------...
%@(#) bucatch.m 1.4 03/10/09 08:41:27 % %function j=bucatch(buid,BUIDNT) % function j=bucatch(buid,BUIDNT) [iB,jB]=size(BUIDNT); [iB1,jB1]=size(buid); if jB~=jB1, error('Length of both strings must be the same'); end jj=((jB*2-2):-2:0)'; jj=10.^jj; x=abs(BUIDNT)*jj; x1=abs(buid)*jj; j=find(x==x1);
function [o1,o2] = plnr( i1, i2 ) % plnr compose/decompose planar-vector coordinate transform. % X=plnr(theta,r) and [theta,r]=plnr(X) compose a planar-vector coordinate % transform X from its component parts theta and r, and decompose it into % those parts, respectively. theta is a scalar and r is a 2D vector. r...
% This script tests the functionality of the TriangleDisparity class using % real images taken using a color-coded aperture camera % Author: Timothy Setterfield (Timothy.P.Setterfield@jpl.nasa.gov) % Read the original image file imFileName = '../data/blocks-glass50-09.26.2018/Dalsa-18.jpg'; % imFileName = '../da...
function data_out = AMPX_remap_sites(data, ExpKeys) %% AMPX_map: rempas the data channels to match the probe layout specified % in the Expkeys. % % Inputs: % - data: [struct] format (AMPX, FT, TSD) will be autodetected % - ExpKeys: [struct] contains the mapping % % Outputs: % - data_out: [struct] in the same fo...
function diff = find_emitter_eField(rho0, Ecrit, p,e,t, geometry, constants, plot_debug) %solve the problem using the guessed rho0 results = get_results_using_rho(rho0, p,e,t, geometry, constants, plot_debug); diff = results.Ee - Ecrit; disp('diff') disp(diff) disp(' ')
% University of Isfahan, Isfahan, Iran % Computer engineering faculty % Author: Seyyed Naser Seyyed Hashemi % n.s.hashemi@eng.ui.ac.ir % naser_seyed_hashemi@yahoo.com % % The network topology was implemented in the code below. % each node structure: % { % ...
%% Linear wire example % Created by: Lee A. Harrison % On: 8/5/2018 % % Copyright (C) 2019 Artech House (artech@artechhouse.com) % This file is part of Introduction to Radar Using Python and MATLAB % and can not be copied and/or distributed without the express permission of Artech House. clear, clc % The operating fr...
%| Itinerary estimation using Automated Fare Collection and train operation timetable data for metro passengers. %| Published by ³ÂÐÀ (Xin Chen) from (Southwest Jiaotong University School of transportation and logistics) %| and (Transport Division of Technical University of Denmark). %| This code is a pa...
function cluster_ISODATA_consolidation(img) % disp('consolidation'); global theC z w Nc L; D = zeros(Nc, Nc); IX = []; for i = 1:Nc-1 for j = (i+1):Nc D(i,j) = norm(double(z(i,:)-z(j,:))); % disp(['D(' num2str(i) ',' num2str(j) ')= ' num2str(D(i,j))]); if D(i,j) < theC te...
% The robot will drop down to the ground and keep balance function dropAndBalance(ini_cond) global yout tout t_end impFuncs = impactMapping; dySys = dynaSys; % Setting up the initial conditions tout = 0; yout = ini_cond.'; % Robot falling down ode_opt = odeset('Events', @eventRearTouchG...
function [edge_mag, edge_dir] = pyramid_ed_cvip( input_image ) % PYRAMID_ED_CVIP - perform a pyramid edge detection. % % Syntax : % ------ % [edge_mag, edge_dir] = pyramid_ed_cvip( input_image ) % % Input Parameter include: % ----------------------- % 'input_image' Input image can be gray image or rgb i...
%Minjun Park, CAAM 210, 11/23/15 % %Description: shows how each gene interact with each other with given %probabilities. %Structure: pbndriver, ruletree, genestm, d2b, b2d % %USAGE: assign wires, rules, probability. % function pbndriver wire = [4 2 4;5 3 2;3 6 1;5 4 6;6 1 2;3 5 6]; %represents genes rule = {[231 230]...
function [varargout] = NV_Finder(im,NVsize) sensitivity = 2; %number of STD's above the noise scaley = (size(im.image,1)-1)/diff(im.ROI(2,:)); scalex = (size(im.image,2)-1)/diff(im.ROI(1,:)); NVsize = scaley*NVsize; lp = NVsize/2*0.5; % Wants sigma (NVsize was originaly a diameter) hp = NVsize/2*1.5; % Assume im is th...
function Estimator = Estimator_LPF(agent) %% estimator class demo % estimator property をEstimator classのインスタンス配列として定義 qnum=agent.model.state.num_list(contains(agent.model.state.list,["q"])); Eparam = struct('LPF_T',0.05,'list',["p","q"],'num_list',[3 qnum]); Estimator.type = "LPF"; Estimator.name = "lpf"; Estima...
function [u_hat,fval,exitflag,output] = CPG6_optimize(u_hat) % OPTIMIZE PARAMETERS OF THE OSCILLATOR TO FIT THOSE OF HALBERTSMA 1983 % [u_hat,fval,exitflag,output] = CPG6_optimize % % INPUT % Run in report mode when input parameters are present % u_hat - osc. parameters to display % OUTPUT % u_hat - weights of the o...
%ELIIPSOID Plots the upper half of a parametric ellipsoid of rotation % Figure 13.10.For explanations see Subsection 13.26 in the book. % define axes a = 5; b = 3; c = 2; % plot the boundary of the patch and define frame w = 0: 0.01: 1; x = a*cos(2*pi*w); y = b*sin(2*pi*w); z = zeros(size(x)); plot3(x, ...
function vary_Error_Tolerances_To_Compare() % Plot number of iterations versus error tolerance for both the golden % search and successive parabolic interpolation algorithms, for % several different tolerances over many orders of magnitude. % % This script calls the scripts "golden_Search" and ...
classdef ControlChartChangeDetector < modular.cd.AbstractChangeDetector %CONTROLCHARTCHANGEDETECTOR Summary of this class goes here % Detailed explanation goes here properties deviations = 2; end methods function obj = ControlChartChangeDetector(window_...
classdef (Abstract) SA < MLSimulator.Modules.Module %SA 可饱和吸收体类 properties end methods end end
function MI = mutualinformation(J,K) %takes two images of equal size and pixel value ranges and returns the %joint histogram, joint entropy, and mutual information. No error checking %used, as this function is built for speed. For additional speed, %instructions on how to remove what you do not need are in the comments...
% function rsi = getrsi(mopen,mclose,period) function rsi = getrsi(mopen,mclose,period) rsi = zeros(size(mopen)); for i=period+1:length(mopen) meangain = 0; meanloss = 0; for j=i-period:i pricediff = mclose(j)-mopen(j); if pricediff>0 meangain = meangain + pr...
function param = GNN(obj,param) % Determining observations within the validation region %【Input】 obj : object of EKF % param : Structure of EKF %【Output】param : Structure of EKF % Feature point prediction of estimated object param.Mhatbar = cell2mat(arrayfun...
load('data.mat'); p = precision(predicted, gt) disp("Correct answer: " + 0.8860);
load q2_data %display(q2x_train); alpha = 0.0005; n = length(q2x_train); phi = [ones(n, 1), q2x_train]; w = [0.327059967177088,-0.944377806404219;1.08263350423676,-1.32178852139256;1.00607711081905,0.924825933493706;-0.650907736597753,4.98490752508133e-05;0.257056157433969,-0.0549189146094067]; classification = zeros(...
// // Moon.m // MoonHerder // // Created by Roger Engelbert on 10/9/12. // Copyright Done With Computers 2012. All rights reserved. // #import "Moon.h" // Moon implementation @implementation Moon @synthesize blinking = _blinking, off = _off; - (void) dealloc { [super dealloc]; } -(id) initWithGame:(Game *) ...
% ============================================ % Author: Alex Chen % email: alextpf@gmail.com % 2014 % ============================================ clear all; close all; clc; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Program parameters %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HAND_DRAW = false; % true: ha...
function out = deloutlier(in,param) % 删除数据的离群点 % in: 单列数据 % param: 删除几倍sigma外的数据 % out while 1 rowrow = find(abs(in-mean(in))>std(in)*param); if ~isempty(rowrow) in(rowrow,:)=[]; else out = in; break; end end
function XtY = randTransMat(nx,ny) % random transition matrix X to Y, size [nx,ny] XtY = rand(nx,ny); pX = sum(XtY,2); XtY = XtY./pX(:,ones(1,ny));
% logftS.m 7/01 file to run logft calculation % EX with defaults: % [cqtrans, tt, freqs, kerncos, kernsin] = logftS(vsc11); % % EX inputting all values (same as defaults here) % [cqtrans, tt, freqs, kerncos, kernsin] = ... % logftS(vsc11, 'SR', 11025, 'minfreq', 174.6141,'freqrat', 1.0293, 'maxfreq...
function [P,obj,err,iter,Q] = SSGLPCA(L,D,lambda,k,opts)% lambda is alpha % tol = 1e-4; max_iter = 500; rho = 1.05; mu = 1e-4; max_mu = 1e10; DEBUG = 0; if ~exist('opts', 'var') opts = []; end if isfield(opts, 'tol'); tol = opts.tol; end if isfield(opts, 'max_iter'); max_iter = opt...
function [pass,maxerr] = test(opt) % Check error control of dipolarsignal() towards wrong inputs N = 100; t = linspace(0,3,N); r = time2dist(t); P = dd_gauss(r,[4,0.4]); % Pass 1: not enough input arguments try V = dipolarsignal(t); pass(1) = false; catch pass(1) = true; end % Pass 2: negative modulatio...
function [ TrialInfo, SubjectParams ] = GetVitals( vicon, FD, S ) % Gets a bunch of little things that could be important and organizes them % into a structure. % If you are adding to this structure, ensure that is full of things that % each subject will have. % Set all values to NaN or 0 in case something goes ...
function [best str] = courseCritique(fn, threshold) [num text raw] = xlsread(fn); psc = find(num>=threshold); if ~isempty(psc) pass = num(psc); [topgpa ndx] = max(num); rawtop = text{ndx+1}; best = sprintf('Professor: %s', rawtop); for i = 1:length(psc) ...
%----------------------------------------------------------------------- % This is the code for the following paper: % % Q. He, W. Zhang, P. Lu and J. Liu % Performance comparison of representative model-based fault % reconstruction algorithms for aircraft sensor fault detection % and diagnosis. % %...
fs = 40000; t = -10:1/fs:10; p = (1/(1 *sqrt(2*pi)))*exp(-t.^2/2); stem(t,p)