text
stringlengths
8
6.12M
function[datos_x_parcial, datos_y_parcial] = tiro_mitad_datos(datos_x, datos_y, camara) mitad_px = datos_x(1) + (datos_x(end) - datos_x(1))/2; % if camara == '1' filtro = datos_x < mitad_px; % end % esto estarķa mal xq estaba mirando la punta equivocada % if camara == '2' ...
function [JorK,A,B,C,D,sp1,sp2,sp3,sp4,contra1,contra2,contra3,contra4 ] = get2elec_tablevE_debug ( mu,nu,lambda,sigma,centers,spreads,shapematrix,d,L,Farray,effuncall) electmp=0; A = [centers(mu,1) centers(mu,2) centers(mu,3)] B = [centers(nu,1) centers(nu,2) centers(nu,3)] C = [centers(lambda,1) centers(lambda,2) ...
% $Header: svn://.../trunk/AMIGO2R2016/Postprocessor/Post_Report/AMIGO_report_OPTsolver.m 1813 2014-07-14 14:53:39Z attila $ % AMIGO_report_OPTsolver: reports options selected by the user for the OPT % solver % %****************************************************************************** % AMIGO2: dynamic modeling, o...
function manipulateLuminanceAllImages % This function runs the manipulatLuminance function on all scenes % contained in the Images/Originals directory % Emily Cooper, Alexandra Yakovleva, Stanford University 2014 mpath = strtok(userpath, pathsep); path = fullfile(mpath, 'scene-filter-see', 'ImageManipulation'...
function save_LORs(filename_f,LORs_output) %SAVE_LORS Summary of this function goes here % Detailed explanation goes here save(filename_f, 'LORs_output'); end
function [ latbinstruct ] = make_ace_empty_latbinstruct( tanstruct_in, lat_bounds ) % *INPUT* % tanstruct_in: STRUCTURE - contains the gas specific ACE data. % This structure can be created with 'read_ace_ncdata.m' or with % 'read_ace_ncdata_for_mat.m'. % % lat_bounds: VECTOR - a...
classdef MHyProReach < handle properties (SetAccess = public, GetAccess = public) ObjectHandle end methods (Access = private) % Destructor function delete(obj) MHyPro(12, 1, obj.ObjectHandle); end end methods (Access = publ...
%% Trust region method for Arrow-Debreu market equillibrium clear all; close all %rand('state',0) % Generate data m = 10; %number of agents n = 10; %number of goods pA = 0.01; pB = 0.01; indA = (rand(m,n)<pA); indB = (rand(m,n)<pB); A = rand(m,n); %utility matrix B = rand(m,n); %initial budget %A = A./(sum(A,2)*ones(1...
function [tau] = att( q,qf,myrobot ) %UNTITLED2 Summary of this function goes here % Detailed explanation goes here l1 = myrobot.link{1}; l2 = myrobot.link{2}; l3 = myrobot.link{3}; l4 = myrobot.link{4}; l5 = myrobot.link{5}; l6 = myrobot.link{6}; H1c = getA(q(1), l1.alpha, l1.D, l1.A); H2 = getA(q(2), l2...
close all; MatrixName= 'can_96.mtx'; method ='bicgstab'; %method ='gmres'; el = 2; % GMRES parameter restart = 3; tol = 1.0e-17; maxit = 100; DirName = 'figs'; FontSize = 14; %B = load('co2_jac_first_iteration.mat'); %A = B.jac; %mmread(MatrixName); A = mmread(MatrixName); [req,pot,add,F,c] = precol2('D2RestrictedCol...
% for TEST001.AVI %{ lmarks = [[29,300]; [134,146]; [237,296]; [343,143]; [436,314]]; %} % others For 02/25/2013 lmarks = [[135,299]; [242,144]; [342,296]; [443,156]; [538,326]]; % For 02/26/2013 lmarks = [[156,310]; [253,157]...
n = 80; tol = 1e-5; % Pick a non singular matrix A A = fix(10*rand(n, n)); while det(A) == 0 A = fix(10*rand(n, n)); end % A = [2 1; % 1,8] % tic [UMatlab, SMatlab, VMatlab] = svd(A); % toc tic % Initialize $U,\ \Sigma,\ V$ to $I$. U = eye(n); V = eye(n); S = eye(n); svdError = 500; svdErrorPrev = svdError...
% ground truth Gaussian mixture model true_model.Mean = [-2 2]; true_model.Cov = [1 0.5]; true_model.Prior = [0.4 0.6]; sample = gmmsamp(true_model, 250); % ML estimation by EM options.ncomp = 2; % number of Gaussian components options.verb = 1; % display progress info estimated_model = emgmm(sample.X,options...
function estimateGravityLive() % Estimates online the head and VC position of the SEASnake in a % gravity-oriented frame % THIS WILL NOT WORK UNLESS YOU CAN CONNECT TO THE SEA SNAKE g = HebiLookup.newConnectedGroupFromName('SEA-Snake','SA008'); snakeData = setupSnakeData( 'SEA Snake', g.getInfo.numModules); ...
% A script that runs the method of lines and RK4 on a heat equation. h = 1/100; T = 1; k = 1/300; x = transpose(0:h:2*pi); f = x - pi; D = center_diff(length(f)); Laplace = right_diff(length(f)) * left_diff(length(f)); % Q = D - (h^2/6) * D * Laplace + (h^4/30) * D * Laplace^2; % Q_6 Q = D - (h^2/6) * D * Laplace; ...
%% Volatility and Hedging Errors study 2 % 黄勉 20160203 参考 Jim Gatheral PPT volatility and hedging error 1999 % hekang 20160427 分别使用real vol/low vol/high vol进行delta hedge,并与理论价格走势进行比较 %% 验证如下结论 for CALL % In the two scenarios analysed, if the option is sold and hedged at a % volatility greater than the realised volati...
function out = generatePlotsv3(ds, plotsFile, autoplot, plottingFuncName, sizeColorMap, plotParams) %GENERATEPLOTSV3 This function reads the matDS structures and the plot configuration file and generates a %m-function to plot the desired signals. Some parameters in the output m-function file are defined by %default a...
function gaborArray = gaborFilterBankCurvo(u,v,m,n,c) % % GABORFILTERBANK generates a custum Gabor filter bank. % It creates a u by v array, whose elements are m by n matries; % each matrix being a 2-D Gabor filter. % % % Inputs: % u : No. of scales (usually set to 5) % v : No. of orientations...
figure(1) clf subplot(2, 2, 1); drawsolution(TT(:, 10), M, freenodes); title('$t=10$s', 'FontSize', 14, 'Interpreter', 'latex') xlim([0 0.0725]); ylim(xlim); axis off set(gca, 'Position', [0 0.5125 0.45 0.45]); axis off subplot(2, 2, 2); drawsolution(TT(:, 100), M, freenodes); title('$t=100$s', 'FontSize', 14, 'Interp...
function s = angdev(ang,dim) % ANGDEV - Angular standard deviation % % s = angdev(ang,dim) % % Calculates sample angular standard deviation (also returned by ANGMEAN) % From Fisher 1993, page 32 % % SEE ALSO % angmean % Mercurial revision hash: $Revision$ $Date$ % See http://rcn.ccs.tulane.edu/index.php5/Tytell_M...
function matUpdateOutputResult( obj, time, fphys ) %MATUPDATEOUTPUTRESULT Summary of this function goes here % Detailed explanation goes here for m = obj.Nmesh obj.outputFile(m).outputIntervalResult( time, fphys{m}(:,:,obj.outputFile(m).varIndex) ); end end
function [Results, Strength, Amplitude, phaseD, cyc, Dsmp, Nsmp] = testPhaseLockDetrendTmp(Nmf, mfA, fst, pth) if nargin < 1 Nmf = 5; end pFig = 1; pFig2 = 0; pFig3 = 0; if nargin < 2 mfA = [85.8, 27, 171.6, 432.4, 343.2, 34.1, 21.5, 54.1, 108.1, 17, 136.2, 216.2, 42.9, 272.4, 68.1]'; end if n...
%-------------------------------------------------------------------------% % npend_DAE - Jeremy Turner % % Right-hand side function called by ode45 in npend.m to simulate system % using the symbolically-derived ODEs using the DAE method. Includes % shaking base. % % Input: z - State vector 2nx1 (theta1; ...; thetan; ...
# # The dep. vbls, in corresponding column # Office based doctor visits 1 # Outpatient doctor visits 2 # Emergency room visits 3 # Inpatient visits 4 # Dental visits 5 # Prescriptions 6 # 1; which_dep = 1; if (which_dep == 1) printf("\nOBDV\n"); endif if (which_dep == 2) printf("\nOPV");endif...
% this is the driver for Pitot calibration % % created by: % Johannes Becherer % Tue Feb 14 11:30:20 PST 2017 clear all; close all; %_____________________set processing flags______________________ do_parallel = 1; % use paralelle computing do_raw_data = 1; % do the averaging of th...
function out_square = getSquare (bw_image, num_candidate, debug, originalImage) % get_square try to get all the connected components whose bounding box % is squared. It gets the first 'num_candindate' whose convex area is the bigger. assert( islogical (bw_image), 'Input image must be logical'); ...
%% fn_axispixel % Set axes size such that there will be an integer ratio between the % pixels in the image and on the screen display. % %% Syntax % fn_axispixel([ha]) % %% Source % Thomas Deneux % % Copyright 2010-2012
%% This code will create the gaussian noise mask % This may be needed to draw the stimuli AssertOpenGL; rectSizeX = 90; % This sets size X to 128 rectSizeY = 30; % This sets size Y to 128 objRect = SetRect (0,0,rectSizeX, rectSizeY); % This generates randomly distributed noise with mean 128, and SD 50. noiseimg = (...
function p=read_fmw_3d(path,frame) % p=read_fmw_3d(path,frame) % read initial and resulting wind at cell centers and compute their coordinates p=nc2struct(path,{'U0_FMW','V0_FMW','W0_FMW','HT_FMW','ZSF','FWH',... 'U_FMW','W_FMW','V_FMW','UF','VF','FWH','U','V','W','ZS','HGT',... 'PHB','PH','P','PB'},{'DX','DY'}...
function f = optimizeStabilityDFD(X, trajData, windShear, objType) X = X'; if strcmp(windShear, 'same') N = (length(X)-1)/3; VR = trajData.VR; else N = (length(X)-2)/3; VR = X(3*N+2); trajData.VR = VR; end T = X(3*N+1); trajData.T = T; trajData.N = N; ...
clear clearvars -global close all load rotationtestdata2 clc %% global timestamp wheelDispL wheelDispR xm ym trot; trot = trot - trot(1); trot = -trot; hf = figure(2); set(hf,'Units','Points'); set(hf,'Position',[650,550,350,300]); h1 = plot(xm,ym,'*', 'Color', [ 0 0.4470 0.7410]); hold on % quiver(xm, y...
function prettyprt0(results) % Now pretty print things fprintf('\nError statistics:\n'); numbm = size(results,1); fprintf('\nbm mean median std var pcterr\n'); maxpower = max([cell2mat(results(:,17));cell2mat(results(:,18))])+ 10; minpower = min([cell2mat(results(:,17));cell2mat(results(:,18))])...
function [xLb, xUb, yLb, yUb] = GridToCoordinate(gridIndexX, gridIndexY) % Convert the index of grid to the lower bound and upper bound of x and y coordinates. xLb = (gridIndexX - 1) * 40 + 1; xUb = gridIndexX * 40; yLb = (gridIndexY - 1) * 40 + 1; yUb = min(gridIndexY * 40, 300); end
img = imread('ankle.jpg'); %rgbImage= imread(img); %rgbImage= imresize(rgbimage,(256 256); ImgBlurSigma = 2; % Amount to denoise input image MinHoughPeakDistance = 5; % Distance between peaks in Hough transform angle detection HoughConvolutionLength = 40; % Length of line to use to detect bone regions HoughConv...
function [x, y, gama, v, cp] = panelMethod(xb,yb,m,mp1,alpha,bc) % NOTE: % this subroutine solves a set of algebraic equations c(i,j)*x(j) = a(i), % i=1,2,...,N. it is taken from p.114 of chow (1979) % Geometry parameterization % coordinates (x,y) of control point and panel length s are computed % ...
function [truncRed ,truncGreen ,truncBlue,output_image] = paper_jrt(input_image, N) truncRed=0; truncGreen=0; truncBlue=0; rowsize = floor(size(input_image,1)/N); %% Blurring & Edge detection now = 0; for i = 1:rowsize % horizontal mean + down-sampling (sampled by N-size) before = now; now = squeeze(s...
function specCheckMain(mz,sp,grp) %specCheckMain - this function works on a data matrix with muliple classes, %by running the function once for each of the classes [unq,~,ind] = unique(grp); numG = numel(unq); mask = mz > 210 & mz < 2000; for n = 1:numG % Indices of this class fx = ind == n; x ...
% ADVISOR data file: TX_1SPD_BUS.m % % Data source: % % Data confirmation: % % Notes: % This file defines a 1-speed gearbox meant to simulate a series hybrid bus single-reduction % transmission. % % Created on: 08-August-2001 % By: MPO, NREL, michael_o'keefe@nrel.gov % % Revision history at end of file. %%%%%%%%%%%%...
function [out_img] = pca_image_denoise(inp_img1, patch_size, window_size, Lx) half_p = (patch_size-1)/2; half_w = (window_size - 1)/2; sigma = 20; %inp_img3 = double(inp_img1)/255; inp_img2 = inp_img1 + uint8(randn(size(inp_img1))*sigma); %h = fspecial('gaussian',3,20); inp_img = double...
function [bounces] = task1(n,y) % This function counts the number of bounces that the jumper will % experience in 60 seconds bounces = 0; %Create counter for every bounce within 60 seconds for i = 2:n if(y(i) > y(i+1) && y(i) > y(i-1)) %If statement that counts every bounce bounces = bounces + 1; end ...
function x_den = tjc_denoise2(x) % load(settings.file_original_tjcs,'TestTrajDatabase'); level = 8; wname = 'sym4'; tptr = 'sqtwolog'; sorh = 's'; npc_app = 2; npc_fin = 2; % comp_rate = 10; % smoothedTrajectories = cell(length(TestTrajDatabase),1); % for ii = 1:length(TestTrajDatabase) % input(num2str(ii)); % ...
function [ output_args ] = bg2white(img) %bg2white - set an image background to white close all; % Set final channel to white bg = img(:,:,3); bg(bg > 0.5) = NaN; img(:,:,3) = bg; % Generic low values to NaN img(img < 0.1) = NaN; % Now triple NaN to white tripNan = sum(isnan(img),3) == 3; for n = 1:3 tmp = img(...
% batch job to test different estimation strategies, forcing Vart and f to be correlated. % calls kinetix2.m , which calls kinetix_lsq.m global rpenalty est0=[]; NITER=1; noise = 0; reglevels = [0:100:1000]; %reglevels = [25:5:50]*50; all_f = []; all_sig = []; all_est = []; bias = zeros(NITER,length(reglevels)); va...
function v = FFT(obj,f) % for waveforms whos frequency function dose not have a analytical form, % use FFT to calculate the frequency values numerically from time domain % function. % Copyright 2016 Yulin Wu, University of Science and Technology of China % mail4ywu@gmail.com/mail4ywu@icloud.com UPSAMPLE = 100; ...
% % Camera relationship and Gamma explanation % cd /wusr5/brian/book/Edits/03col/fig/subDisplayCamera load pulnixGam %loads pulnixGam invPulnixGam subplot(1,2,1) s = [0:999]/1000; plot(s,invPulnixGam) set(gca,'xgrid','off','ygrid','off','xtick',[0:0.25:1]) subplot(1,2,2) plot(s,invHit489Gam(:,1)) set(gca,'xgrid','of...
function c = conj(a, F) % CONJ Quaternion conjugate. % (Quaternion overloading of Matlab standard function.) % % Implements three different conjugates: % % conj(X) or % conj(X, 'hamilton') returns the quaternion conjugate. % conj(X, 'complex') returns the complex conjugate. % conj(X, 'total') returns the 'total' ...
clc clear all close all %{ %Arguments: f = weight between the SoC dependent term and the fully round dependent term. A value above 1 switches to the regular LEACH protocol. p = the desired percentage of CHs each round n = the number of nodes in the network Eo = Maximum energy for all nodes [J] Emode...
function [group,i,j] = findv(n,k) %FINDV 此处显示有关此函数的摘要 % 此处显示详细说明 if n<=k+1 group=1; i=n; j=1; else group=ceil(log2(n/(k+1))+1); i=ceil((n-(k+1)*2^(group-2))/2^(group-2)); j=mod((n-(k+1)*2^(group-2)),2^(group-2)); if j==0 j...
function [ U1, U2, P1, P2, Y ] = solveCMFH( X1, X2, lambda, mu, gamma, bits ) %SOLVECMFH Summary of this function goes here % Collective Matrix Factorization Hashing Algorithm % minimize_{U1, U2, P1, P2, Y} lambda*||X1 - U1 * Y||^2 + % (1 - lambda)||X2 - U2 * Y||^2 + % mu * (||Y - P1 * X1||^2 + ||Y - P...
function [mean_cost, f] = fitness(ind, dataset) % Conduct calibration with the solution related to the individual % Use the reciprocal of squared total cost as the fitness num_points = sum(ind); % The number of sampling points num_samples = size(dataset, 1) / 2; % The number of samples cost = zeros(num_...
% Load from ex6data3: % You will have X, y in your environment load('ex6data3.mat'); % Plot training data plotData(X, y);
%% prt_species_tree_taxa_js % writes species_tree_taxa{i}.js and species_tree_taxa{i}_taxon.html that are used by species_tree_taxa{i}.html %% function prt_species_tree_taxa_js(taxa) % created 2016/03/06 by Bas Kooijman, % modified 2016/06/01 Starrlight Augustine, 2016/06/02, 2016/10/08, 2017/10/13, 2018/06/15, 2018/...
function singleSubjectMultiICA_general(subjectIdx,filenames, mask, IC, age, outputPath, Options) %singleSubjectMultiICA - perform subject-specific longitudinal ICA % % Inputs: % filenames - A cell array of BOLD signal (pre-processed NIFTI) filenames. % Currently, we only support N (array length) == 3, i.e., 3 BO...
clear;clc;clear;clc; %% get path to folder dot = '/Users/brandomiranda/home_simulation_research/overparametrized_experiments/'; path = fullfile(dot,'pytorch_experiments/test_runs_flatness2'); %NL path_all_expts = fullfile(path,'/RedoFig5_Cheby/N_train_9_N_test_100_batch_size_9_perturb_freq_2500_perturb_magnitude_0.45_m...
function net = cnnapplygrads(net, opts) for iter = 2 : numel(net.layers) if strcmp(net.layers{iter}.type, 'c') for j = 1 : numel(net.layers{iter}.a) for ii = 1 : numel(net.layers{iter - 1}.a) net.layers{iter}.k{ii}{j} = net.layers{iter}.k{ii}{j} - opts.alpha *...
%------------------------------------------------------------------ % Matallana Et. Al. Example with VS Iteration Initialized with Vlin % Compute an estimate of the region of attraction for Matallana, et. al % example using the V-S iteration. The iteration is % initialized with the Lyapunov function from linear...
% ATTENTION: This script must be executed before running 'angleVariation.m' % % This script loads the Segmentation Data folder containing the data for a % particular movie and then iterates the 'singleFrame_tensorCalculator' % function over each movie frame while collecting the relevant data. % % The appropriate path ...
%=================================================== % this code is to draw contours from the data % points are sampled with mixed MCMC method, and saved in sampling.mat % Yiming Hu, Sep, 2012 %================================================== load PTsampleing.mat; chains = permute(chains,[2,3,1]); chains = chains(:...
classdef squareFlash < handle % Square flash for spatial mapping (Full Field) properties numTrials trial display design end methods function h = squareFlash(PDS, varargin) % CONSTRUCTOR % h = squareFlash(PDS) creates ...
%%%% multithread image = imread('airplane.jpg'); mask = false(size(image,1),size(image,2)); mask(140:220, 140:220) = true; iterations = 600; display = false; threads = 4; resizeVal = [.1 .25 .5 .75 1 1.5 2 4 8]; for i = 1:numel(resizeVal) imageTmp = imresize(image,resizeVal(i)); maskT...
% % Runtime function to make CrIS rtp files % % Input: % JOB - matlab datenum indicating the time to be processed % % rtpset='subset'/'full'/'full4ch'/'site_only_obs' % data_path='/asl/data/cris/sdr60'; % data_str='_subset'/.../.../'site_only_obs' % src='_noaa_ops'; % % Name is constructe li...
function newem = buildNewMap(em, fc_map_spd, fc_map_trq, fc_fuel_map_gpkWh_at_max_trq, fc_max_trq, fc_fuel_lhv) % newem = buildNewMap(em, fc_map_spd, fc_map_trq, fc_fuel_map_gpkWh_at_max_trq, fc_max_trq, fc_fuel_lhv) % % Routine to build a new fuel map based on the existing BASE map by scaling to fit the efficiencies ...
clc; clear all; [A,fs]=wavread('C:\Users\Arturo\Desktop\Franz Ferdinand - Love illumination.wav'); disp('Elige una opción') disp('1.- Rock') disp('2.- Acustico') %Menu de las opciones disp('3.- Popular') opcion=input(''); switch opcion case 1 ganancia=[10^(7/20) 10^(5/20) 10^(-1/20) 10^(4/20) 10^(6/2...
%% Virtual Environment clear all; kWall=5000; bWall=0; nWall=-1; xWall=0.126; tau=0.003; mu_max = 5000*1.1; %% Haptic Interface m=1; bHI=0; p0=0.12; v0=0; %% Haptic Controller A=0; %% Sample time tsampling=0.001; dof=1;
function [r_security]= checkCollision(P_Robot,v_Robot,radius_robot,P_Obs,u_Obs,radius_Obs,gama,theta) % Collision-cone approach for mobile obstacles d = sqrt((P_Robot(1)-P_Obs(1))^2 + (P_Robot(2)-P_Obs(2))^2); % Relative speed U_r = (u_Obs(1) * cos(P_Obs(3)-theta)) - v_Robot(1) * cos(P_Robot(3)-theta); % 57.2957* ?? ...
% A container class to hold workspace result for a point pose % % Author : Paul Cheng % Created : 2019 % Description : This class contains the known information obtained % through workspace analysis for all poses classdef RayWorkspace < handle properties (SetAccess = protected) model ...
function Cov = cov_long_v2(cov_short, mean_short, C_short, t_interval,... normalize, is_cov_short_norm) %% v2 has inputs (except cov_short) that were 3-dimensional arrays as cell % arrays % Calculates the covariance matrix of m pressure series over the total time % from the covariance matrices of short t...
% Carefull with this class. Matlab numbering starting with 1 % means register numbers in obj.register_data are of by one. classdef iCmvReg < handle properties (SetAccess = protected) register_data file_path end methods function obj = iCmvReg(regdump_path) obj.file_path = regdump_path; if exist(obj.fi...
figure; plot(q_opt'); hold on plot(q_recon{1}', 'x', 'DisplayName', num2str(rmse(1))); plot(q_recon{2}', 'o', 'DisplayName', num2str(rmse(2))); plot(q_recon{3}', '+', 'DisplayName', num2str(rmse(3)));
function [] = plot_sig_detection(parsed) figure() subplot(2,1,1) plot(parsed.hitRate); ylim([0,1]); title('Hit Rate') ylabel('P(H)') xlabel('Trial Number') %legend('Day 4', 'Day 5', 'Day 6') hold all subplot(2,1,2) plot(parsed.dPrime); title('d Prime') xlabel('Trial Number') ...
classdef OverviewControllerMock < handle; %OVERVIEWCONTROLLERMOCK Summary of this class goes here % Detailed explanation goes here properties updates; end methods function obj = OverviewControllerMock() obj.updates = {}; end functi...
%Problem3b clear clc dt = 0.01; et = 2.5; t = 0:dt:et; x = exp(1j*2*pi*t); real_x=real(x); imag_x=imag(x); abs_x=abs(x); angle_x=angle(x); figure; subplot(2,2,1); plot(t,real_x);title('real part'); subplot(2,2,2); plot(t,imag_x);title('imaginary part'); subplot(2,2,3); plot(t,abs_x);title('absolute va...
% This script loads two vectors of dice data, each which contains the % result of 10^4 rolls. It then performs a chi square test on each to % determine which die is fair and which is not fair. The result of the % test showed that die 1 is fair since it has a higher pvalue. close all;clear;clc; % This loads the dice da...
function [ output ] = get_hidden_output(h_states,trained_par) %GET_POOLING_OUTPUT Summary of this function goes here % Detailed explanation goes here output = cell(1,length(h_states)); for i = 1:length(output) output{i} = polling(h_states{i},trained_par.pars.spacing); end end
function boxplot_wani_2016(x, varargin) % Draw a box plot with some additional useful features. (work in the % matlab version since 2016 maybe 2015 as well, but not tested). % % Usage: % ------------------------------------------------------------------------- % boxplot_wani_2016(x, varargin) % % Inputs: % ----------...
function [ y ] = STA_E( f ) %STA_E -short time average energy y = sum(f.^2); end
function [var_gen, fitness] = decoding(funname, bin_gen, bits, min_var, max_var) num_var = length(bits); popsize = size(bin_gen, 1); scale_dec = (max_var-min_var)./(2.^bits-1); bits = cumsum(bits); bits = [0 bits]; for i = 1:num_var bin_var{i} = bin_gen(:, bits(i)+1:bits(i+1)); var{i} = sum(ones(popsize, 1)*2.^...
%%%%%%%%%%%%%%%%%%%%%%%%%% % % Sam Feig % Vladimir Zhdanov % % CSCI 4831/5722 % Homework 4 % Instructor: Ioana Fleming % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [dColor] = displayDMap(disparityMap) %1. map disparity into the range [0,1] % max_d = maximum calculated value of disparity maxD = max(disparity...
clear all moduleLis = importdata('modules.txt'); moduleLis(:,2) = floor(moduleLis(:,1)/3)-2; sum(moduleLis(:,2)) n=1; a=sum(moduleLis(:,n+1)); b=sum(moduleLis(:,n)); c=b-a; while c>0 moduleLis(:,n+2) = floor(moduleLis(:,n+1)/3)-2; moduleLis(moduleLis<0) = 0; c=sum(moduleLis(:,n));-sum(mod...
function OUT = RunLenth_Enc(img) [Y_RL, Cb_RL, Cr_RL] = RunLenth_Enc(Y_zigzag, Cb_zigzag, Cr_zigzag, im_height, im_width) Y_zigzag run = 0; YRL_index = 0; CbRL_index = 0; CrRL_index = 0; EOB = 555; % Indication for the END OF BLOCK for row = 1:8:im_height for col = 1:8:im_width Y_1x64 = Y_zigzag...
function y = upsampling(x,d,p) % upsampling - add p zeros between samples along dimension d % % y = upsampling(x,d,p); % % default is p==2, d==1 % % Copyright (c) 2009 Gabriel Peyre if nargin<3 p = 2; end if nargin<2 d = 1; end switch d case 1 y = zeros(p*size(x,1),size(x...
clear; clc; load('~/Downloads/hw1_data_mat/mnist_mat.mat'); %---------(a)---------- a=1; b=1; c=1; e=1; f=1; index_y1 = find(ytrain); index_y0 = find(~ytrain); N0=size(index_y0, 2); N1=size(index_y1, 2); sumX_y0=sum(Xtrain(:,index_y0),2); sumX_y1=sum(Xtrain(:,index_y1),2); averageX_y0=sumX_y0/N0; averageX_y1=sumX_...
function A = buildGraphWithSmoothnessConstraints(Z,X,Y,N,param,mask) % Build a sparse graph A where A(i,j) is non-zero if the graph has an edge % from vertex i to vertex j. The weights are infinity as stated in LI06 - % Section 4.2. Note that according to convention in LI06, this function is % building the graph G = (V...
clc; clear all; %ANASTASIA KADEK DETY L. ( 09 Oktober 2017) %MATLAB %--------------------------PROSEDUR PEMANGGILAN DATA y=xlsread('MATLABCOBA.xlsx'); N=length(y); fs=100; t=0:1/fs:(N-1)/fs; plot(t,y); %---------------------------DFT n=(1:1:N)'; m=(1:1:N); mn=n*m; W=exp(-i*mn*2*pi/N); %------------------...
% 7/30/13 % findTraj.m % generate optimal trajectory (in one dimension) % note that this implies no coridor constraints % Dependencies: findContConstraints.m, findFixedConstraints.m, % findDerivativeCoeff.m, findCostMatrix.m % % inputs: % r: integer, derivative to minimize in cost function % n: integer, order ...
%% mpc = 'case9.m'; x = loadcase(mpc); n_lines = size(x.branch, 1); subset = 1:n_lines; clear m; m.mpc = mpc; m.subset = subset; m.gamma_max = 2.5; m.K = 3; m.Lnorm = 1; m.obj_type = 'angle'; %% clear opts; %opts.retry_on_fail = 1; opts.opf_alg = 'ipopt'; setenv('OMP_NUM_THREADS', '1'); opts.runtime_diagnostics = 1; ...
data1 = csvread('data1.csv'); x = data1(:,1); x1 = x(1:50); x2 = x(51:100); y = data1(:,2); y1 = y(1:50); y2 = y(51:100); z = data1(:,3); w1 = 0; w2 = 0; b = 0; u = 0; a= 0; for iter = 1:1000 for i = 1:100 a = w1*x(i)+w2*y(i)+b; if z(i)*a <= 0 fprintf("%d\n", i); u = u+1; w1 = w1 + z(i)*x(i); w2 = w2 +...
function [stat] = compute_Topo_clusterPerm(dat1,dat2,time,chanlabels,fsample,clusteralpha,mc_alpha,nperm,layout,layoutName,minNumChan) if nargin<11 minNumChan=0; end %%% PREPARE DATA % cfg=[]; cfg.layout = layout; % layout = ft_prepare_layout(cfg); %Layout of the electrodes % build data for field trip f...
classdef Iterator02<handle %UNTITLED Summary of this class goes here % Detailed explanation goes here properties func; from; step; to; delay; label; resetStep; resetDelay; repeat; curRepeat; nextFresh;%in...
% ADVISOR data file: ESS_PB85.m where 85 is c/5-rate capacity % % Data source: % File created from ESS_PB91.m % % Data confirmation: % Not confirmed % % Notes: % This battery model has been created in attempt to model lead acid batteries % used in Orion VI series hybrid transit bus. ess_voc, ess_max_ah_cap, and % e...
% read in nifti files used for NMF parcellation and create X matrix for % visualization cd('/data/joy/BBL/projects/pehlivanovaPncItc/subjectData/antsCT/ctImages_2mm') %% read in text file with 427 image names filename = '/data/joy/BBL/projects/pehlivanovaPncItc/subjectData/antsCT/ctImages_2mm/listOf427Ct2mmImages.txt...
function Status = sutterCloseConnection(s) try fclose(s); Status = 1; catch Status = 0; end
% FUNCTION [] = savefig(fname, epsflag) % % Save current figure to FigX.tif % % Inputs: % fname - output file name % epsflag - 0 = nomral image 1 = eps image output % % Samuel A. Hurley % University of Wisconsin % v1.0 10-Dec-2010 % % Changelog % % v1.0 - Basic saveas(gcf, '') implementation (Dec-2010) % v2...
%% Optimization loop - moving Average for iGrid = 1:nGrid_movinAverage [~,accuracyTrial_movinAverage,latency4EachTrial_movingAverage] = plot_single_trial_detection(prob,... 'detectionMethod', {'movingAverage'},... 'windowForCorrectTrial',windowCorrect,... 'parame...
% Figure 4 of paper titled: "Disease spread coupled with evolutionary ... % ... social distancing dynamics can lead to growing oscillations" % % Accepted at 60th Conference on Decision and Control (CDC 2021) % For the pdf of the paper, visit: https://hoseinkh.github.io/files/Disease-spread-coupled-with-evolutionary-so...
function results = snapshot_gps_nav(gs) %%% %%% SETTINGS %%% ONE_SHOT = 1; %%% %%% CONSTANTS %%% d = 3; d_coarse = 76.5e-3; %ms c = physconst('LightSpeed'); %300e6; tcode = 1e-3; gs results = struct(); % unknown clockBiasMag = 5; %500 clock_bias = clockBiasMag*(rand-0.5); %in seconds % to get to same simestam...
function [ mask_updated, ind,killed_his, grid_his] = divider3(img,gs,percent,ind_a,killed_his, ind_init, grid_his) %The function divides input image into grid and calculate the %error sum within grids. [h,w]=size(img); pad.y=ceil(h/gs.y); pad.y=pad.y*gs.y-h; pad.x=ceil(w/gs.x); pad.x=pad.x*gs.x-w; %pad the matrix with...
function [ w,r,x,P ] = mapping( assignments,wupd,rupd,xupd,Pupd,... w_new,r_new,x_new,P_new,valid_idx,idx_out,threshold ) wnew = w_new(valid_idx); rnew = r_new(valid_idx); xnew = x_new(:,valid_idx); Pnew = P_new(:,:,valid_idx); M = size(assignments,1); r = cell(M,1); x = cell(M,1); P = cell(M,1); w = on...
% This function is used to split entire speech in frames of specific time % duration in msec. (in this we don't do frame overlapping) % % function [frames] = framing(x,fs,f_d) % x:input speech signal % fs: Sampling Frequency % f_d: Frame duration (in sec) % frames: returns Matrix in which each row represents a fram...
function [] = CPR_fit_function(t,d) addpath /Users/fschneider/Documents/GitHub/CPR/Matlab/Helper_functions addpath /Users/fschneider/Documents/GitHub/Violinplot-Matlab addpath /Users/fschneider/Documents/MATLAB/CircStat2012a addpath /Users/fschneider/Documents/MATLAB/palamedes1_10_9/Palamedes %% CONTINUOUS DATA: Bina...