text
stringlengths
8
6.12M
function [] = check_psd(A) %CHECK_PSD Check if matrix is positive-definite, error otherwise. % % usage % CHECK_PSD(A) % % input % A = matrix % % 2013.01.23 Copyright Ioannis Filippidis % % See also ispsd, chol, inner_product. % depends % ispsd if ispsd(A) return end disp(A) error('The above matrix is not ...
clear; load rate1.mat; load ORL.mat; for t=0:9 k=15; X_trn=cell(40,1); X_tst=cell(360,1); Y_trn=zeros(40,1); Y_tst=zeros(360,1); count1=1; count2=1; for i=1:400 if(rem(i,10)==t) X_trn{count1}=ORL{i}; Y_trn(count1)=ORL_label(i); count1=count1+1; else X_tst{count2}=ORL{i}; ...
% KTO 2018 - GR17019 % AS17006-TICIScores-EMS % 05-06-2018 %% Import data %% AUC %% AT %% MTT %% PD %% TTP %% Export data
function [Y, x, y, z] = plotRealHarmonic(n,m) %PLOTREALHARMONIC - Visialize the real Laplacian spherical harmonic of degree n and order m th = linspace(0,pi,250); % inclination phi = linspace(0,2*pi,250); % azimuth [th,phi] = meshgrid(th,phi); % compute spherical harmonic of degree 3 and order 1 Y = ejovo.saf....
function [filtered] = Filter_position(position) % filter the information and return filtered position data global start global ending data_length = ending - start +1; num_frames = length(position(:,1)); % number of samples in the opto trials optoTime = num_frames/200; % number of seconds opto recorded for (this was ...
function [sigma_vec, C_vec, error_val, op_sigma, op_C] = ... validationCurve(X, y, Xval, yval) %VALIDATIONCURVE Generate the train and validation errors needed to %plot a validation curve that we can use to select lambda % [lambda_vec, error_train, error_val] = ... % VALIDATIONCURVE(X, y, Xval, yval) return...
function [x1, x2, X1, X2, F1] = calculateX1X2(Fm, tf, v0=1, v1=-1) N = Fm*tf; x1=randn(N, 1); [X1, F1] = f_TF(x1, Fm); x2=x1; x2(x2>=0)=v0; x2(x2<0)=v1; [X2, ~] = f_TF(x2, Fm); endfunction
% Compile nusselt numbers for simulations in base_dir (and subdirectories) function compileNuV2(base_dir) if nargin == 0 base_dir = '/home/parkinsonjl/mnt/sharedStorage/TestDiffusiveTimescale/ConvectionDB-cfl0.18/'; end UniformPrefix = 'Uniform-convectionDB-'; AMRPrefix = 'VariableMesh2SubcycleRefluxFreestream0....
% % Author: Vincent Guigues. % % File : crossingnumber % % Purpose : output Crossing_Number is the crossing number for vector % P of size 2 and polygone S with P in the plane containing S. % n is the number of vertices of S. % dmin is the minimal distance between P and the border of...
function [data, labels, codes] = read_data(root, subject, run, ft_root, resamplefs, bpfreq) % [data, labels, codes] = read_data(root, subject, run, ft_root, resamplefs, bpfreq) % Reads the data from [1], preprocesses it, and slices into single-trials. % It also extracts the presented codes' labels and bit-sequences. % ...
%%%spatial prisoner dillemma%%% %pBC.m function ind=pBC(x ,dim) ind=mod(x ,dim ); if ind==0 ind=dim; end
%% Set the range you wish to view on the spectrum analyser freq_range = 5e6; %% Initialise the spectrum analyser Analyser = HP_Spec(); Analyser.initialise(freq_range); %% Plot what we see on the screen while true frame = Analyser.getFrame(); Analyser.plotLastFrame(); end %% Close the communicati...
addpath('./images'); imagefiles = dir('./images/*.jpg'); nfiles = length(imagefiles); defectCorrect = 0; maturityCorrect = 0; for i=1:nfiles fileName = imagefiles(i).name; fLen = length(fileName); if fileName(fLen-6) == 'A' fileName2 = fileName; fileName2(fLen-6) = 'B'; result = si...
% this program will zoom into a mandelbrot at a random(not preset) point % if the zoom point is detected as a boring point, it will find the nearest interesting point based on the gradient field % x is honrizontal; y is vetical; % Chen Shen 2/21/2019 % chenshen@rams.colostate.edu close all; figure; set(gcf,'outerposit...
function [MidDist,SCorr] = VocLocalizer(varargin) % COLLECT PROPERTIES AND PERFORM INITIAL ANALYSIS OF VOCALIZATIONS P = parsePairs(varargin); checkField(P,'Sounds') checkField(P,'SR') checkField(P,'NFFT',1000); checkField(P,'Offset',1); checkField(P,'HighPass',25000); checkField(P,'CorrTime',0.0001); % 0.1 ms check...
%% Visualize clustered data clear variables close all ids = {'9861','10021','12876','14380','15496','15697'}; nbrains = length(ids); fnaddition = 'Selection3D'; for bnr = 1:nbrains %% Load data id = ids{bnr}; load(['MappedGenes' fnaddition id]); datadir = ['/home/mvandegiessen/data/tSNE_ABA/rawData_25Feb2014/normaliz...
% CSC 301 Scientific Computing Fall 2012 % Author: Yeukhon Wong % Homework #1 % Problem P1.5.1 (p.57) % Based on author's solution (TestDerivative.m) close all a = 10; M2=100; err1 = zeros(100,1); err2 = zeros(100,1); % Look at errors across [0,1]. % err1 = error with no derivative information. % err2 = error with...
clc; load("maze.mat"); % initialisation gamma = 0.9; % epsilon = [0.1 0.2 0.3 0.4 0.5]; epsilon = [0.1 0.3 0.5 0.7 0.9]; % epsilon = 0.9; alpha = 0.3; reward = maze; reward(2,4) = 1; q_l_new = zeros(9,7,4); q_l_old = zeros(9,7,4); ite_count = 0; ini_row = 8; ini_col = 6; q_l_next = zeros(1,1,4); steps = zeros(1,100); ...
function [S]=spahtml(N) %these function generate html space(&nbsp;) by number of N spa={}; for i=1:N spa{i}='&nbsp;'; end S=strcat(spa{:});
function remove_nc(fname,vname) % remove_nc(fname,vname) % Remove a variable from a NetCDF archive file. The file is assumed to be in % the current working directory unless a pathname is added to the beginning of fname. % Only data variables can be deleted, not the info metadata structure. % % Inputs: % ...
function sOut = xBulkDelay(sIn, numInputs, delay_arr, name) if(~isInt([numInputs, delay_arr])) throwError('the number of inputs and delay array must both be integers.'); end if(numInputs<1) strError = strcat('the number of inputs and delay array must both be integers; numInputs = ',num2str(numInputs)); th...
function varargout = HiggsBosonIdentification(varargin) % HIGGSBOSONIDENTIFICATION MATLAB code for HiggsBosonIdentification.fig % HIGGSBOSONIDENTIFICATION, by itself, creates a new HIGGSBOSONIDENTIFICATION or raises the existing % singleton*. % % H = HIGGSBOSONIDENTIFICATION returns the handle to a new H...
% This function is a modified function from Dynamo dvcopy. It copies only Numerical parameters from iteration round 1 and 2. % If one nedds to copy other rounds just add to the "parametersToExport" . % Add this file to matlab path or to dynamo folder:dynamo/matlab/src/. % Example: dvcopy_numerical('ali_project1','al...
function [error] = check_posterior1family(family, posterior, markers) error = 0; if( isempty(family) ) error = 1; return; end pairs = family.pairs; if( isempty(pairs) ) if( ~isempty(posterior) ) error = 1; return; else return; end end [num, cols] = size(pairs); if( num ...
function priolist = textscan2struct_cfg_priolist (cfg_priolist) % ====================================================================== % Syntax: priolist = textscan2struct_cfg_priolist (cfg_priolist) % Description: Converts the configs cfg_priolist from a .csv textscan to the struct-array priolist % ========...
%% track two tone drift data_twoToneDrift = {}; for ii = 1:100 ii fsw.reset(); data_twoToneDrift{ii} = fsw.scan(); pause(10); end %% save(sprintf('./tests/tests_twoToneDrift%s.mat', gds), 'data_twoToneDrift'); %% figure; for ii = 1:100 ii data = data_twoToneDrift{ii}...
clc;clear;clf; figure('name', 'booth and lanes'); min_acc=1; m_xt=0; m_xt1=0; xindex=1; xtarr=zeros(1,11); for xt=-65:1:-55 for xt1=-65:1:-65 % xt=-65; % 65 seems to be pretty good % xt1=-65; intervals=0.2; % the intervals betweeen every frame min_d=25; % minimium distance between two cars A...
% stats = GetStats(myobj) % % Get stats command. Retrieves a collection of various % statistics and other general information. Note that some % of the information returned here is obtainable via % separate calls as well (the time via Get...
function varargout = GUI(varargin) % GUI MATLAB code for GUI.fig % GUI, by itself, creates a new GUI or raises the existing % singleton*. % % H = GUI returns the handle to a new GUI or the handle to % the existing singleton*. % % GUI('CALLBACK',hObject,eventData,handles,...) calls the local % ...
function X = load_nc(fname,vname) % load_nc % or % load_nc(fname) % or % X=load_nc(fname) % or % X=load_nc(fname,vname) % % Load variables from a NetCDF archive file. The file is assumed to be in % the current working directory unless a pathname is added to the beginning % of fname. If fn...
function [ T, N ] = gillespie_choice(rates) % set the time delay T, and the index N of the next reaction % according to Gillespie's procedure. % The input is a vector of reaction rates. % % Two random numbers are used. % F. Nedelec, 2012 S = sum(rates); T = -log(rand) / S; N = 1; X = rand * S - rates...
function partial_derivative = regularized_multitask_derivative(x,y,w,avg_w) T = length(x); [~,m] = size(x{1}); partial_derivative_1 = zeros(T,m); partial_derivative_2 = zeros(T,m); partial_derivative_3 = zeros(T,m); %find gradient %find partial derivative for first part with respect to task i ...
clc; clear all; close all; %% % Load the original image im = im2double(imread('lenna_gray.jpg')); sz = min(size(im)); % Subsample the image with rectangular grid and interpolate to grid locations N = 400; [gridX, gridY] = generate_rect_grid(sz, N); [im_small_linear, im_small_cubic] = interp_im_rect_grid(im...
function [nb,nst,ix] = delp2(b,st) % the function used for removing a predictor when its norm of corresponding % coefficient is small enough. The tolerance level is set as 1e-3. The parameter st is to monitor the status of % predictors. global M; global N; tol=1e-4; p=length(st); t = 0; s = 0; nst=st; ix=0; for ...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Created: 04-Apr-2014 16:53:06 % Computer: GLNX86 % Matlab: 7.9 % Author: NK %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % needs one 3D salt and temperature file each.open IN % integrates over depth to calculate % -Brunt Väisälä frequency % -Rossby Radius % -Rossby wave first baroclinic ...
function px_spm_spm_ui % Setting up the general linear model % FORMAT spm_spm_ui %____________________________________________________________________________ % % spm_spm_ui configures the design matrix, data specification and % thresholds that specify the ensuing statistical analysis. These % arguments are pass...
function var = getBigQPC1Var(varname) % Purpose: obtain the variables on the space-time index exceeding Q % big PC1 threshold (> 5K/day). run /nethome/gchen/scripts/matlab/startup.m Case.dir = '/projects/rsmas/kirtman/gchen/cesm_spcam/archive/spcam_actual_m2005_f09f09_branch/atm/rest/'; Caserh0.dir = Case.dir; ...
function err = checkScanImageNumber(totalNumScans, totalNumRegions, totalNumColors, param) %Check to make sure that every scan has the same number of images in it for nS=1:totalNumScans for nR = 1:totalNumRegions for nC = 1:totalNumColors dirName = [param.directoryName filesep ...
function [ output ] = cdnCPull( echoQueryNum, queryVector) [queryNum, ~] = size(queryVector); echoNum = floor( queryNum / echoQueryNum ); trafficSum = 0; trafficSumCrossDevice = 0; trafficSumToEdge = 0; trafficSumCrossEdge = 0; trafficSumToCDN = 0; for i = 1 : echoNum i for j = 1 : echoQueryNum % 生成每个请求进行处理 ...
function [distance] = compute_signed_distance(p, q, s, insideness) distance = norm(p - q); if norm(p - s) - norm(q - s) > 10e-7 || abs(norm(p - s) - norm(q - s)) < 10e-10 if ~isempty(insideness) && insideness == true distance = -distance; end return else distance = -distance; end
function result1=rhs1(x) result1=1-x; end
% script to plot global lake area estimates as bar chart y=[2.803 3.2 4.46 3.8 3 5 4.95 ] str={ 'Maybeck 1995' 'Lehner and Doll 2004' 'Downing et al. 2006' 'Downing et al. 2012' 'MacDonald et al. 2012' 'Raymond et al. 2013' 'Verpoorter et al 2014' 'Holgerson and Raymond 2016' 'Allen and Pavelsky...
% Author: Ming Ruan % Data: June 18 % Discription: % Convert raw data to pcd file. Refer to the wiki page to find the exact % format of the raw output from different sensors. % (Current version only tested for swissranger) clear % clear variables in current workspace % Change the file name accordingly path = '../da...
clear all global L ALF BET TAU RO V0 B0 LAMB0 Tetta Mp Qp R_E Lx Ly Lz Bound_parm EVD kx ky kz w; % light_spead=299792458;% АТАТА!!!! R_E=6378.1*10^3;% RE - м (метр) EVD=1.602176565*10^-19; %эВ - дж Qp=1.602176565*(10^-19); %Q - Кл Mp=1.672621777*(10^-27) ; % M -Кг Tetta=1 %Коэффициент массы, масса измеряетс...
function Main_DLT_MarkVII % Final code %% p = [px, py, sx, sy, theta]; The location of the target in the first % frame. % px and py are th coordinates of the centre of the box % sx and sy are the size of the box in the x (width) and y (height) % dimensions, before rotation % theta is the rotation angle of the box %...
function tracklets = readLabels(label_dir,seq_idx) % parse input file labelfile = fullfile(label_dir, sprintf('%04d.txt', seq_idx)); % count columns fid = fopen(labelfile); l=strtrim(fgetl(fid)); ncols = numel(strfind(l,' '))+1; fclose(fid); fid = fopen(labelfile); try if ncols == 17 % ground truth file C = tex...
% activate Activate data points % % This method activates data points. Only data clouds from active points % are used during fit analysis. % >> object=activate(object,index); % Data points are referenced in the order they were added. % % See also CloudFitXY, deactivate, summarize % % % created October 17, 2014 b...
%% Example 3.3, Symbolic direct geometric model % of the Staubli RX-90 robot % Using function T0n = SymDGM(sigma,a,d,t,r,q) clear;clc; global T01 T12 T23 T34 T45 T56 syms t1 t2 t3 t4 t5 t6 d3 r4 sigma = [0 0 0 0 0 0]; a = [0 pi/2 0 -pi/2 pi/2 -pi/2]; d = [0 0 d3 0 0 0]; t = [t1 t2 t3 t4 t5 t6]; q=t; r = [0 0 0 r4 0 0...
function T34=T34(h) T34=9.92e-4*h+196.56
function[T,S]=deconvolution(uz1,uz2) % DECONVOLUTION OF TWO DISCRETE TIME SIGNALS IN FREQUENCY DOMAIN % % Deconvolution of two signals is defined in the frequency domain as % % S(w,z) = u(z1,w)/u(z2,w) % % where u(z1,w) and u(z2,w) are the Fourier spectra of the signal % recorded ...
function m = MAD(x) m = median( abs ( x - median(x) ) ) ./ .6745; % % Part of WaveLab Version 802 % Built Sunday, October 3, 1999 8:52:27 AM % This is Copyrighted Material % For Copying permissions see COPYING.m % Comments? e-mail wavelab@stat.stanford.edu %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % 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; clc; n=4; d=8; cap_olasilik=0.90; mut_olasilik=0.05; [populasyon]=populasyon_olustur(n,d) f_degeri=uygunluk(populasyon) for iter=1:100 f_degeri=uygunluk(populasyon); idx=find(f_degeri==0); if length(idx)~=0 break; else sec_pop=dogal_secilim(populasyon,f_degeri...
clear all; close all; clc %% GENERATE STIMULI VIDEO %% PARAMETERS % Duration of variables in seconds & working path (configurable parameters) lenStimuli = 10; %(sec) lenPause = 10; %(sec) workingDir = 'C:\Users\natad\Documents\SMC\MasterThesis\Stimuli\STIMULI_VIDEO'; videoFlag = 2; % 1 for first video, 2 fo...
function[seqtailbin, tail]=ExtractTail(frame, Bkgsm, tailthresh, Xtail1, Ytail1, Xtail2, Ytail2) seqtail=frame(Ytail1:Ytail2, Xtail1:Xtail2); % frame around the tail seqtailnorm=(1-double(seqtail)./Bkgsm); %normalized to background seqtailbin=im2bw(seqtailnorm, tailthresh); %binarized tail=imresize(seqtailbin, 0....
close all; clear all; clc; myimg=imread('peppers.png', 'PNG'); size(myimg) nbcl=512; mcol=[0:nbcl-1]'/(nbcl-1); mypal=zeros(nbcl,3,3); mypal(:,1,1)=mcol; mypal(:,2,2)=mcol; mypal(: ,3,3)=mcol; for k=1:3 figure(k), imagesc(myimg(:,:,k)) colormap(mypal(:,:,k)); axis('image') end
clc; close all; clear; load hospital; subplot(1,3,1) boxplot(hospital.Age) title("Wiek") subplot(1,3,2) boxplot(hospital.Weight) title("Waga") subplot(1,3,3) boxplot(hospital.BloodPressure(:,1)) title("Górne ciśnienie")
function [assignStore,assignCustomers,fval] = StoreLocationAssignment(commX,commY,commSize,congest,timeScale,k,l,w) %StoreLocationAssignment : Given Community locations and sizes, determines % optimal location of stores storeX = l * rand(k,1); storeY = w * rand(k,1); initAssignment = [storeX;storeY]; ...
% 2d grid simulation using izhikevich simple model neuron network % eric zilli - 20110922 - v1.01 % % Zilli and Hasselmo (2010) gave an implementation of an oscillatory % interference model using more realistic neural models than the % thresholded sinusoidal oscillators used as VCOs in previous treatments. % % This is...
function [v_e xm]=gurobi_exact_game(clv,tol); % GUROBI_EXACT_GAME computes the exact game from game v using gurobimex. % % GUROPI-SOLVER: http://www.gurobi.com % % Usage: [v_e xm status]=clv.gurobi_exact_game(tol); % % Define variables: % output: % v_e -- The exact game from v. % xm -- The matrix of op...
function idtplot(instruccion) % _______________________________________________________ % % With this routine you can get the different % intensity - duration - frecuency curves, using the Gumbel's % method. % Equations used in this routine: % 1 - 1 / T = exp( -exp ( - ( i + a ) / c) ) % % Where: c = ( sq...
function cc_beamviewer % CC_BEAMVIEWER - "Compiles" the beamviewer application to run standalone % Starting directory DirStart = pwd; gotocompile('Gun'); % Compile application cc_standalone('beamviewer'); cd(DirStart);
function [rcor,inCOD,qs]=atQuadRDTdispersioncorrection(... rerr,... r0,... indBPM,... indQCor,... inCOD,... neigSteerer,... correctflags,... scalefactor,... wdisp,... ModelRM,... steererlimit,... printouttext) %ATQUADRDTDISPERSIONCORRECTION - Make dispersion correction ba...
% Applies the homography defined by H on the image I. % % Takes the center of the image as the origin, not the top left corner. % Also, the coordinate system is row/ column format, so H must be also. % % The bounding box of the image is set by the BBOX argument, a string that % can be 'loose' (default) or 'crop'. When ...
function dir_list = listDirectories( time_dir ) %LISTDIRECTORIES Returns a list with the position directories located %inside the directory time_dir % LISTDIRECTORIES( time_dir ) Returns a list with the directories inside % time_dir that start with xy. This correspond to the directories that % SuperSegger create...
classdef Rb87properties < atomproperties %RB87PROPERTIES Defines properties related to Rb87 atoms properties(Constant) mass = scattconst.amu*86.909180527; %[kg] nspin = 1.5; Ahfs = 3417.34130545215; %[MHz] gI = -0.0009951414; gS = 2.00233113; end ...
function [] = Test() % This script is intended to collect data and display it in real time. %% Clear existing workspace clear all; close all; clc; %% Initialize the scope (line by line) prompt = 'Do you want to initialize the scope? Y/N [Y]: '; wantToInitializeScope = upper(input(prompt,'s')) == 'Y'; while ~wantTo...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Autor: Prof. Alexandre Zaghetto % % E-mail: zaghetto@image.unb.br % % Disciplina: Sinais e Sistemas % % Departamento: Ciência da Computação % % Universiade de Brasília % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% clear all close all clc %%%%%%%...
w = 3.5; for dofig = 1:4 if dofig == 1 clf b = 0.25; y0 = .20; ics = [-.12 y0 4; -0.09 y0 5; -0.06 y0 3; -.03 y0 5; 0.0 y0 5 ]'; LinearizationFPExample(b,ics) hold on ics = [.12 -y0 4; 0.09 -y0 4; 0.067 -y0 3; .04 -y0 4; 0.01 -y0 4]'; LinearizationFPExample(b,ics) text(-.2,.1,'\be...
function [f, df] = jacobian_ik_sphere(p, c1, r1, variables) D = length(p); for v = 1:length(variables) variable = variables{v}; switch variable case 'c1' dc1 = eye(D, D); dr1 = zeros(1, D); dp = zeros(D, D); end [m, dm] = difference_derivative(p, dp, c1...
clear; close all; file_name = './data/test_2semg_12345.txt'; semg_channel = 1:2; semg_channel_count = 2; force_channel = 3; semg_max_value = 2048; semg_min_value = -2048; force_max_value = 5; semg_sample_rate = 5100; % Approximate target_sample_rate = 300; train_output_filename = './data/output/exp_ard_DS300_FORCE_S...
function [ output_args ] = loadWeights( file ) %loadWeights Grabs user generated weights % File: location of xlsx wrkst with the weight info % W: weight with each cell being a different combining step end
function varargout = recursive(file,fun,varargin) if nargin == 1 fun = @(arg) arg; end opt = iptcheck(varargin); if ~exist(file,'file') if opt.Verbose warning('MATLAB:recursive:FileNotFound',... 'File not found: %s.',file); ...
function [featData, labels, erpWin, options] = noahSPROJ_extractFeatures(loadFname, varargin) %#ok<*STOUT> % extractFeatures: a function for extracting features from EEG data % recorded in the file loadFname, with optional input parameters. Note that % this is intended to be called from preprocPipeline.m % % Inputs: % ...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Copyright 2010 - 2015 Moon Express, Inc. % All Rights Reserved. % % PROPRIETARY DATA NOTICE: % The data herein include Proprietary Data and are restricted under the % Data Rights provisions of Lunar CATALYST Space Act Agreement % No. SAAM ID#...
function error_calc(imgFileName, max_val) io = hdr_io; % Variable(s) Initialization main_dir = 'C:\Users\Mika\Documents\Dropbox\ENEL 519.02\'; img_dir = [main_dir, 'HDR Images\']; final_dir = [main_dir, 'HDR_Converter\']; hdr_ref_str = [img_dir, imgFileName, '.hdr']; hdr_gen_str =...
function err = naivePerfusionSSEIntegratorP2X4Inact2(ton,toff,Ttot,amp,T,I) %#codgen; naive=getNaiveP2X4Inact2(); V=-60*10^-3; err=errorIntegratorP2X4Inact2(ton,toff,Ttot,amp,naive,T,I,V); end
%% HomeWork #1_3_b % Rectangle Wave using step function weighted sum % Include labels and title for each plot. clear all t = -10:10; u1 = heaviside(t+5); u2 = heaviside(t+3); u3 = heaviside(t-2); u4 = heaviside(t-4); u = u1+u2-u3-u4; stem(t,u) xlabel("n") ylabel("x[n]") title(["HomeWork #1_3_b Rectangl...
function [TrainingSet GroupTrain TestSet]=featinp(mAR) TrainingSet=[2652;4210;4372;6356;8283;22457;29716]; TestSet=[mAR]; GroupTrain=[1;2;3;4;5;6;7]; end
function [lr_clustercenter,C] = cluster(lr_features,hr_features,K) inv_lr_features = lr_features'; [N1,P1] = size(inv_lr_features); num_iteration = 400; num_cluster = K; opts = statset('Display','iter','MaxIter',num_iteration,'UseParallel',1); [IDX, lr_C] = kmeans(inv_lr_features,num_cluster,'options',opts); lr_cluster...
function J=Jacobian(theta1,theta2) h = 0.1; w1 = [0;0;1]; q1 = [0;0;0]; v1 = [0;0;0]; zeta1 = [v1;w1]; w2 = [1;0;0]; q2 = [0;0;h]; v2 = [0;h;0]; zeta2 = [v2;w2]; zeta2_p = [h*sin(theta1);-h*cos(theta1);0;-cos(theta1);-sin(theta1);0]; v3 = [0;1;0]; w3 = [0;0;0]; zeta3 = [v3;w3]; zeta3_p = [-sin(theta1)*cos(theta2)...
function J = jacobian(func, x0) % Numerical jacobian, optionally used in MixedLogitDemand % From: http://fabcol.free.fr/pdf/lectnotes4.pdf % [df]=numgrad(func,x0,method,param) % x0 = x0(:); f = feval(func,x0); m = length(x0); n = length(f); J = zeros(n,m); dev = diag(.0...
function [psi_err,omega_err] = compute_cam_error(P) % Compare camera rotations % % © Copyright Phil Tresadern, University of Oxford, 2006 % this is the true rotation matrix between camera 1 and 2 % (I defined it this way when generating synthetic examples) Ptrue = getRx(20*pi/180) * getRy(210*pi/180); v = logm(Ptrue...
% point dipole vasp defect + ZPE % last edit 3 Mar 2016 function status = dip222(Mu,coord,Rmax,filename1,filename2,Rz,N,lim,gpu,log) pathname = pwd; if log == 1; clc; tic; jam = now; fprintf(' ============================================ \n') fprintf(' Dipole Fields Calculation \n') fprintf(' ...
function [ dspeeddq ] = compute_H_dwavespeed_dql(ql,qr,quadpoint,data) % Evaluates the data.numerical flux for the given problem % written by data.Pierson Guthrey % ------------------------------------------------- % INdata.PUTS ql % qr % OUTdata.PUTS Glux % Note: other variables may be %loaded in from t...
% remove Remove measurements % % This method removes measurements from a CurveFit2D object. Measurements % are refennced by numeric index based on the order they were added. % object=remove(object,index); % Single and multiple index values may be specified. To remove all % measurements: % object=remove(object,'...
function [p, r, AUC] = pr_curve(score, gt) % AUTHOR: Son La % STUDENT NUMBER: y107227 % This function returns two arrays containing precision and recall at % different threshold values % INPUT: % score: Nx1 array containing classification scores % gt: Nx1 array of groundtruth % OUTPUT: % p: array containing pr...
function fluidjacob = importFluidData(workbookFile, sheetName, startRow, endRow) %IMPORTFILE1 Import data from a spreadsheet % FLUIDJACOB = IMPORTFILE1(FILE) reads data from the first worksheet in % the Microsoft Excel spreadsheet file named FILE. Returns the data as % a table. % % FLUIDJACOB = IMPORTFILE1(FILE, S...
%% PP3 nb_participants = 1; raw_eeg_data = dir('*.vhdr'); for i = 1:nb_participants subject_code = raw_eeg_data(i).name EEG = pop_loadbv('R:\\Neuro\\Rech_PMBernier\\EtudeEEG-IRM\\Felix\\Laphroaig\\EEG_DATA', subject_code, [], [1:64]); EEG=pop_chanedit(EEG, 'lookup','C:\\Program Files\\MATLAB\\R201...
%% Rayleigh scattering --Spherical particle clear; clc; f=5.0; % Frequency(GHz); fq=f*1e9; eo=single(8.854e-12); % permitivity of free space muo=single(pi*4e-7); % permeability of free space w=single(2*pi*fq); % radial frequency c0=300e6; % speed of light in free space lambda0=c0/fq; % wave ...
time = 0:0.001:20; [x,approx_x,a_hat,b_hat,Lyapunov] = appendix; [~,~,a_h,b_h] = appendix_non; [~,~,a_h_ex,b_h_ex] = exercise1; global epsilon; figure('Name','Restrictions','NumberTitle','off') line([-2 0], [2 2],'Color','red'); text(-1,2.05,'$$ g_3(\hat{\theta_2}) = 0 $$','Interpreter','latex','FontSize',15) hold on l...
classdef HEVertex < matlab.mixin.Copyable properties mesh ind end methods function obj = HEVertex(mesh, ind) obj.mesh = mesh; obj.ind = ind; end function ret = halfedge(obj) ret = HEHalfedge(obj.mesh, obj.mesh.v_he(obj...
function [ J ] = phit(params) % Derivada parcial de \Phi_t omega=params.omega; J(1,1)=0; J(1,2)=0; J(1,3)=0; J(1,4)=-omega; end
% Evan Pezent | evanpezent.com | epezent@rice.edu % 04/10/2018 function [Tau,L,K,U] = dynamics_lagrangian(k,u,Q,Qd,Qdd) % ========================================================================= % Computes the dynamic equations of motion for a robotic manipulator using % the Lagrangian formulation. % % k = array o...
function test_suite = test_centroid %TESTCLIPLINE One-line description here, please. % output = testCentroid(input) % % Example % testCentroid % % See also % % % ------ % Author: David Legland % e-mail: david.legland@grignon.inra.fr % Created: 2009-04-22, using Matlab 7.7.0.471 (R2008b) % Copy...
function du = uspheq1(x, u, la, kb, kk0) % uspheq1() calculates the righthand side of ode equation for the u-function, which is r(x) * phi_beta(x), % with phi_beta(x) the ultra-spherical function, see equation (36) of Zaldarriaga & Seljak. % x is the independent variable and u = [du/dx; u] is the u-function and its...
function writeSupercubes(inParam, bbox, magsToWrite, outParam, isSeg) % Write subsampled data, it is assumed root points to magnification one % power of 2 less than the first mag to write & all magnifications % increase by a power of 2 % % Written by % Manuel Berning <manuel.berning@brain.mpg....
function energyImage = OPTIONAL12_energy_image(im,xleft,xright,yup, ydown) %im=imread('inputSeamCarvingPrague.jpg'); Pic=rgb2gray(im); My=fspecial('sobel'); Mx=My.'; outimy=imfilter(double(Pic),My); outimx=imfilter(double(Pic),Mx); energyImage=(outimy.^2+outimx.^2).^(0.5); for i= ydown : yup for j= x...
fclose('all'); close all clear clc lightPath = '\\root\programs\Light-and-Health\IAI_CircadianMonitoringAndRegulation\CMR2-Exp1-Data\300-43DF\43DF_2017_01_11_10_06_04_archive\lightReading.csv'; % lightPath = '\\root\programs\Light-and-Health\IAI_CircadianMonitoringAndRegulation\CMR2-Exp1-Data\301-A4D7\A4D7_2017_01_04_...
% qm2DB.m % QUANTUM MECHANICS % Finite Difference Time Development Method % [2D] Schrodinger Equation % Propagation of a [2D] Gausssian Pulse % Arbitrary units are used % Pree propgation / Potential Hill / Potential Cliff % Single Slit / Double Slit % The variable flagU (1,2,3,4,5) is used to change the ...