text
stringlengths
8
6.12M
function [outputArg1,outputArg2] = sea_corr(data,data_sea_surface,data_under,segment,num_seg,start_id,end_id) %UNTITLED 此处显示有关此函数的摘要 % 该文件夹的主函数 % data为整幅影像数据,也可以为片段数据,但是最好是整幅影像数据 % 此处显示详细说明 end
%生成gif fps = 40; %帧数 flage = true;x = -8:0.01:8; fi = [0:0.1:4, 4:-0.1:-4, -4:0.1:4]; figure for i = 1:length(fi) y = f(x,1,0); axes1 = axes('Parent',gcf); axis([-8,8,0,0.8]); hold(axes1,'on'); set(axes1,'YAxisLocation','origin'); plot(x,y,'LineWidth',2) y = f(x,1,fi(i)); plot(x,y,'Line...
function [ partial_deviation_norm ] = getPartialDeviations(f0, fk, beta) %% compute deviation of estimated partials with theoretical partials % f0: numBlocks * 1 % fk: numberOfPartials * numBlocks % beta: numBlocks * 1 % partial_deviation_norm: numberOfPartials * numBlocks k = (1:size(fk,1))'; zero_indices = find(~f0);...
function [rePh, Kr] = RetardPhaseBode1(FTBO, erpd, wgd, marge) % Retourne le compensateur retard de phase pour la fonction de transfert % FTBO % param: FTBO - la fonction de transfert à compenser % param: erpd - l'erreur désirée % param: wgd - la fréquence de traverse en gain désiré % param: marge - la marge ...
function [ u,v,w ] = getAvgVel( nx,ny,nz2,cores,str,zmin_buf,zmax_buf) %UNTITLED3 Summary of this function goes here % Detailed explanation goes here for i=1:cores % Access the different files name = str(i).name; fid=fopen(strcat('./output/',name),'r'); % Determine the core number of the ...
function plot_codebook_votes(votes, c) scatter3(votes(:,1), votes(:,2), votes(:,3), 20, c, 'filled'); end
function [data,param]=smoothBoundary(data,center,order) numpoints=size(data,1); data=bsxfun(@minus,data,center); theta=atan2(data(:,2),data(:,1)); radius=bsxfun(@hypot,data(:,1),data(:,2)); basis=ones(numpoints,1+2*order); column=1; for m=1:order q=m*theta; column=column+1; basis(:,column)=cos(q); co...
function output = RLEncode( x ) % RLEncode run-length encoding % % OUTPUT = RLEncode( INPUT ) % produces a run-length encoded version of the 1xN vector INPUT. OUTPUT % is a Nx2 array, where the first column are the values of each run and % the second column are the lengths of each run. % Copyright 2007-20...
%% script to read all labelled data csv file in a specified folder and convert to commom format in a new folder %% define some parameters clear root_fd = 'C:\Data\DLC_datasets'; labeled_data_fd = 'C:\Data\DLC_datasets\ReachPlus'; new_labeled_data_fd = 'C:\Data\DLC_datasets\ReachPlus_NEW'; scorer = 'AS'; % to keep ...
function plot_weights(weights, name, color) % Make stem plot of the regression coefficients. Specify the name of the % model and an associated color zw = weights == 0; nw = 1:1:length(weights); h = stem(nw(~zw), weights(~zw), 'filled', 'Color', color); hold on if ~isempty(nw(zw)) h(2) = stem(nw(zw), weights(zw), ...
clc; clear; cd('\\data.triton.aalto.fi\scratch\nbe\socialneurocognition\summer_data\subjects_pre_results_2') addpath('\\home.org.aalto.fi\zhangj14\data\Documents\matlab_first\packages') subjects = [56:58]; %% for subj = subjects load(strcat('zeropadded-', num2str(subj), '.mat')); len_pre = ...
function [] = Q_7_8(K) j=1; X=zeros(1,20); A=zeros(1,20); B=zeros(1,20); C=zeros(1,20); for n=5:5:100 X(j)=n; for i=1:K, %A [~,time]=RGP(n,@isT1); A(j) = time + A(j); %B [~,time]=RGP(n,@i...
function [out]=shift(in,shiftr) %完成m序列的循环移位 l=length(in); out=in; shiftr=rem(shiftr,l); %取移动位数关于码长的余数 out(:,1:shiftr)=in(:,l-shiftr+1:l); %输出的最后shiftr位移到前shiftr位上 out(:,1+shiftr:l)=in(:,1:l-shiftr); %其余位数依次移位 end
function handles = ChangeLegStatus(handles,Leg,Neighbor) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % function handles = ChangeLegStatus(handles,Leg,Neighbor) % % Change leg status following Footprint status toggle button actions by the % user. OR if Neighbor ~= 0, change current l...
function [T,I,Y]=perfusionResponsepotent2P2X4indep(y0,ton,toff,Ttot) ode=modelODEpotent2P2X4indep(ton,toff); [T,Y]=ode15s(ode,[0 Ttot],y0,odeset('NonNegative',1:21)); I=getTotalCurrentpotent2P2X4indep(Y); end
function waitForJob(job, interval) % waitForJob(job, interval) % Waits for one or multiple jobs and displays progress data in a % regular interval (60 seconds by default). % % Written by % Manuel Berning <manuel.berning@brain.mpg.de> % Alessandro Motta <alessandro.motta@brain.mpg.de>...
%=========================================================================% % PlotResults.m Plotting Function of MOVESTAR % % % % Script for plotting results of fuel consumption and pollutant emissions% % ...
clearvars j1 j2 j3 b1 b2 b3; fstatus = memmapfile('status.txt', 'Writable', true, 'Format', 'int8'); fstatus.Data(1) = 48; j1 = memmapfile('junction1.txt', 'Writable', true); j2 = memmapfile('junction2.txt', 'Writable', true); j3 = memmapfile('junction2.txt', 'Writable', true); b1 = memmapfile('buffer1.txt', 'W...
function [output] = fn_least_squares(x_in, y_in, order, output_mode) % Author: Alex Wong (almw994@uowmail.edu.au) % fn_least_squares v1.0 25-07-2019 % % fn_least_squares calculates the Nth-degree least square polynomial % of an x-y data series for best-fitting % syntax: % fn_least_squ...
% MIT License % % Copyright (c) 2017 Jose Bravo Ferreira % % Permission is hereby granted, free of charge, to any person obtaining a copy % of this software and associated documentation files (the "Software"), to deal % in the Software without restriction, including without limitation the rights % to use, copy, ...
%{ When writing your code please use this class to simulate the behavior of the robot. Below is an example of how the botSim class should be used. %} clf; %clears figures clc; %clears console clear; %clears workspace hold on; axis equal; %keeps the x and y scale the same map=[0,0;60,0;60,45;...
% Each row needs to be one of the curves with same number of pieces across % all curves function [nvbar,avg,totdist] = karchermeanpieces(X) numCurves = size(X,1); numPieces = size(X,2); N = 100; M = 300; maxIter = 200; eps = 0.05; nvbar(1)= 1; k = 2; totdist = 0; n = size(...
function uyy = fd2d_d2udy2(f,dx) uyy = (f(2:end-1,3:end)-2*f(2:end-1,2:end-1)+f(2:end-1,1:end-2))/(dx^2);
function txsig = signal_compensation(rxSig,freq,mphase,len); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% txsig=rxSig.*exp(-1*j*(2*pi*freq*[0:len-1]+mphase)); end
function [rho_fg]=rho_fg_HEOM (V_ex_fg,N,tot_vib,H_trunc,HL,rho_eg,... sup_op_ge,t2_range,om2_rng,om_scale,simp_mix,tol ) t1L = size(rho_eg,4); %length first signal in time / freq space if isempty(om2_rng) t2L = length(t2_range); %length to prop in t2 else t2L = le...
function qamar_learning_monkeyL_psychophysics_eta(int_indx) rng(int_indx); [GAMMAE,ETA0] = meshgrid(logspace(-5,0,10),logspace(-5,0,20)); GAMMAE = GAMMAE(:); ETA0 = ETA0(:); % network parameters nhu = 200; L = 3; nneuron = 50; nnode = [nneuron nhu 1]; ftype = 'relu'; objective...
%% READ IN DATA AND SAVE AS MAT % pconn_preproc_read_data clear all restoredefaultpath % ------------------------------------------------------------------------- % VERSION 4 - TASK % ------------------------------------------------------------------------- denoise = 'no'; v = 1; pad = 1200/2; % 500 m...
%% subsref % cellNetwork class subsref method %% %% Syntax % val = subsref(N,indices) % %% Description % Return the property of a cellNetowrk object. % %% Inputs % * N - a cellNetwork object % * indices % %% Outputs % * val - the value of the corresponding property % %% Examples % >> N.vertices % >> N(2).v(4) % ...
close all;clear all; run matconvnet/matlab/vl_setupnn; addpath('utils') %%Set parameter scale = 3; backbone_name = ['lcsc76_x', num2str(scale), '_backbone.mat']; load(backbone_name); backbone_model = lcsc; fusion_name = ['lcsc76_x', num2str(scale), '_fusion.mat']; load(fusion_name); fusion_model = attention...
function [y] = Fun_ExpEuler(y_0, A, tau) y = y_0 + tau * A * y_0;
classdef RarmaSolvers % Class implementing many of the optimizers required for % regularized ARMA properties(Constant) SUCCESS = 0; ERROR_MAXITER = 10; ERROR_BACKTRACK = 20; ERROR_BACKTRACK_MAXITER = 21; end methods(Static) function stepsize = line_sear...
function ReturnWavelength=MatchWavelength(x,y,centerWavelength,grating) order=grating/150; y=y/max(y); PeaksFile = fullfile('HgNe Lamp Data','Peak Pixels and Wavelengths.csv'); DataFile=fullfile('HgNe Lamp Data','Visible HgNe Wavelengths.csv'); LampData=csvread(DataFile,1); LampPeaks=csv...
function [ u,v ] = anisoTVDenoise( lambda,wh,wv ,varargin) % this function compute ||u,v||_l+lambda||u-wh||^2+||v-wv||^2 if nargin==4 if size(wh)==size(wv) V=abs(wh); V(V==0)=1; V=max(V-lambda,0)./V; u=(wh/varargin{1}).*V; V=abs(wv); V(V==0)=1; ...
z = 78; img = imread(['/Users/marcWong/Data/ProcessedData/001A/coloredimg/layer' num2str(z) '/17.jpg']); roi = imread(['/Users/marcWong/Data/ProcessedData/001A/roi/roi' num2str(z/6) '.jpg']); %Gx = load('/Users/marcWong/Data/ProcessedData/001A/t17Gx.txt'); %Gy = load('/Users/marcWong/Data/ProcessedData/001A/t17Gy.txt')...
%% Random parameter generator for data validation % Generate a text file with 36 random number from 0 to 1 path='C:\Data\'; fileName='fileName'; n=36; M=rand([n 1]); dlmwrite([path,fileName,'.txt'],M,'delimiter','\t')
clear all close all headerlinesIn=0; delimiterIn=' '; fontsize_labels = 18; fontsize_grid = 16; fontname = 'Times'; %180: 8-1140 %360: 128-4096 %550: 512-16384 %1000: 2048-32768 a=[180, 360, 550, 1000]; b=[8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768]; nel=[36480,237120,853632, 1264032];% pol=[8, 8, ...
%% for a fixed sensor-finger combination... function bS = angToB_sym_static(theta) r = angToP_sym_static(theta); h = angToH_sym(theta); Br = 12.6e+03; mu_0 = 4*pi*1e-07; mu_r = 1.05; % addFact = 0.2312; addFact = 1; lam = (Br*mu_0*mu_r)/(4*pi)*addFact; lambda = [lam -lam lam]; b = symfun((((3*r*(h*r'))/(norm(r)^5))...
%% init close all; clear all; save_figs = false; Ningreds = [4,6,8,10,12,14,16,20]'; Nfits = length(Ningreds); maxent1v2s = cell(Nfits,1); maxent1s = cell(Nfits,1); maxent2s = cell(Nfits,1); freqs = cell(Nfits,1); load('data/recipentropy_4in_large.mat'); maxent1v2s{1} = maxent1v2; maxent1s{1} = maxent1_large; maxent2...
function [FoM,stdFoM] = sbrs_netv2(spec,tpltSpec,roi) % 尝试实现 Heider 提出的SBRS能谱处理方法 % 论文:Signature-based radiation scanning using radiation interrogation to detect explosives % spec:N列实测能谱,第一列为air谱,其它列为样品-air谱 % tpltSpec:M列模板谱,第一列为air谱,要求与spec统一纵轴 % roi:与能谱道数一致的单列向量 % % FoM:M行N列相似度指标,每列代表每能谱和1~M个模板的相似度 % stdFoM:M行N列相似度指标...
function [ret_theta, ret_r] = f_rungeKutta(phi0, Hn, N0, theta, begin, step, stop) r0 = begin; theta_array = theta; r_array = r0; for r = begin:step:stop k1 = step * f_dtheta(r , r0, phi0, Hn, N0); k2 = step * f_dtheta(r + step/2, r0, phi0, Hn, ...
function erp = errRP(FTBO) % Retourne l'erreur en régime permanent % param: FTBO - la fonction de transfert % return: erp - l'erreur en régime permanent erp = 1/(FTBO.Numerator{:}(end)/FTBO.Denominator{:}(end-GetClass(FTBO))); if (GetClass(FTBO) == 0) erp = 1/((FTBO.Numerator{:}(end)/FTBO.Denominator{:}(en...
% imageName = 'both_10_255.jpg'; pic = imread(imageName); figure; subplot(1,2,1) imshow(pic) res = input('uniform; enter line \n'); u = pic(:,res,1); res = input('gaussian; enter line \n'); g = pic(:,res,1); res = input('truncated gaussian; enter line \n'); t = pic(:,res,1); res = input('square; enter line...
function [ segmented, centroids ] = kmeans_segment( image, Kclusters ) image_vector = turn_into_vector(image); [idx, centroids] = kmeans(image_vector', Kclusters); segmented = turn_into_image(idx', centroids, image); figure; subplot(1,2,1); imshow(image); title('Original image'); subplot(1, 2, 2); imshow(u...
function [I, C]=lineline2d(l1p, l1n, l2p, l2n) %oUTPUTS: % % I is the point of intersection % % C indicates intersection condition: % 1 => parallel or colinear % 2 => intersects t = (l2p - l1p) / [l1n; -l2n]; if any(abs(t) == [inf inf]) C = 1; I = nan(1, 2); return; end C = 2; I = t(1) * l1n + l1p;
% Milestone 2a - Corneel T Jonck and Vincent Vanweddingen (groep 5) clear all; close all; %%%%%%%%%%%%%%%%%%%% % Setting parameters %%%%%%%%%%%%%%%%%%%% Nq = 6; M = 2^Nq; cpr = 600; SNR = 25; fftSize = 2^10; frameSize = fftSize/2-1; z = Nq*frameSize; thresh = -110; %% for bitloading, cfr figure 1 %%%%%%%%%%%%%%%%%%%%...
function [ integrated ] = windowIntegration( cond, act, respHist, windowSize ) %WINDOWINTEGRATION calculate log-posterior for sequence of responses, given % an integration window size and conditional probabilities integrated = zeros(size(cond, 1), size(cond, 2), size(act, 2)); for i = 1:size(act, 2); lower = max(1,...
function [ ] = ej23( ) close all; im1 = imread('./images/Einstein.jpg'); im2 = imread ('./images/Monro.jpg'); h1 = fspecial('gaussian',20,10); h2 = fspecial('gaussian', 15, 18); lowim1 = imfilter(im1, h1); highim1 = im1 - lowim1; lowim2 = imfilter(im2, h2); figure; subplot(2, 5, 1); imshow(highim1); subplot(2, 5...
function varargout = Menu_creation_gui(varargin) % MENU_CREATION_GUI M-file for Menu_creation_gui.fig % MENU_CREATION_GUI, by itself, creates a new MENU_CREATION_GUI or raises the existing % singleton*. % % H = MENU_CREATION_GUI returns the handle to a new MENU_CREATION_GUI or the handle to % the ex...
function [T] = constructT(Y) % constructT()将标签向量转换成相应的矩阵形式 % Y是标签 type_num = size(unique(Y),1);%类别数目 [m,n] = size(Y); T = zeros(type_num,m); for i = 1:type_num index = find(Y==i); c = size(index,1); for j = 1:c T(i,index(j)) = 1; end end end
function x = newton(x,Fg, Fgprime, tol) % % Usage: x = newton(x, Fb, Fgprime, tol) % % This routine solves the scalar-valued nonlinear equation f(x)=0 % using the newton method to a residual tolerance of tol. % % inputs: x initial guess % tol REAL solution tolerance % Fg ...
function updated_cv = competitive_learning(data, codevectors, learning_rate) data_size = size(data); rand_row = rand; rand_row = floor(data_size(1) * rand_row); if rand_row <= 0 rand_row = 1; end row = size(codevectors); row = row(1); ax = sum(max(data).^2); for index = 1:row distance = ((dat...
%Script to evaluate the performance of adlist application %File that consist true blacklist urls sFileName = 'blacklist.txt'; %True blacklist urls cTrueBlacklistUrls = readTrueBlacklistFromFile(sFileName); %Adlist blacklist urls sUrl = 'http://adlist.herokuapp.com/urlpublish'; tAdlistUrls = getAdlistTable(sUrl); %Read...
function outdata = zeromean(indata, start, stop) %outdata = zeromean(indata, start, stop) % %Subtracts the mean value from each column in the matrix from each value %in each column. Start and stop sample values are optional. Indata is a %NSamps x NChans matrix, such as that returned by rd_onetr_allch (c.f.). % %Modifi...
% history_length = 10; % sample num % dop = 1; % deg of polynomial NOTICE! dop too high will make(A'*A) close to singular and cause numeric issue when using code gen mode. A = zeros(c_history_length,c_dop+1); % osam = 0; % offset sample % for i = 1:c_history_length for j = 1:c_dop+1 A(i,j) = ((i-c_histor...
function [bd_dsy,prob,dsq,dscen,edges] = general_backdooreffect_q_fixed_centroid(ds,dscen,x,y,z,w,b,delta) %This function return the Probability of Pr(Y / do(X=x),W=w) using the backdoor %adjustement with the set z Pr(Y / do(X=x),W=w) = sum_{z}Pr(Y/X=x,W=w,Z=z)Pr(Z=z) %In this version the dataset is quantized, the prob...
% From CO2 optimization problem m_dot= 0.14; % Obtaining the model [A13,B13,C13,E13] = LoadBuildingParametersAndBuildTemperatureMatrices(m_dot); iNumberOfInputs = size(B13,2); iNumberOfDisturbances = size(E13,2); % Matrix Definition Cf = 9.14 * 10^4; Cs = 1.62 * 10^7; ...
function [ ] = ex44b( ) close all; figure; addpath('ViolaJones','ViolaJones/SubFunctions'); bgSet={'landscape.jpg','room.jpg','natural.jpg'}; i = 1 for fimg=bgSet, subplot(2, 3, i); img=imread(['images/' char(fimg)]); imshow(img); subplot(2, 3, i+3); sho...
% book : Signals and Systems Laboratory with MATLAB % authors : Alex Palamides & Anastasia Veloni % % % % Problem 5- impulse response of a continious time system num=conv([1 2],[1 -3]); den=[1 9 26 24]; t=0:.1:3; h=impulse(num,den,t); plot(t,h) title('Impulse response') %second way figure ...
clc; fileID=fopen('E:\Project\Weizmann Files\New\glcm1.csv','a'); % path for output csv file total=2000; % Total number of features for k=1:total fprintf(fileID,'att_%d,',k); %Writing into csv file as columns end fprintf(fileID,'Class'); ...
sparse_random_practical = 9*ones(N,J); examinee_record_random_practical = zeros(size(theta,1),test_cali); item_record_random_practical = zeros(J,target_sample); unselect = index_cali; item_finish = []; %% for examinee = 1:N unselect = setdiff(unselect,item_finish); item_chosen = randsample(unselect,min(test_ca...
%% code2_functions.m Demonstration code for functions %% scripts % this m-file is a script % show help text for a script help code2_functions % look for help text that contains some word lookfor demonstration % percent sign starts a comment %{ percent sign and set brace start a comment block that can co...
function varargout=PatientStructHelper(INPUT_STRUCT,varargin) % PatientStructHelper % A helper function for adding and retrieving fields from cell arrays % of structures. % % % % OUTPUT_STRUCT=PatientStructHelper(INPUT_STRUCT,... % {'field_name1',INDEX_ARRAY1,DATA1},... % ...
r=30; if exist('W')==0 D=load('./USPS/trai_data.txt');, trai_label=load('./USPS/trai_label.txt'); Q=load('./USPS/test_data.txt');, test_label=load('./USPS/test_label.txt'); [Dim,trai_num]=size(D);,[Dim,test_num]=size(Q); for i = 1 : trai_num, D(:,i)=D(:,i)./norm(D(:,i));, end for i = 1 : test_num, Q(:...
% SDDP parameters params = sddpSettings('yalmip.declareVariables',@()declareVariables(modelparams),... 'algo.McCount',10, ... 'algo.iterationMax',100,... 'termination.checkStdMc',false,... 'termination.checkPer...
% Tanvir Ferdousi % Kansas State University % Last Modified: Apr 2017 % Copyright (c) 2019, Tanvir Ferdousi. All rights reserved. % Redistribution and use in source and binary forms, with or without % modification, are permitted % Loads adjacency matrix and generates neighborhood style data function Net = NetLoad(fil...
% OSMNET read OSM data as JSON and plot graph % Clas Rydergren, clas.rydergren@liu.se, 2013-09-12 % Uses http://www.cs.sunysb.edu/~kyamagu/software/json/ % for reading the JSON into Matlab. % Read the JSON exported from Overpass-turbo.eu as "raw" data (JSON) % X=json.read('C:\Users\clary35\Documents\MATLAB\large4.js...
% 信号作FFT变换,得到信号的频谱 % 本程序不适用于宽带信号 function [ff,amp] = myfft(fs,x,draw,linewidth,style) if nargin < 5 style = '-'; end if nargin == 2 draw = 0; end if nargin == 3 linewidth = 1; end NN = length(x); % ff = (0:floor(NN/2))*fs/NN; % amp = abs(fft(x)/NN*2); % amp = amp(1:(floor(NN/2)+1)); ff = linspac...
pointx = zeros(16,4); pointy = pointx; textpoint = zeros(16, 2); a = 1; for i = 1:4 for j = 1:4 [i, j] pointx(a,:)=[j-1, j-1, j, j]; pointy(a,:) = [4-i, 5-i, 5-i, 4-i]; textpoint(a,:) = [j-0.5, 4.5-i]; a = a+1; end end
function repP=Ei400_uvw111_at10m1TpMod2P(varargin) root = fileparts(pwd); data_source= fullfile(root ,'sqw','Data','Fe_ei401.sqw'); bragg = [1,0,-1]; dE = 10; dK = 0.05; pefP1= [-0.26,-0.14,0,0.14,0.36; 90,20,0,20,140]; pefP2 = [-0.26,-0.14,0,0.16,0.34; 100,20,0,20,130]; pefP3 = [-0.26,-0.11,0,0.19,0.34; ...
function tables = getSummaryTables(obj) % GETSUMMARYTABLES % % % Created by Megan Schroeder % Last Modified 2014-03-29 %% Main % Main function definition varNames = {'Walk_Control','Walk_PatellaACL','Walk_HamstringACL',... 'SD2S_Control'...
function [expl, obsv_mean, obsv_std] = collect_expl_obsv_vector(expl_in, obsv) expl = unique(expl_in); obsv_mean = []; obsv_std = []; for e = expl obsv_mean = [obsv_mean nanmean(obsv(e == expl_in))]; %#ok<AGROW> obsv_std = [obsv_std nanstd(obsv(e == expl_in))]; %#ok<AGROW> end end
% % This scripts runs the basic analysis for everyday observation of the % % mice's behavior in the magazine approach paradigm. A white noise is % % followed by food 10 sec later (marked with a clicker). There is a 10-s % % pre-CS period for baseline levels of responding. The experiment was run % % in the old chambers....
function [y_ch,y_rt,prob_choice] = bamp_rw_linear_binary_sim(r, infStates, p) % Simulates logRTs with Gaussian noise % as well as choices under the IOIO task model % -------------------------------------------------------------------------------------------------- % Copyright (C) 2016 Christoph Mathys, TNU, UZH & ETHZ ...
function Proc = ImageEdge(labeled,xLength,yLength,gX,gY,addX,addY,objectID) % ********************************************************************************** % * % * ImageEdge(labeled,xLength,yLength,gX,gY,addX,addY,objectID) % * % * labeled = labeled image % * xLength = distance to travel it x dir % * yLe...
function [a, b] = centering(a, b) if length(a) > length(b) lenDiff = length(a) - length(b); if rem(lenDiff, 2) b = [zeros(fix(lenDiff/2), 1);b;zeros(fix(lenDiff/2)+1, 1)]; else b = [zeros(lenDiff/2, 1);b;zeros(lenDiff/2, 1)]; end else lenDiff = length(b) - length(a); if rem(lenDi...
function show_neg_clusters( clusters, patches ) % threshold clusters to > 1 old_clusters = clusters; clusters = {}; c = 1; for i=1:size(old_clusters,2) cluster = old_clusters{i}; if size(cluster,2) >= 1 clusters{c} = cluster; c = c + 1; end end num_clusters = size(clusters,2) scrsz = get(0,'ScreenSize')...
function shutdown(program) save_data( program ); close_window( program ); close_arduino( program ); delete_trackers( program ); handle_cursor(); handle_keyboard(); end function delete_trackers(program) if ( isfield(program.Value, 'tracker') ) delete_tracker( program.Value.tracker ); end end function delete_tr...
[data,varnames,casenames] = tblread('training_set.tab', '\t'); healthy = data(:,varnames(:,6) == '1'); unhealthy = data(:,varnames(:,6) == '0'); scores(1:4400,1:2) = 0; for i=1:length(casenames) m1 = mean2(var(healthy(i,:))); m2 = mean2(var(unhealthy(i,:))); %fprintf('Positive average=%f, negative averag...
function [D]=d_compute(xt,xp,W) [mx,nx]=size(xt); [pmx,pnx]=size(xp); D=zeros(pmx,mx); for i=1:pmx for j=1:mx D(i,j)=sqrt((xt(j,:)-xp(i,:))*W*(xt(j,:)-xp(i,:))'); end end end
%% Dielectric-Slab model: Semi-empirical model forms % Bush T, Ulaby F (1976) Radar return from a continuous vegetation canopy. IEEE Trans Antennas Propag 24(3):269–276 %% clear; %% Alfalfa: Freq: 8.6 GHz % A = [0.469 9.941 26.73 0.35]; %% Alfalfa: Freq: 13.0 GHz % A = [0.269 12.827 46.01 0.46]; %% Alfalfa: Freq: 17....
function [] = SegmentRefine(ImName) % SEGMENTREFINE - Main graph cuts segmentation function % SEGMENTREFINE(IMNAME) - ImName - Image to segment % Authors - Mohit Gupta, Krishnan Ramnath % Affiliation - Robotics Institute, CMU, Pittsburgh % 2006-05-15 % Global Variables global sopt ih_img fgpixels bgpixels fgflag segI...
function exp = laser_OL_half_sec(exp) laserDistribution = exp.protocolArgs{1}; laserParams = exp.protocolArgs{2}; pulseDuration = .5; % sec exp.laserDistribution = laserDistribution; exp.laserParams = laserParams; exp.nullEpochs = [1:2:17]; exp.leftEpochs = [2:2:16]; ex...
classdef MotionArtifactCheck< nirs.modules.AbstractModule %MOTIONARTIFACTCHECK Summary of this class goes here % Detailed explanation goes here properties filenamedigit1=1; filenamedigit2=2; absvariance=30; channelofinterest=1; end methods function...
% <ENG 6, SQ16 Lab 005> % <Chengeng, Xiao> % <913186040> % <A07> %% Problem 1 % 2) The script file A1 = [3 1; 1 6]; B1 = [9; 20]; A2 = [3 1; 6 2]; B2 = [9; 18]; A3 = [3 1; 6 2]; B3 = [9; 20]; % Load the data X = Lab5(A1, B1); disp(X); X = Lab5(A2, B2); disp(X); X = Lab5(A3, B3); disp(X); % Call your f...
function x = fsub(L,b) % solve Lx = b where L is an % nxn lower triangular matrix n = size(L,1); x = zeros(n,1); x(1) = b(1)/L(1,1); for i = 2:n x(i) = (b(i) - L(i,1:i-1)*x(1:i-1))/L(i,i); end
function F=scarsplslda(X,y,A,K,method,num,OPT) %+++ This is the simplified version of CARS, only retaining the EDF element. %+++ num: the number of Monte Carlo Sampling. %+++ A: the maximal number of PLS components to extract. %+++ fold: number of folds for cross validation. %+++ method: pretreat method, 'cente...
% 双线性变换法设计ChebyshevI型带通滤波器 % 技术要求: % 通频带:wp1~wp2:0.4*pi~0.6*pi(单位:弧度) 最大衰减:1db % 阻带:ws1 = 0.2*pi(单位:弧度) ws2 = 0.8*pi(单位:弧度)最小衰减:40db clear; clc; clf; rp = 1; wp1 = 0.4*pi; wp2 = 0.6*pi; rs = 40; ws1 = 0.2*pi; ws2 = 0.8*pi; T = 0.001; wp3 = 2/T*tan(wp1/2); wp4 = 2/T*tan(wp2/2); ws3 = 2/T*tan(ws1/2); ws4 = 2/T*tan(ws2/2)...
function th_ulf_process(tint,thId,freqRange) %TH_ULF_PROCESS process THEMIS ULF data % % th_ulf_process(tint,thId,freqRange) % ---------------------------------------------------------------------------- % "THE BEER-WARE LICENSE" (Revision 42): % <yuri@irfu.se> wrote this file. As long as you retain this notice you...
%------------------------------------------------------------------------------- % Four-way classification: male-day/male-night/female-day/female-night %------------------------------------------------------------------------------- %------------------------------------------------------------------------------- %% La...
function [Setup_out] = checkModelOptions(Setup) %CHECKOPTIONS Checks model contradictions Setup_out = Setup; if ~Setup.ModelOptions.Defender.SixDoF Setup_out.ModelOptions.Defender.MotorLag = 0; end if ~isequal(Setup_out,Setup) warning('Model Options were modified due to c...
classdef HMM < handle properties dim % dimension of the state space D % dimension of the observation space pi0 %initial distribiutions A % transition probabilities obsTypes % obsTypes is input to the constructor of the dists.GPEF distribution % ...
A = [-1 0 0; -1 -2 -101; 1 1 0]; B = [0 1; 1 -1; 0 0]; C = [1 0 101]; D = [0 0]; u_t = [1; -2]; syms s; syms teta; h = 0.1; A_d = ilaplace(inv(s * eye(3) - A), h); B_d = int(ilaplace(inv(s * eye(3) - A), teta) * B, teta, 0, h); A_d1 = double(A_d); B_d1 = double(B_d); [num1s, den1s] = ss2tf(A, B, C...
function [ output] = rsos( input ) %UNTITLED2 Summary of this function goes here % Detailed explanation goes here output=sqrt(sum(abs(input).^2,3)); end
classdef rlPGAgent < rl.agent.AbstractOnPolicyPGAgent % rlPGAgent: Implements policy gradient (REINFORCE) agent % Copyright 2017-2019 The MathWorks Inc. properties (Access = private) % Flag used for validation since PG option validation differs % between pre-post construction ...
% shows an image with arrows, represention the movements of sift-points function showImageWithSiftMovements(im1, im2, optionalThreshold) % optional if nargin < 3 optionalThreshold = 1.5; end %\optional checkImageSizes(im1, im2); checkSize('optionalThreshold', optionalThreshold, [1,...
function [ xi, yi ] = findInterpsVert( ni,meshdomain,x,y ) pert = 0.000001; y_temp = linspace(y,meshdomain(4)-pert,ni*3); x_temp = x; xi = x_temp; yi = y_temp(2:end-1); end
function scale = SIN_CalAudio(REF, varargin) %% DESCRIPTION: % % The calibration procedure for SIN sets the HINT-Noise.wav (a speech % shaped noise sample) to 0 dB and scales all other stimuli or stimulus % sets to also rest at 0 dB. The user can then present the HINT-Noise % stimulus through their sound playba...
% Readfile_textscan % script that reads from a file using textscan % open the file file_id = fopen('GBplaces.csv'); if (file_id == -1) error ('The file could not be opened.'); end % only open the file if it exists, file_id =/= -1 % read the data with textscan, skipping first line data = textscan(fil...
function [ out,P_max,Q_max,d_max ] = local_search( p,q,P,Q,C,delta,bin ) %p and q are index of P and Q in matrix co_ordinates [r,c,~] = find(C); co_ordinates = [ r c ] ; %CHANGE THE CONDITION FOR END POINTS if p-delta< length(co_ordinates) P_2 = P; else P_2 = co_ordinates(p-delta,:); end...
function preds=knnclassifier(xTr,yTr,xTe,k); % function preds=knnclassifier(xTr,yTr,xTe,k); % % k-nn classifier % % Input: % xTr = dxn input matrix with n column-vectors of dimensionality d % xTe = dxm input matrix with n column-vectors of dimensionality d % k = number of nearest neighbors to be found % % Output: % pr...