text
stringlengths
8
6.12M
function [result, dice, volume] = evaluate_demo(PatientsData, feature_index, train_mean, train_std, model_SVM) record = 0; annotated_slices = PatientsData.annotated_slices; annotated_features = PatientsData.annotated_features; n = length(annotated_slices); dice_belows = zeros(1, n); dice_up...
clear;clc;clf peaks [az,el]=view %方位角(azimuth) %仰角(elevation) view(30,-30) %設定圖形的視角,單位為度 colorbar('horizontal') %把coclrbar變為平行(內定預設為垂直)
function C = autodijk(varargin) % % NAME % % function C = autodijk() % % ARGUMENTS % INPUT % % OPTIONAL % % DESCRIPTION % % 'autodijk' constructs the base class for analyzing the % Dijkstra-based properties of a curvature mapping on a % FreeSurfer surface. % % NOTE: % % HISTORY % 02 November 2009 % o Init...
function es = combineTwoVRexpts(es1, es2) % function to combine two VR experiments. % Created AS 2011 % Combines the following fields: %. 'screenTimes2' %. 'sortIDX' %. 'screenTimes' %. 'sampleRate' %. 'sampleTimes' %. 'trialID' %. 'traj' %. 'trajspeed' %. 'ballspeed' % 'lick' ...
% ------------------------------------------------------------------------- % A demo for the SOS matrix decompsotion % and Correlative Sparsity technique % ------------------------------------------------------------------------- % Details can be found in the following papers % [1...
%% Question 2 % Clear variables and close figures clear; close all load digits.mat [n,d] = size(X); nLabels = max(y); yExpanded = linearInd2Binary(y,nLabels); t = size(Xvalid,1); t2 = size(Xtest,1); % Standardize columns and add bias [X,mu,sigma] = standardizeCols(X); X = [ones(n,1) X]; d = d + 1; % Make sure to ap...
%Simple file to plot data drom 2 files in octave (2dim plot) %addpath(genpath("/home/gomez/workspace/Plot1")); %or replace with needed %savepath; %path %this is a test datax=load("x"); datay=load("y"); myPlot=plot(datax, datay); % figure; %To create a new window % hold on; %To not overwrite the existing plot pa...
clear, close all; %% % ML estimation using a receiver array with randomly placed antennas % (uniformly distributed). This is the single carrier version. %% Parameters SNRdB=2000; actSNR=10^(SNRdB/10); %% Target & Modulation definition % Angle % u_x_real=rand()*1.8-.9; u_x_real = 0.0; u_real=[u_x_real;0;sqrt(1-u_x_rea...
function [scfac] = procH5normFactor(file) %procH5normFactor - read in the raw data sequentially in order to determine %suitable normalisation / transformation scaling values... % File name if nargin == 0 %file = '/Users/jmckenzi/Documents/Box Sync/H5 Proc/H5-Test-170510-135411.h5'; file = '/Users/jmckenzi/Docu...
%Outputs a formatted circuit, taken in as an 2 dimensional matrix. %Fixed tile size. classdef VisualGrid < handle properties %backend stuff <<<<<<< HEAD dimensionSizeX; dimensionSizeY; ======= dimensionSize; >>>>>>> 3da1db6a338cf615ebb0ffbac6d91b23be6d27e7 squareSize; %the size o...
%% Stelling 12 % % De functie aanroep 'zeros(3)' genereert een matrix % met 3x3 elementen. % Antwoord = NaN; % vul hier het juiste antwoord in 1 (WAAR) of 0 (ONWAAR)
% Name: Zheng Wen % USC ID: 7112807212 % USC Email: zwen1423@usc.edu % Submission Date 3/3/2020 addpath('E:\Chrome Download\EE569\Week3\basicOperations'); raw = readraw('GearTooth.raw'); img = raw22D(raw, 250, 250); img = matTranspose(img); img = fixedThresholdDithering(img, 150); img_cp = img; figure(1) ...
%% mercury_test_ene_hist.m - plot graph of energy history %% loading % ene = mercury_load_ene('free_cooling3D.ene') % restart = mercury_load_restart('free_cooling3D.restart') ene.ene_tot = ene.ene_gra + ene.ene_kin + ene.ene_rot + ene.ene_ela; %% history of energy subplot(2,2,2); plot(ene.ts, ene.ene_gra, 'g', ... ...
function [] = parte2(which=1) % Datos comunes a las 3 problemas planteados [ind,coord,aristas,costos,delays]=carga("../datos/nodos.txt","../datos/aristas.txt"); [mAdy,vecInd] = adaptador(ind,aristas); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Por Costos if (which==1...
function hw3_3() % Program the steepest descent and Newton algorithms using the backtracking % line search, Algorithm 3.1. Use them to minimize the Rosenbrock function % (2.22). Set the initial step length = 1 and print the step length used % by each method at each iteration. First try the initial point % x0 = (1.2, 1....
path(path, 'data/'); name = 'sparse-curve'; rep = 'results/tensor-dense/'; if not(exist(rep)) mkdir(rep); end n = 150; M = load_image(name, n); M = rescale(clamp(M,0,255)); % compute structure tensor around the curve sigma1 = 1.5; % for gradient computation sigma2 = 6; % for filtering the tensor field T1 =...
function res = preprocessLFP_VS(animal, iseries, iexplist, Probe) % dwonsample the LFP to 1kHz and save it to a mat file SetDirs; global pepNEV global DIRS addpath(genpath('..\Behaviour analysis\')) addpath(genpath('..\General\')) addpath(genpath('..\Spike Analysis\')) if nargin < 3 iexplist = []; end if nargi...
clear clc n = 7; maximum = 0; minimum = 1000; count58 = 0; count32 = 0; fileadj = 'bd'+string(n)+'adjmat.txt'; filever = 'bd'+string(n)+'_ver.txt'; Adj = importdata(fileadj); V = importdata(filever); V = V(:,2:size(V,2)); for a = 1:30 c = rand(size(V,2),1); TSPs = V*c; temp = TS...
%% NLMS flux ramp estimation and demodulation % Readout setup Fs = 2.4e6; % downsampled rate resetRate = 1e4; % flux ramp reset rate frameSize = Fs/resetRate; % number of samples per frame freqNorm = 2.9e4/Fs; % normalized frequency, 2.6kHz with 1kHz reset rate corresponds to 2.6 phi0 numb...
close all; clear; clc; Network1; Network2; Network3; graph1 = ListToGraph(network1, max(network1)); graph2 = ListToGraph(network2, max(network2)); graph3 = ListToGraph(network3, max(network3)); VisualizeGraph(graph1); VisualizeGraph(graph2); VisualizeGraph(graph3); % % CalculateClusteringCoefficient(graph1) % Calcu...
classdef sm_viewer2_exported < matlab.apps.AppBase % Properties that correspond to app components properties (Access = public) SingleMoleculeDataBrowserUIFigure matlab.ui.Figure main_axis matlab.ui.control.UIAxes loadsmfcsvfileButton matlab.ui.control.Button ...
function [dxyz,mxyz] = defineCommonGrid(XYZ, dxyz,stepsize) if nargin < 3 stepsize = 0.25; end if nargin < 2 dxyz = ones(1,size(XYZ{1},2)); end mxyz = min(cell2mat(XYZ)); XYZ_adj = XYZ; XYZm = cellfun(@(x) bsxfun(@minus,x,min(x)), XYZ, 'unif', 0);; N = cellfun(@(x) size(x,1), XYZ); ndim = length(dxyz); ...
function [cM] = ... stats_BE(astr_BETable, a_cols, varargin) % % NAME % % function [cM] = stats_BE(astr_BETable, a_cols [, ... % ab_skipPrune, ... % ab_skipFirstCol]) % % ARGUMENTS % INPUT % astr_BETable string output table from 'mris_curvature_stats' % a_cols int number of "paired" columns in %...
function [a,fL]=transform_cfp4_only(a) maxA=max(max(max(a))); a=double(a); if maxA>1024 a=a/16; elseif maxA>256 a=a/4; end max(max(max(a))) %----------------------------------------------------------------------- M=4; tanTheta=1/8; for ia=1:96 ia [a(:,:,ia),fL]=LFP2(a(:,:,ia),M); a(:,:,ia)=block2band(a...
function [A, b, nDir, confined] = BC(X,dom,n) % [A, b, nDir, confined] = BC(X,dom,n) % Matrices to impose Dirichlet boundary conditions using Lagrange % multipliers on a rectangular domain % Input: % X: nodal coordinates % dom: domain description [x1,x2,y1,y2] % n: number of velocity degrees of freedom % Outp...
%Number 2 in Review %Create a plot of y = x^2 for x = -10:10 x = -10:10; y = x.^2;%Need the .^ to get element wise results plot(x,y);
function [A,B,C,D] = SystemModel(P) %% Model Sistem % Besaran fisis beserta konstanta yang digunakan k = 1000; %kN/m beta = 0.02; g = 9.8; %m/s2 myu = 0.002; %m1 = m(1); %ton %m2 = m(2); %ton m1 = 34 + (P*0.06); %ton m2 = 34 + (P*0.06); %ton % Pemodelan sistem A = [0 1 0 ...
tic close all; clear all; clc; conn = database('sim_v3_8_3_2015','root','sHa136384', 'Vendor','MySQL','server','localhost'); sqlquery = 'SELECT * FROM HistoryData'; curs = exec(conn,sqlquery); curs = fetch(curs); data = cell2mat(curs.Data); time = data(:,2); S = data(:,3); I = data(:,4); P = data(:,5); R ...
function xplus = g(x) %%%%%%%%%% %jump map of the hybrid automaton %%%%%%%%%% % load the parameters parameter; % state xi = x(1:20); zeta = x(21:24); tau = x(25); kapa = x(26); xplus = zeros(26,1); xplus(1:20) = xi; xplus(21:24) = 0; xplus(25) = 0; xplus(26) = kapa + 1; end
x = -1.4:0.01:0.4; plot(x, myerrorfun(x, 1)) [x1, y1] = fminsearch(@(x) myerrorfun(x,1), -1.2) hold on; plot(x1, y1, 'ro', 'MarkerSize', 10, 'MarkerFaceColor', 'r')
% Lec 8.3 : Methods of Lines for transient PDEs function fval = rodConduc(t,y) % Parameters Ta = 25; alpha = 0.025; beta = 0.1; % Getting temperature N = length(y)+1; T(1) = 100; T(2:N) = y; T(N+1) = Ta; h = 1/N; %% Define dT/dt dTdt = zeros(N + 1,1); for i = 2:N dTdt(i) = alpha/h^2*(T(i+1)-2*T(i)+T(i-1))- beta*...
% The ReadImages function helps to read in a specified list of images % given the filenames and the directory the files are located in. % % Input: path - A string containing the name of the % directory the images are contained in % % filenames - A 1xn 1D cell array containing n strings % ...
### Skript zum Newton-Verfahren ### function [x, e, v] = myNewton(f, df, x0) if f(x0) == 0; printf('Startwert ist schon eine Nullstelle.') x = x0; e = 0; v = f(x0); break end x(1) = x0; x(2) = x(1) - f(x(1)) / df(x(1)); v(1) = f(x(1)); n = 2; while(abs(x(n) - x(n-1)) > 10**(...
function [] = GenLogdata_1(source) % automatically log the test data signal in the preconditions load_system(source); sys = [source '/Validation Functions']; c = find_system(sys, 'regexp', 'on','LookUnderMasks','all','Name','Test Info'); ReqNr = length(c); lb = length('Test Info')+1; lg = length([source '/Validation Fu...
clear variables acer=1; rat24base=2; %Rat 24 base. plot_sleep=0; %% %Rat=26; for RAT=1:3 rats=[26 27 24 21]; Rat=rats(RAT); % for Rat=26:26 if Rat==26 nFF=[ % {'rat26_Base_II_2016-03-24' } % {'rat26_Base_II_2016-03-24_09-47-13' } % {'rat26_Base_II_2016-03-24_12-5...
function make_ADV_RC_bat_file(action,var_name) % Make ADVISOR engine file global binf MakeFile; type='ess'; %Files and path for .mat files at different temperatures files=strrep(MakeFile.data_files,'.mat',''); path=MakeFile.path; %sort files in order of ascending temperatures for i=1:length(files) eval(['load ''',...
%% Define parameters - adjust parameters here to fix tracking and ROI segmentation errors warning OFF; % Experimental parameters exp_duration=60; % Duration of the experiment in minutes referenceStackSize=5; % Number of images to keep in rolling reference referenceFreq=3; % Minutes between r...
function output = decoder(enc_out, no_points_per_bit, no_bits_per_sample,type) output=[]; flag =0; outputs =[]; switch type case 'Unipolar NRZ' for i=1:length(enc_out)/(no_points_per_bit) if enc_out((i-1)*no_points_per_bit+1)>0 outputs=[outputs 1]; else ...
function [f,qm,im,info1,info2,info3,ind]=fidread(pfilename,seq,slc,frm,acqno) % Usage ... [f,qm,im,info1,info2,info3]=fidread(pfilename,seq,slice,frame,acquisition) % %ndat=info1(9); %nslices=info1(3); %npr=info3(5); %nph=info3(2); %nphmult=info3(11); %nphases=nph*nphmult; %frsize=2*npr*ndat; HEADERSIZE=39984; RDBRA...
function plot_spec0 % Fit experimental data for a pair +hmin -hmin (high Hmin) % using 5 parameters % A - amplitude % I0 - main field % I1 - additional uniform field, proportional to Imin (due to shielding) % Rmin - coil radius % K1 - uniform field distorsion caused by SC coil fit=0; find_figure('p...
function passed = test_eid2adj_faces %% Test function eid2adj_faces on different non-manifold meshes %% two "disks" intersecting in the middle. Each disk consist of 8 faces. Edges [8,9] and [4,9] are shared between disks. tris=int32([1,2,9; % 1 2,3,9; % 2 3,4,9; % 3 4,5,...
function pausekey(varargin) % PAUSEKEY pauses a key has been pressed and waits for another key press. % PAUSEKEY(key) pauses if specific key has been pressed and waits for another key press. % % Cogent 2000 function. % % $Rev: 218 $ $Date: 2010-10-27 12:06:55 +0100 (Wed, 27 Oct 2010) $ global cogent; % Set and check...
% test for building an anisotropic metric. add_base_paths; rep = '../../results/domain-anisotropy/'; if not(exist(rep)) mkdir(rep); end %% % load mask n = 300; name = 'sala'; M = rescale(load_image(name,n)); M = perform_blurring(M,5)>.5; M = conv2(double(M), ones(3), 'same')>0; M = double(M); %% % Building ten...
function fancyclip_make_release(newVersion) % Cut a release of fancyclip % % fancyclip_make_release <newVersion> % % This does most of the steps of performing a release for you. It will: % - run the tests % - build the project % - build the distribution artifacts % - update the VERSION file % - tag a new...
function tests = ZonotopeTest tests = functiontests(localfunctions); end function zonotope_creation_test(testCase) M = [0 1;2 1]; % create a zonotope cv = [1;1]; gener = [1 0;0 1]; zt1 = Zonotope(cv,gener); assertError(testCase,@() Zonotope(1,gener),'some:siz_dismatch:id'); % te...
# Two features, X and Y, are presented in the table below. # Find the coefficients of the linear regression equation Y=aX+b, the correlation coefficient and the determinacy coefficient. # Estimate the value of Y at an object with X=1.5. # Output in the following order: a, b, the correlation coefficient, the estimated v...
function strout = titlecase(strin) % Convert the first letter of a given string to uppercase strout = [upper(strin(1)) strin(2:end)];
function output = CropImg(input, pad) output = input(pad(1)+1:end-pad(1), pad(2)+1:end-pad(2), :, :, :, :, :, :);
%{ Camera-based tracker for the raft HoverGroup/PVT (2013) %} clear; close all; imaqreset; % obj = videoinput('winvideo',1,'RGB24_320x240'); % obj = videoinput('winvideo',1,'RGB24_424x240'); % min_area = 50; % max_area = 200; % obj = videoinput('winvideo',1,'RGB24_640x360'); obj = vi...
function makeRdataStructureHemiRegANOVA(ResultsBetaSerConnectivityOnlyNum,acc) %created by Oded Bein %assumes that connectivity analyses and single-trial activity analyses were %run. Takes the data and write it to a txt file that will be used to R %analysis %this script assumes that the connectivity and activity analy...
function [t, Phi, F, P, Lp,Sp,Np] = vort_period(N, w, mu, BH, BD, Phi0) % calculate 1 oscillation period % N - number of points, % w - frequency % mu - beta_M/beta_L % BD, BH = beta_L^2 T_D,H / 2f % Phi0 - initial angle t=linspace(0,2*pi/w,N); Th = acos(-1/4); AA = 1/(1-exp(-i*Th)); Sp = mu/sqrt(2) * exp(i*w*...
clf;clear; Th = 294.0; Tl = 194:1:294; lamda = 0.8; wel_lambda = (Th-Tl); wsup_lambda = ((1-Tl./Th).*(Th-Tl))./ (1-lamda); hold on plot(Tl-273.15, wel_lambda, 'b-','DisplayName', 'Radiator'); plot(Tl-273.15, wsup_lambda,'r-','DisplayName', 'Heat Pump'); hold off legend('show', 'Location', 'BestOutside'); xlabel...
% initialize the PASCAL development kit tmp = pwd; cd(VOCdevkit); addpath([tmp '/VOCcode']); VOCopts.datadir = '/Users/abhishek/Data'; VOCopts.dataset = ''; VOCopts.resdir = '/Users/abhishek/Data/Detection_model/'; VOCopts.testset = 'test'; VOCopts = VOCinit(VOCopts); cd(tmp);
function [P_grad, update] = update_term(x_p) global plant_dt gamma alpha g l y = eye(2); x=x_p; while( sign(x(2))*(x(1)-gamma) < alpha) x = x + plant_dt*stance_dynamics(x); A_dyn = [ 0,1 ; g*cos(x(1))/l , 0]; y = y + A_dyn*y*plant_dt; end P = collision(x); impact_grad = [ 0 , 0; 0, cos(2*alpha) ];...
%% StartBoard % Author - Tanishq Jain % Sets up the intial game % Needs global board_matrix img_matrix % board_matrix = zeros(8) % img_matrix = cell{8} % Argument - flip = bool function StartBoard(flip) % Load .mat files load Game_Replay_GUI/GUI_images.mat load Game_Replay_GUI/GUI_var.mat board_im = imsh...
function Yout=stepit(dydt,yin,dt) k1=dt*dydt(yin); k2=dt*dydt(yin+k1/2); k3=dt*dydt(yin+k2/2); k4=dt*dydt(yin+k3); Yout=yin+(k1+2*k2+2*k3+k4)/6; end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% Numerische Mathematik fuer Physik und Ingenieurwissenschaften 2018 %%% %% Programmierabgaben (Praktischer Teil des Uebungungsplattes) %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ...
% Assignment 8 ;Problem 4 % Initialization N0 = 1000; I0 = 1; R0 = 0; Y0 = [N0;I0;R0]; % Executing ODE tSpan = [0 25]; [tSol,YSol] = ode45(@(t,y) fun4Infec(t,y),tSpan ,Y0);
function [diseasescores] = diseasescoresPD25_extract %UNTITLED Summary of this function goes here % Detailed explanation goes here workingdirectory = pwd; files = dir(workingdirectory); dirFlags=[files.isdir]; subFolders=files(dirFlags); subFolders(1:2)=[]; for s = 1:length(subFolders) currentSubj= subFolders(s...
function [ nb ] = calcul_intersect( array1, array2 ) %UNTITLED2 Summary of this function goes here % Detailed explanation goes here nb = 0; for i = 1 : length(array1) for j = 1 : length(array2) if array1(i) == array2(j) nb = nb + 1; break; end end end ...
function [isequal] = double_equal(src, dst) % double_equal 目的是检查两个浮点数是否相等,由于浮点数运算会有精度损失,用==或者 >= <= 等逻辑运算符 % 未必能够得到预期的结果。所以用double_equal来判断相等。 % true = abs(src - dst) < exp(-8) % false = abs(src - dst) >= exp(-8) isequal = abs(src - dst) < exp(-8); end
function [Y,numIter,tElapsed]=seminmfruletest(X,outTrain) % SemiNMF based on update rules: X=AY, s.t. Y>0; % X, dataset, matrix, each column is a sample, each row is a feature, each column of X is a sample % k, number of clusters % option: struct: % option.iter, max number of interations % option.dis, boolen scal...
function barpic(numbars) a=zeros(900); barwidth=floor(900/(2*numbars)); bar_ind=ceil([1:barwidth]-(barwidth/2)); for k=1:numbars a((2*k-1)*barwidth+bar_ind,:)=1; end a=1-a.'; %% figure, subplot('position',[0 0 1 1]), imagesc(a) axis equal, axis off colormap gray set(gcf,'color','w') axis([1 900 1 900])
function Tsat= MBWREOS_Tsat(P) %Calcuates the saturation temperature, by searching for a value of T which %satisfies MBWREOS_Psat(T)-P=0 %Use: %Tsat= MBWREOS_Tsat(P) %where: %P = pressure (kPa) %Tsat = saturation temperature (K) %NOTES: %function returns -1 if given a pressure above the critical point Tc =101.08+273.1...
clear close all addpath ../model xdk = figure('units','inches','Position',[-24,5,10,6]); % this function gives a diurnal course of tmax % with no stress it would produce 4.3mm/d transpiration % x is the time of day from 0-24 pp = pi/(18-5.5); f = @(x)max(0,tmax_max*sin((x-5.5)*pp)); swp0 = -0.3; out = zeros(1...
function runGetTrialTimes(varargin) % This function loads the relevant digital file and estimates the trial % times when the images were flashed % use: runGetTrialTimes(varargin) % input arguments can be: % 'num' : channel number, should be a string . like '1' % 'rawdataDirectory' : leave this empty if you want to load...
% ====================================== % Cycle-slip detection % % zhen.dai@dlr.de % % last modified: 2011.Oct % ====================================== % reaction when clicking the SECOND button "show results" % depending on different methods selected, the button might have different % titles, and hence there might...
%% RCNN_SymmetricGroups : Creating Training Data %-------------------------------------------------------------------------- % % Creation of the region proposals for training a deep network. Each image % is fisrt labelled manually. Since all the images of the group has a % similar pattern, the labelled infomration is u...
% main_capacity_plotter function main_capacity_plotter(rk,const_index,stbc_index,r,N_BLOCKS,BLOCK_SIZE) % precision spec N_SAMPLES=N_BLOCKS*BLOCK_SIZE; prec_spec=[N_BLOCKS,BLOCK_SIZE,N_SAMPLES]; % size of the step SIZE_STEP=1; % SNR interval limits. In dB INTERVAL_LIMITS=[-10 15]; % quantity of points used N_POINT...
%[ALL]=[C,D,E,F,G,H1,I1,IIa1ADC,IIIb1ADC,IIIIb1ADC,JJJADC,JJJADCb2,T,PWM,Den,M]; [ALL]=importdata('Prueba_6.csv'); %%valor de muestras [C]=ALL(:,1); [D]=ALL(:,2); %[E]=ALL(:,3) %[F]=ALL(:,4) [G]=ALL(:,3); %%%%%%% Presion diferencial %%%%%% [H1]=ALL(:,4); [I1]=ALL(:,5); [IIa1ADC]=ALL(:,6); [IIIb1ADC]=ALL(:,7); [II...
% 8/28/14 % residual estimation error measurement % mics = 1; order = 4; winsize = 10000; mscale = 0.001; mshift = 0.999; alpha = 0; directory = "/media/joe/Milarepa/experiments/2014_08_29/d/"; trial = 6; err = 0; for mshift = (0.999:0.1:0.999); [vec, lambdas, f, z, w, r] = modesynth(mics, order, winsize...
%% Calculate the optimized trajectories for 6 link biped model with GRF % the dynamics constraints are discrete Lagrangian function result=opt_discrete(modelName,hipLen,toeLen,h,jointW,ank_push) %add share functions addpath dyn/ addpath obj/ addpath gaitCon/ addpath plotRobot/ addpath forward_dyn addpath i...
clear all fs =96000; noteON = 100 ; %100; noteOFF =3500; %3500 ; t = 0:1000/fs:4500; note = (t >= noteON) & (t <= noteOFF); N = length(note); f0 = 110; zi(1,:) = [0,0]; %vector zi(1,:) stores the previous value of the amplitude and state respectively. zi(2,:) = [sin(0), cos(0)];% vector zi(1,:) stores intial phase f...
% An enum class of for interference free workspace methods % Author: Zeqing % Date: 7/2017 % Description: Enum class for different interference free workspace methods classdef InterferenceFreeMethodType enumeration M_MINDISTANCE_CABLE_CABLE end end
%Matriz ya paso por un proceso de verificacion % Matriz es cuadrada % Df function [ respuesta ] = definidaPositiva( matriz ) [n,~] = size(matriz); verificador = 0; for i = 2:n subMatriz = matriz(1:i,1:i); valor = determinante(subMatriz); if(valor <= 0) verificador = 1; break; end en...
%% Data Fitting % Script Solves for coefficients of production equations and plots the equations % on graphs % Calculates time interval Domain for February, 2013 startIndex=find(date=='01-Feb-2013'); endIndex=find(date=='01-Mar-2013')-1; % Values of these vectors will be defined when the main script runs % Alters...
function [League,nEval]=LoserFunction(League,Loser,nEval) global ProblemSettings; global SCASettings; nVar=ProblemSettings.nVar; VarMin=ProblemSettings.VarMin; VarMax=ProblemSettings.VarMax; nMainPlayer=SCASettings.nMainPlayer; nReservePlayer=SCASettings.nReservePlayer; Co...
function R = ApllyOperator(Field,Operator) R = zeros(size(Field)); for i=2:size(Field,1)-1 for j=2:size(Field,2)-1 R(i,j)=sum(sum(Field(i-1:i+1,j-1:j+1).*Operator)); end end endfunction
% Author: Jonathan Sprinkle % Compares bag files from several experiments in gazebo using the same % inputs %% set up the cell arrays % bagfiles = cell(2,1); % ts = cell(2,1); % complexGazeboInputs/hardLeft-lessbounce1 bagfiles{1} = rosbag('2016-05-24-21-19-08.bag'); bagfiles{2} = rosbag('2016-05-25-14-59-18.bag'); ba...
error = zeros(test_ds.n_data,1); for i = 1:test_ds.n_data temp1 = test_ds.data{i}.ann; temp2 = fann(:,:,i); eye1 = mean(temp1(test_ds.comp{3},:)); eye2 = mean(temp1(test_ds.comp{4},:)); eye_dist = mean(sqrt(sum((eye1 - eye2).^2,2))); % eye_dist = mean(sqrt(sum((temp1(125,:) - temp2(145,:)).^2,2))); erro...
%% R-Breaker日内(非高频)交易策略 %{ 第1版 张树德(sdzhang@wind.com.cn) 2013年7月5日 R-Breaker是个经典的具有长生命周期的日内模型,曾14年排名Future Trust杂志年度前10最赚钱的策略。 该策略包含突破与反转二种策略, 主要的思想: 根据前一个交易日的收盘价、最高价和最低价数据通过一定方式计算出六个价位,从大到小依次为: 观察卖出价(Ssetup):昨高+0.35*(昨收-昨低); //ssetup 反转卖出价(Senter):(1.07/2)*(昨高+昨低)-0.07*昨低; //senter 反转买入价(Benter):(1.07/...
% prepare data l1 = 10; % length of first arm l2 = 7; % length of second arm nr_p = 50; theta1 = linspace(0, pi/4, nr_p); % all possible theta1 values theta2 = linspace(0, pi/2, nr_p); % all possible theta2 values [THETA1,THETA2] = meshgrid(theta1,theta2); X = l1 * cos(THETA1) + l2 * cos(THETA1 + THETA2); Y = l1 *...
function x=wt_Lehmer_Mean(A, df) % Function to get weighted lehmar mean wt = df/sum(df); x = sum((A.*A).*wt)/sum(A.*wt); end
% Loading Dataset data = readtable('datasets_rankings.csv'); % Selecting and Converting 2 columns in array 'x' and 'y' x = table2array(data(:,1)); % Column: 1 y = table2array(data(:,5)); % Column: 5 % fit polynomial cftool;
% proc_interp - interpolate artifact or missing data using EEGLAB's % spherical-spline interpolation % % Usage: % >> OUTEEG = proc_interp(INEEG, varargin); % % Inputs: % INEEG - input EEG data structure % 'type' - interpolate just artifact ('artifact'; i.e. EEG.reject.*TYPE*E==1) % ...
clear all; options = optimset('MaxFunEvals', 1000); optymalne = fminsearch(@fzad2, [1.8 3.3 5], options); % parametry obiektu % N = 2; % C = 1000; % d = 3; % B = C*C/(2*N); % alfa = 2*N/(d*d*C); % beta = 1 / d; d = 3; B = 2; alfa = 12; beta = 3; zadana = 5; % wartość zadana Ki = 1; K = optymalne(1); Ti = optyma...
function [Left] = ENO_Interpolation_Stencil(N0, N5, Order, c1) Left = zeros(1, N5-N0+1); Left(N0 ) = 1; Left(N5-Order+1:N5) = N5-Order; for i = N0 + 1 : N5 - Order is = i; for m = 2 : Order if (abs(c1(is-1,m)) < abs...
%% Distortion Resistance %% set(0, 'DefaultFigurePosition', get(0,'screensize')); clc; clear; close all; %% Introduction % % In this exercise we will test how stable is the network. For this % purpose, we will first train the network with some patterns. Next, we % will add some noise to these patterns and test if th...
function c = mycond(A, v) % % function c = mycond(A, v) % % Compute condition number of matrix A, A should be invertible. % Cond(A)_v = norm(A^{-1})_v * norm(A)_v. % % Input - % A: NxN matrix % v: 0 -- L_infinity norm % 1 -- L1 norm % 2 -- L2 norm % % Output - % c: number, condition number of A %% Parameter chec...
% % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % %clean and collect results % clear;clc % location = '/home/hengl/matlab/bin/scripts/ITAFS/results/'; % data = 'penglymp'; % boots = 7; % % bootstrap = []; % % % store the consistencies across different rounds % SPConsistency_mrmr = []; % SPConsistency_jmi = []; %...
load wavelengths.txt; load delays.txt; load FROG.txt; N=256; freq0=flipdim(299.792./wavelengths,2); T0=5.0333; delays_fs0=(delays-T0)*1e6/299.792*2; freq_center=freq0(round(length(freq0)/2)); freq_step=min([(freq_center-min(freq0))/(N/2-1) (max(freq0)-freq_center)/(N/2-1)]); freq_min=freq_center-(N/2-1)*freq...
function[angles_array, power_array, time_array, distance_array] = ... flight_simulation_scenarios(E_model, E_angle_speed, E_rotate, e_total, altitude) angles_array = []; power_array = []; time_array = []; distance_array = []; % open every workspace file for j = 3 : size(di...
function modulatedOffset = modulate_OffsetWindows(norm, snakeCompl,... windows) offset_windows = windows.offset; len = windows.numWindows; slope = snakeCompl.slope; mod...
function [t,varargout] = calc_direct_radiance(layer_dens,los_lens,gasvec,cros,sol,p1,p2,p3,offset,L) % [t,K,K2] = calc_direct_radiance(layer_dens,los_lens,gasvec,cros,sol,p1,p2,p3,offset,L) % km to cm c = 1e5; % parametrized polynomial and solar sepctrum base = L*[p1 p2 p3]' .* sol; % size of the problem [ngas,nlay,...
classdef VolumeOptions < steno3d.core.opts.Options %VOLUMEOPTIONS Options for Steno3D Volume objects % For usage details, see the %%%ref[options help](steno3d.core.opts). % % %%%properties % % See the volume %%%ref[EXAMPLES](steno3d.examples.core.volume) % % %%%seealso steno3d.core.opts, steno3d.core.Volume % ...
function est = get_estimate_from_label_probabilities(W) % GET_ESTIMATE_FROM_LABEL_PROBABILITIES - returns the volumetric estimate of the % true segmentation given the label % probabilities (W - in STAPLE notation) % % est = get_estimate_fro...
function [ output_time ,output_distance ] = process_data( PLAYED, RECEIVED, SampleRate , sound_vel) %_____PERFORMING THE CORRELATION BETWEEN THE RECEIVED SOUND ANDTHE ECHO__ CORRELATED_SOUND = xcorr(RECEIVED, PLAYED); %_______________TRIMMING THE EXTRA DATA AFTER CORRELATION _________ %%since we know that in c...
close all; clear; %dicominfo good = load('lab_bioimaging/imT1.mat'); x1 = good.imT1(:,:,1); x2 = good.imT1(:,:,2); x3 = good.imT1(:,:,3); x4 = good.imT1(:,:,4); x5 = good.imT1(:,:,5); x6 = good.imT1(:,:,6); x7 = good.imT1(:,:,7); x8 = good.imT1(:,:,8); newfit = zeros(size(x1)); t1map = zeros(size(x1)); t1 = [50,100...
function [cm, avg_acc, index]= get_cm(gt,predict_label,FLAG) % Get confision matrix and average accuracy from groundtruth and predict % result. % Written by Xiaojiang Peng,9/2012. Email: xiaojiangp@gmail.com % Input: % gt and predict_label are both column vectors % FLAG=1 is for rate format. % Output: % cm:...
% Intrinsic and Extrinsic Camera Parameters % % This script file can be directly excecuted under Matlab to recover the camera intrinsic and extrinsic parameters. % IMPORTANT: This file contains neither the structure of the calibration objects nor the image coordinates of the calibration points. % All those c...