text
stringlengths
8
6.12M
function [t,l,h,w] = findMouth(mask) %find mouth but not efficient enough %I just find the biggest non-skin color region % if some light or shadow on the face %and the mouth is small %it will not work %cbcr = rgb2ycbcr(mask); %cbcr3 = cbcr(:, :, 3); %init output t = 1; l = 1; [h, w] = size(mask); %figure, imshow(...
%%% epsilon-differential Private Rasch Model % Authors: % MSc Student Teresa Anna Steiner (s170063@student.dtu.dk) % MSc Student David Enslev Nyrnberg (s123997@student.dtu.dk) % Professor Lars Kai Hansen (lkai@dtu.dk) % Input: % Dichomotous data matrix of 0's and 1's % Output: % initialize result array EX4.corrMatr...
indir = '/gpfs/milgram/project/turk-browne/projects/StatLearning_iEEG/data/Session_DR_Jan2019/'; infile_cell={'X~ X_f6b972ef-16e8-469b-ae43-aa668f3a259e.EDF',... 'X~ X_33d47426-1eb9-4a7f-92ae-20735fb70539.EDF',... 'X~ X_bab56b7b-3860-4c68-b190-f11a259c3229.EDF'... }; outdir = '/gpfs/milgram/project/turk-browne/proje...
% EJERCICIOS RESUELTOS DE VISIÓN POR COMPUTADOR % Autores: Gonzalo Pajares y Jesús Manuel de la Cruz % Copyright RA-MA, 2007 % Ejercicio 1.11: Representación de imágenes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % 1.6.4 Operaciones sobre el contenido de las imágenes %%%%%%%%%%%...
%% This script will calculate 9 measures for all files in the folder: filepathName % All files fcn*.m contain Matlab functions used in calculating measures. %This will suppress Matlab warnings warning('off','all') %% Add path to use EEGLAB Matlab functions; Change path to your local copy of EEGLab addpath(genp...
function y = polynom(x) y = (93.*x) - ((((x.^2)+x+0.03)./(x+1)).^8)-6.*x.*(exp(-x)); end
function [t, sampleRate, varargout] = load_xsg_trace(cellnum,code,tracenum,chans) % % % % t: time in minutes from 1-Jan-0000 reference (datenum(datevec(timeOfTrigger))*60*24). % varargout: voltage values from the channels specified in 'chans'. % % 12/07, DHO % if tracenum < 10 filler = '000'; elseif tracenum <100 ...
function c = consumption(v) % CONSUMPTION Returns consumption for specified speed. isValidRange = (v >= 2) & (v <= 200); if all(isValidRange) == false error('Error. \nVelocity must be between 2 - 200'); end consumptionData = load('roadster.mat'); s = spline(consumptionData.speed_kmph, consum...
%% Personal details % Name : Nischith % Roll number : CS18B102 clear all %% Q1 s1 = sin(0:0.1:pi)*3 + 40; s2 = sin(0:0.1:pi)*3 + 60; s3 = sin(0:0.1:pi)*6 + 40; s4 = sin(0:0.1:pi)*6 + 60; sparsity1 = makeSparsity(s1); sparsity2 = makeSparsity(s2); sparsity3 = makeSparsity(s3); sparsity4 = makeSparsity(s4); % When offse...
classdef TestValidStartState < matlab.unittest.TestCase % TestValidStartState unit testing for validStartState. properties end methods (Test) % ub is a 3x1 vector from the center-of-mass of the bob to the revolute % joint location and expressed in the bob frame. ...
function [highRMSElectrodes, goodPos, Fs, stPos, blPos, mt, folderLFP, timeVals, stimPeriod, baselinePeriod, folderSourceString] = getSubjectDetails(subjectName, expType, stimType) %#ok<STOUT> subjectID = [subjectName expType]; if strcmp(subjectID,'alpaColor') subjectName = 'alpa';expDate = '301215'; p...
function spikeplotter = Show_Spikes(Spikes) [h,w,d] = size(Spikes); spikeplotter = zeros(h,w,d); for i = 1:d for j = 1:h for k = 1:w if Spikes(j,k,i) == 1 spikeplotter(j,k,i) = Spikes(j,k,i)+j; else spikeplotter(j,k,i) = Spikes(j,k,i)-10; ...
%{ _______________________________________________________ ##################################################### SIMULACION PROYECTO DE GRADO CASOS COVID-19 EMPLEANDO METODO DMD _____________________________________________________ ##############...
function [current_phase,current_condition,current_accuracy,... current_latency]=EEG_ExtractBehav(EEG,Phase,Condition) switch task_Name case {'4POP'} numCond=2; case {'WM'} numCond=3; end for n = 1:length(EEG.urevent) current_phase(n)=get_phase(EEG.urevent(n).type, Phase); current_con...
function [kOut,color] = GrayROIs2FSmesh(subjid,hemi,ROIname,forcePlot) % Convert mrVista Gray ROI to Freesurfer mesh indices. % % USAGE: kFS = GrayROIs2FSmesh(subjid,hemi,ROIname) % % where: subjid = SKERI subject ID string, no '_fs4' tail % hemi = 'lh' or 'rh' % ROIname = base ROI...
function [lambda,cut_point_tot,hist_cut] = dendrogram_cut(bel,prox_mat,fighandle) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % FUNCTION % [lambda,cut_point_tot,hist_cut] = dendrogram_cut(bel,prox_mat) % This function applies the procedure discussed in the book for % determining the clu...
function ang = pix2angle(pix, dist, width, resolution) %angle = pix2angle(display,pix) % %converts monitor pixels into degrees of visual angle. % %Inputs: %display.dist (distance from screen (cm)) %display.width (width of screen (cm)) %display.resolution (number of pixels of display in horizontal direction) %ang (visu...
function stimulus = makeRetinotopyStimulus_bars(params) % makeRetinotopyStimulus - make various retinotopy stimuli % % stimulus = makeRetinotopyStimulus_bars(params) % % Matlab code to generate various retinotopy stimuli % Generates one full cycle, as well as the sequence for the entire scan. % % 99.09.15 RFD: I fixed ...
%script9_9.m total=0; for n=1:100 total=total+1/(n^2+1); end total
function thresholds=f_set_thresholds(min_value,max_value,delta_value, varargin) if(nargin==4) switch varargin{1} case 'log10' thresholds=10.^transpose(min_value:delta_value:max_value); otherwise thresholds=transpose(min_value:delta_value:max_value); warning('Set ...
%%% load parameter load 'temp.mat'; dataPathAir = 'E:\Data\NasaFlame\June_18_Study\KrCalibration_BeamHardening_60kV20ma\Air_CT_60kV_20ma\'; dataPath = 'E:\Data\NasaFlame\June_18_Study\KrCalibration_BeamHardening_60kV20ma\Ballloon_CT_100PercentKr_60kV_20ma\'; geom = loadProjectionGeometryCT( p ); spectrum = loadSpe...
function ShowCondEst() % function ShowCondEst() % Illustrates the condition estimation idea. % GVL4: Section 3.5.4. % The dimension of the matrix... n = 100; % Test examples generated via gallery('randsvd') % Type "help private/randsvd" for more information. mode = 3; clc disp('inf-norm condition Est...
clc; clear all; close all sj=xlsread('E:\数学建模\建模论文\2017CUMCM\B\附件二:会员信息数据2.xlsx',1,'B2:D1060'); % li=sj(:,3) % temp=[max(li);min(li)]; % deno=temp(1,:)-temp(2,:); % [m,n]=size(li); % sj3=zeros(m,n); % while(m) % sj3(m,:)=(li(m,:)-temp(2,:))./deno; % m=m-1; % end % % sj(:,3)=sj3; % [x]=sj(:,1); % [y]=sj(:,2); % ...
function [hzc,icl3]=coarsening_icl(dx,dy,dz,params) % [[hzc,icl3]=coarsening_icldx,dy,dz,params) % in: % dx,dy mesh spacings, scalars % dz vertical element sizes, vector % params structure % out: % hzc horizontal coarsening factors in directions 1 and 2 % icl3 coarse indices...
function [pie,A,B,data,states,features] = training_elog(data) %path_to_dat = 'data\ADL-1.csv'; %data = load(path_to_dat); %data2 = load(path_to_dat2); % data = [data; data2]; [timestamps,features] = size(data) ; features = features-1; states = 6; labels = [0 101 102 103 104 105]; noObse...
%% rtanx_task_instructions_test % This tests if the participant was paying attention to how much they earn % for each correct prediction. %% Test testtxt1 = ['How much are you rewarded for \n\n'... 'getting a prediction right? \n\n'... ' \n\n'... '(1) 1 p (2) 0 p (3) 5 p (4) 2 p \n\n'......
%% % UWHL MISSION PROFILE % We assume constant acceleration and deceleration, this gives us the following profile. % Conversion factors to SI Units Miles2Metres = 1609.344; mph2ms = 1609.344/3600; % Constants: 4.5 miles to accelerate, Vm set to 1000 miles per hourl % Distance in metres (5000 ft track length ~ 0.9469...
classdef tseries < irisinp.generic properties ReportName = 'Time Series'; Value = NaN; Omitted = @error; ValidFn = @istseries; end end
function transformLabel(year, imgset) if nargin < 1 year = '2014'; imgset = 'Main/train_test_coco_clean'; %error(['usage: year, imgset: 2007, train ']); end rootPath = ['./COCOclean/Labels/'] if ~exist(rootPath, 'dir') mkdir(rootPath) end addpath([cd '/VOCcode']); VOCinit; classToId = containers.Map(VOCopts.cla...
{{Yu[i1, i2], ((-17*g1^2)/20 - (9*g2^2)/4 - 8*g3^2 + 3*trace[Yd, Adj[Yd]] + trace[Ye, Adj[Ye]] + 3*trace[Yu, Adj[Yu]])*Yu[i1, i2] - (3*(MatMul[Yu, Adj[Yd], Yd][i1, i2] - MatMul[Yu, Adj[Yu], Yu][i1, i2]))/2, ((1187*g1^4 - 270*g1^2*g2^2 - 3450*g2^4 + 760*g1^2*g3^2 + 5400*g2^2*g3^2 - 64800*g3^4 + 900*\...
function A = SteadyConvectionCoeffMatrix(mesh) % set up symmetric matrix A = zeros(mesh.nNode, mesh.nNode); g = zeros(size(mesh.x)); % Build matrix -- one column at a time for i = 1:mesh.nNode g(i) = 1; Avec = SteadyConvectionRHS(mesh, g); A(:, i) = Avec(:); g(i) = 0; end% for end% func
function [dFF_suite2p, Mask_rois, centroid] = Load_Fall_suite2p(varargin) % suitsp で出力した Fall.mat から % F: ROI fluorescence % Fneu: Neuropil fluorescence % iscell: ROI is cell or not (1/0) % stat: other inof. like ROI position switch nargin case 0 [F, Fneu, iscell, stat] = load_Fall; imgsz = 320; ...
function [A,B,Na_new,Nb_new]=Unimolecular_Reaction_Forward(A,B,Na,Pf) r1=rand(1,Na); dtemp=(r1<Pf); if sum(dtemp)>0 Btemp=A(dtemp,:); % n=size(Dtemp,1); % Btemp=zeros(n,3); % parfor i=1:n % Btemp(1:n,:)=Dtemp(1:n,:); % end B=[B;Btemp]; A(dtemp,:...
function result = Standard(filename) X = load([strtrim(filename),'.txt']); C_Label = load([strtrim(filename),'_label.txt']); K = length(unique(C_Label)); % Number of clusters distances = squareform(pdist(X)); sigma = max(distances(:)); order = 2; tmp = distances.^order/sigma; W = exp(-tmp); C = NcutClu...
clc; close all; clear all; % metabolic for Jay's study % December 1st 2017 %---------------------------------------------------------------------------------------------------------------------------------------% system = 'WIN'; if strcmp(system,'OS') path = '\\Mac\Home\Google Drive\3-Research\2016\Trial...
% Script M-File: StirlingCalcs.m % Written By: Christian Gruss % Creation Date: 9/7/2016 %-------------------------------------------------------------------------------------------------------------------------------- % DISCLAIMER: All content of this file is the intellectual property of Christian Gruss. % Any reprod...
function [obj,idx,initIdx,nClusters,avgSpikeWaveforms,stdSpikeWaveforms]=spikeClustering(obj) % Run clustering on previously extracted features % [obj,idx,initIdx,nClusters,avgSpikeWaveforms,stdSpikeWaveforms]=spikeClustering(obj) avgClusteredWaveforms=cell(1,obj.nCh); stdClusteredWaveforms=cell(1,obj.nCh); if isempty...
global s %% ZAD1 %wyznaczanie y_pp dla u_pp = 1.1 u_pp = 1.1; t_sim = 300; y = [0;0]; for k=2:t_sim y_temp = symulacja_obiektu6Y(u_pp,u_pp,y(k),y(k-1)); y = [y;y_temp]; end figure(1) stairs(0:t_sim,y) title('Przebieg sygnału wyjściowego dla ustalonego U_{PP}') xlabel('k') ylabel('y') x = 0:t_sim; xy = [x(:)...
function [ A ] = normalizeMatrix ( A, m ,s ) %UNTITLED3 Summary of this function goes here % Detailed explanation goes here for i=1:size(A,2) x = A(:,i); nx = (x(:) - m(i)) / s(i); A(:,i) = nx; end end
function op_plot_bar_NAc(xx,Meanvalue,semvalue,color,xlabel_str,ylabel_str,title_str,ylim) hdg = bar(xx,Meanvalue,'barwidth',0.9,'linewidth',1.5,'facecolor',color); hBaseline = get(hdg(1),'BaseLine'); set(hBaseline,'linewidth',1.5) ylabel(ylabel_str,'Fontsize',30); title(title_str,'Fontsize',30); %set(hl,'location','n...
function [current, currentMonomial, currentExponent] = current_gp(beta2, beta4, channelAmplitude, infoAmplitude, powerAmplitude, powerRatio) % Function: % - formulate output DC as a function of waveform amplitudes % - decompose current as sum of monomials % % Input: % - beta2: coefficients...
%------------------------------------------------------------------------------- % computes global mean radiative fluxes at toa % % should be general enough to easily use with multiple experimens % % levi silvers july 2018 %--------------------------------------------------...
%% This function recons images using the regredding method function [] = Bruker_recon_3Dradial_4element_array_coil1(runno, dv, kv, dcfv, mat, acq, keynumber) %===============INPUTS==================== %runno=run number %dv=k-space data %kv=k-space coordinates for the data in dv %dcfv=density compensation fact...
clc; clear all; imagen = imread('dont.JPG'); %train pause(0.5) %%%%%%%%%%%%%%% %% Image segmentation and extraction %% Show image figure(1) imshow(imagen); title('INPUT IMAGE WITH NOISE') pause(0.5) %% Convert to gray scale if size(imagen,3)==3 % RGB image imagen=rgb2gray(imagen); end %% Convert to binary image t...
% function [mu, sigma, R, Q, Lambda_M] = init() % This function initializes the parameters of the filter. % Outputs: % mu(0): 3X1 % sigma(0): 3X3 % R: 3X3 % Q: 2X2 function [mu, sigma, R, Q, Lambda_M] = init() mu = [0; 0; 0]; % initial estimate of state sigma = 1e - 10*diag([1 1 1]); % initial...
A1 = csvread('/home/mskim/autron/driver_data/170518/TW/170518_test1_TW/170518_test1_TW_L1.csv', 1); A2 = csvread('/home/mskim/autron/driver_data/170518/TW/170518_test1_TW/170518_test1_TW_L2.csv', 1); B1 = csvread('/home/mskim/autron/driver_data/170518/JH/170518_test1_JH/170518_test1_JH_L1.csv', 1); B2 = csvread('/home/...
function [geoAng] = ari2geodeg(ariAng) %ARI2GEODEG converts arithmetic angles to geographic angles. % ariAng is a scalar, vector, or matrix of angles in degrees, % such as those produced with atan() or atan2(). % geoAng is an output of size(ariAng) with angles converted to % geographic headings (North = 0, with an...
function ShowSylvInertia() % function ShowSylvInertia() % Illustrate the Sylvester Law of Inertia % GVL4: Section 8.1.5 clc fprintf('Sylvester Law of Inertia\n\n') % Generate a matrix with negative, zero and positive eigenvalues... n = 20; X = randn(n,ceil(n/3)); Y = randn(n,ceil(n/4)); A = X*X' - Y*Y'; evA =...
function [H2to1] = computeH_norm(points1, points2) % input points % points1, points2 -- 3 x N % find the rows and columns of each point set [rows, columns] = size(points1); [rowsxy, columnsxy] = size(points2); % calculate the centroid of each point set cent = mean(points1(1:2,:)')'; cent2 = mean(points2(1:2,:)')'; ...
% Close all figures, clear variables in memory and MATLAB command screen close all; clear all; clc; % Set the output format to the short format with compact line spacing format short; format compact; % Specify values and necessary parameters x = [0 2 3 5 8]; y = [-6 0 7 21 65]; A = [length(x) sum(x) sum(x.^2); ...
% 旋翼挥舞动力学方程推导 syms p A B C D E F G nb e mux muy l ex ey Lbeta = [1 cos(p) sin(p); 1 cos(p-2*pi/3) sin(p-2*pi/3); 1 cos(p-4*pi/3) sin(p-4*pi/3)]; Lbeta_p = diff(Lbeta,p); Lbeta_pp = diff(Lbeta_p,p); Lbeta_inv = inv(Lbeta); h1 = A+2*(B*cos(p)-C*sin(p))+4*nb*(D+E*cos(p)+F*sin(p)); h2 = A+2*(B*c...
function [D]=particle_distance_calculation(particle_sigma) % Function: calculate the distance between each particle % Inputs: % particle_sigma - the sigma vector of particles % Outputs: % D - the distance martix n_particle=size(particle_sigma,1); for i=1:n_particle ...
function [Vector_struct,numCond,cond_code,cond_name]=EEG_makeVector(... EEG,Task,Condition,phase_in,varargin) %calculate target events for conditions that we want to separate into %4POP: {6 5} %WM: {[31 32],[33 34],[35 36]} % Optional paramters: % 'acc': provided Accuracy information, the vector will only include...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MLS.m %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % function [point,par,info]=MLS(fun,point,step,par,tune,info); % % try to significantly improve func...
function [mainpts]=most_common_startlocations_find(data,start_date,end_date) routes=data.routes;ways=data.ways;wayindex=data.wayindex; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% start_points = zeros(20000,1); end_points = zeros(20000,1); for i=1:size(routes,2) rt=routes(i); date=find_date(rt); if datenum(dat...
% % irpGetGrayMask extracts a gray code mask from a sequence of "stripe images" % which were created by irpGetStripeImages. % % Usage: % grayMask = irpGetGrayMask(striped); % images{1} = bright % images{2} .. images{last-1} = projector % images{last} = dark function GrayMask = irpGetGrayMask(images) last = size(im...
function plotboundary(labels, features, model, varargin) % PLOTBOUNDARY Plot the SVM classification boundary in Exercise 8 % % plotboundary(labels, features, model, fill_on) plots the training data % and decision boundary, given a model produced by LIBSVM % % The parameter 'fill_on' is a boolean that indi...
clear all; % Create the mapping table first by running load FileWav16kHz % see create_gmm for what to be loaded by FileWav16kHz % load SvdClassTmN % SvdClass(ClassDef, FromGroup, RefGroup) % .U (SVD vectors) % Class(ClassDef, Group) % A1) M -> M; 1 ->...
function pushbutton_Callback(hObject,eventdata) s=get(hObject,'UserData'); studentno=s.studentno; global students; startpos=s.startpos; stoppos=s.stoppos; h1=s.h1; h=s.h; a=s.a; ui=s.ui; % switch student's choice to second choice students(studentno).areachoice = students(student...
function dist = distance(pts) # finds distance between pairs of points and adds them sequentially # always absolute value of distance # must be at least two points # pts rows correspond to the different axes dist = 0; # iterate from one point to the next for i = 1:size(pts,1)-1 # distance is the sq...
classdef initial_conditions properties(Access=private) percentage_loaded S Q QS end methods(Access=public) function obj=initial_conditions(Smax,percentage_loaded) obj.percentage_loaded=percentage_loaded; obj=obj.set_initial(Smax); ...
function [ bx , by , bz ] = bezier2 ( Bx , By ,Bz ,u , v ) % Opis : % bezier2 vrne točke na Bezierjevi ploskvi iz tenzorskega % produkta % % Definicija : % [bx ,by ,bz] = bezier2 (Bx ,By ,Bz ,u,v) % % Vhodni podatki : % Bx , By , Bz matrike velikosti n+1 x m+1 , ki določajo % koordinate kontrolnih točk , % u, v vrstici...
function [poly_x, poly_y] = gen_traj(a) % Interpole les trajectoires sur x et y avec des splines. poly_x = spline(a * r_consts.traj_time_values, [0 r_consts.traj_x_values 0]); poly_y = spline(a * r_consts.traj_time_values, [0 r_consts.traj_y_values 0]); end
function PlotEEG(A, data, showLabels) %PLOTEEG - Plots a spatial mapping of EEG electrodes and fills electrodes with color. % % WARNING: EEGPLOT is an internal method for brainPlot and is not meant to be called externally. %% CHANGELOG % Written by Josh Grooms on 20130626 % 20140828: %% Initialize if n...
clc clear all format long D=0.1; gama =1; in=0;fn=5; dt = 0.01; endstep =(fn-in)/dt; tspan=in:dt:fn; realization = 10000; v0 = 1;%initial velocity v = zeros(realization,endstep); v(:,1) = v0; for i=1:realization noise = wgn(1,endstep+1,2*D); for j=1:endstep v(i,j+1) = v(i...
function map = proj_panoview(cld, vertex, face) orig = cld.orig; orig_x = orig(1); orig_y = orig(2); X = cld.X; Y = cld.Y; Z = cld.Z; [m, n] = size(X); vert1 = vertex(face(:,1),:); vert2 = vertex(face(:,2),:); vert3 = vertex(face(:,3),:); %% compute the depth of all vertex depth...
function[header]=getBlockHeaders_smr(fID,chan) % getBlockHeaders_smr returns a matrix containing the data block headers % in file 'fID' for channel 'chan'. % The returned header in memory contains, for each disk block, % a column with rows 1-5 representing: % Offset to start of block in file % ...
function [resMat,resMatNames,numImPts] = getTifBoundary(coords,img,object,imgName,distThresh,fibKey,endLength,fibProcMeth,distMini) % getTifBoundary.m - This function takes the coordinates from the boundary file, associates them with curvelets, and produces relative angle measures. % % Inputs: % coords - the locat...
function generateTextReport(filename, ... Results, ... FeatureSelection, ... additional, ... ClassifyOptions, ... CrossValidationOptions, ... SelectionO...
a = zeros(1,10); for n = 1:10 a(n) = sin(n-1); end ham = transpose(hamming(10)); input = (a) .* ham; fourierTransform = fft( input ); output = abs(fourierTransform) .* abs(fourierTransform) ./ 10;
function [isi_sec,FR_Hz,Icmd,medV,Vcmd,medI]=spikeSummary(dataDir,spikeFile) cd(dataDir) % Load spike file load(spikeFile); spikes_in=out; clear out; % Load data file daq_in=load(strrep(spikeFile,'spiketimes','daqout')); % Median membrane potential or holding current [medV,medI,Vcmd,Icmd]=deal(nan); if isnan(daq_...
%************************************************************************** % - Exercises E04 - % Excercise 5 - Image Filtering II - MATLAB % % Date: % Name: %************************************************************************** close all; % load image img_noise = imload ...
function ret = arraydelta(beta, a, X, Y) ret = beta*(a(1).*X+ a(2).*Y) - (beta-1)*(X.^2 + Y.^2); endfunction %!test %! a = rand(2, 1); %! X = [2,2;2,2] %! Y = [-1,-1;-1,-1] %! assert(arraydelta(0,a,X,Y), [5,5;5,5], eps) %!test %! a = rand(2,1); %! beta= rand*6; %! X = rand(10, 10); %! Y = rand(10, 10); %! assert(ar...
function [nb,Apdf,normpdf,amp,burstinds] = burstAmpHistHMM(dataX,fsamp,bins,minbs,winmark,dataC) dataX = decimate(dataX,5); XH = (abs(hilbert(dataX))); if nargin>6 dataC = decimate(dataC,5); end fsamp = fsamp/5; minbs = fix(minbs/5); %% Resample WinMark winMarkInds = ceil(find(winmark)/5); %these are the transitions...
function [Q,Qx,Qy] = MESH2PTS(MESH, Pts) %MESH2PTS returns a matrix that represents an interpolation from the nodes %of the provided mesh to the required points. Brute-force searches employed %here. % % USAGE: % Q = MESH2PTS(MESH, Pts); % Verify: Pts = Q*MESH.Nds; % INPUTS: % MESH : Struct containing mesh i...
% xPlotGrid3D.m % % A way of visualising 3D grid search data % % Created 6 October 2017 function xPlotGrid3D % Main Function % Load in Grid Search Data load('~/Documents/DPhil/Data/GridSearches/CSF_Grids/Grid_TE_40_OEF.mat'); np = max(size(pos)); nz = min(size(pos)); val1 = linspace(0,1,nz); fig1 = MakeF...
function varargout = calculateFlyStats(fname, refOdor) %CALCULATEFLYSTATS Initial analysis of fly tunnel behavioral data. % FLYTRACKS = CALCULATEFLYSTATS(FLYTRACKS) performs data pre-processing, % calculates several useful metrics for individual flies (including % velocity, distance traveled, and odor choice prob...
% practical2 clear clc close all % Input parameters m = 1; l = 1; lc = 0.5; Izz = (1/3)*m*(l^2); g = 9.81; %initial state y1_0=0; y2_0=0; ti=0; tf=3; [t,y]=ode45(@practical2_diff,[ti,tf],[y1_0; y2_0]); T=t; Y1=y(:,1) Y2=y(:,2); for i=1:length(T) dy=practical2_diff(T(i), [Y1(i), Y2(i)]); ...
function NormedArray = MaxNormalize(Array) NormedArray = Array / max(max(Array)); end
function [proj_points, t, R] = ar_cube(H,render_points,K) %% ar_cube % Estimate your position and orientation with respect to a set of 4 points on the ground % Inputs: % H - the computed homography from the corners in the image % render_points - size (N x 3) matrix of world points to project % K - size (3 x 3)...
function [b,cbar_old]=find_stable_sort(x_count,x_index,box_count) k=box_count; c=zeros(k+1,1); N=length(x_count); for i=1:N c(x_count(i))=c(x_count(i))+1; end % temp = 1:(k+1); % temp2 = x_count; % c=histcounts(x_count,'BinLimits',[1 k]); % if sum(c)>N % keyboard % end % c(end+1) = ...
% input file_name = input('Enter file name: ','s'); cycle = input('Enter cycle: '); % load data file_graph = fullfile(pwd,file_name); edgList = load(file_graph); tutte(edgList, cycle);
clear; clc; %% Set Up % Copy and paste below output files from Xilinx simulation directory to this % scripts local directory 'output_files' folder % output_files\image_data.txt % output_files\horz_filter_output_data.txt % output_files\vert_filter_output_data.txt % output_files\sum_filter_output_...
function DATASET = toyData() DATASET.DESCRIPTION = 'Toy test data.'; DATASET.FILE = 'toyData'; DATASET.GROUPS = { 'toy' }; DATASET.FIELDS = { 's1' 1 't' 's1_mean' 's1_std' 1 [] 's2' 1 't' 's2_mean' 's2_std' 1 [] 's3' 1 't' 's3_mean' 's3_std' 1 [] 's4' 1 't' 's4_mean' 's4_std' 1 [] };
%optimized code function [MSE, fmvs_x, fmvs_y] = fractionalblockmatching(previous_pic, current_pic) global fig_no; %global blocksize; %global factor; global frame_size_h; global frame_size_w; factor = 0.5; blocksize = 4; search_param = 8; [frame_size_h, frame_size...
x = 0:0.001:10 y = sin(x .^ 2) + e .^ (0.1 * x) z = 1 + e .^ (0.1 * x) t = -1 + e .^ (0.1 * x) plot(x, y, 'b') hold on plot(x, z, 'r', x, t, 'r')
clc clear all [num,txt,new_york]= xlsread ('new_york.xlsx'); [num1,txt1,kuzeydogu]= xlsread ('kuzeydogu.xlsx'); new_york_posta_kodu=new_york(:,1:1); new_york_toplam_nufus=new_york(:,2:2); new_york_toplam_konut_birimi=new_york(:,3:3); new_york_arazi_alani_metrekare=new_york(:,4:4); new_york_su_alani_metrekar...
% 315CA Dinu Ion-Irinel function out = bicubic_resize_RGB (img, p, q) % ====================================================================== % Resize image img a.i. it should be of size p x q. % The img image is colored. % Basically, it calls the bicubic_resize function 3 times on each channel of the ...
function [compcheck,Cred,Bx] = compat1( Cx,cx,Bx ) %{ Compatibility check b/w a set of assingments (Cx) and an assignment (Cx) over a single r.v. Input: Cx: Nr x 1 array of assignments cx: scalar of assignment Bx: Ns x Nbs array of basic state indicator Output: compcheck: Nr x 1 array of logical index ...
clc; clear; close all; %% importing data data = importdata('./data/q24_2.txt'); x1 = data(:,1); x2 = data(:,2); y = data(:,3); cftool
function upper_layer = trainUpperLayer(lowernn,features,labels,param) num_category = size(labels,2); num_epochs = param.num_epochs; batch_size = param.batch_size; lambda = param.lambda; alpha = param.alpha; %Bottom-up forward forward_train_feature = forwardFeat(lowernn,features); %initializatio...
function ts_disp disp('hello'); why; ones(5,5) exit()
function orthospm3b(threshold, onsets, window ,spm_file, anat_file, tseries_path, func_root ) % function result = orthospm3b( threshold , % onsets, % window % [,spm_file , % anat_file, % ...
function [U,P] = btf2factor(B) % convert the struct item B into factors U,P{1},P{2},...,P{l+1} % A = U * P{l+1} * P{l} * ... * P{1} % (used for debugging) U = []; for i=1:length(B.U) U = blkdiag(U,B.U{i,1}); end P = cell(length(B.P),1); P{1} = []; for i=1:length(B.P{1,1}) P0 = B.P{1,1}{1,i}.E; P0 = [...
% fast_fd_2d_chunk : wrapper for the 'fd' eikonal solver from FAST % % CALL : % t=fast_fd_2d(x,z,V,Sources); % % x,z : [km] % V : [m/s] % % % 'fd' is an efficient FD soultion of the eikonal equation, and is % a part of the FAST pacjage created by Colin Zelt : % http://www.geophysics.rice.edu/department/facult...
function [ bits ] = visualize_image( image ) % NAME: visualize_image % % DESCRIPTION: % Byte-scale the image to 8 bits and/or reduce % to true color for visualization % %@ % Copyright 2016 The Johns Hopkins University Applied Physics Laboratory % % Permission is hereby granted, free of charge, to any ...
function [R,fval] = estimateR_fused(S,W,lambda,R0,tol) F = size(S,1)/3; P = size(S,2); S1 = zeros(3,P,F); W1 = zeros(2,P,F); R1 = zeros(3,3,F); for i = 1:F S1(:,:,i) = S(3*i-2:3*i,:); W1(:,:,i) = W(2*i-1:2*i,:); R1(:,:,i) = [R0(2*i-1:2*i,:);cross(R0(2*i-1,:),R0(2*i,:))]; end [R2,fval] = updateRotations(W1...
% userCorrelation.m % Dan Hirlinger % 11/6/2020 clear;clc; % This is a script you should use for Problem 2 in order to verify the performance % of your solution. Make sure your code can automatically adjust to signals of different lengths. % Your code should create two array variables: % Example vectors from test %x...
% Define a starting folder wherever you want warning('off','all'); topLevelFolder = uigetdir(pwd); if topLevelFolder == 0 return; end allSubFolders = genpath(topLevelFolder); remain = allSubFolders; listOfFolderNames = {}; listOfFileNames = {}; listFileNames = {}; listOfFullFileNamesPath = {}; while true [singleS...
function res = transactConvISA(data, isa1, isa2, pa_layer) if nargin<3 pa_layer.type = 'lhthresh'; pa_layer.lowthresh = 0.1; pa_layer.highthresh = 1; pa_layer.usegpu = 0; end % A combination of data transform and activations for ISA, faster & mem % memory efficient %% obtain size/stride parameters from i...