text
stringlengths
8
6.12M
function [c, N, A] = RRTstar(start, goal, obstacles, Nmax, FOR_THE_KIDDOS) clf; hold on; axis square; rectangle; plot(start(1), start(2), 'sg') fill(goal(1,:), goal(2,:), 'g') mu = 1; for i = 1:length(obstacles) fill(obstacles{i}(1,:), obstacles{i}(2,:), 'r') mu = mu - polyarea(obstacles{i}(1,:), obstacles{i}(...
%NSCS Long step matlab minimal version %This path is used to call the linear solver in coneopt function [xc,xf,y,s,info] = nscs_long_step(problem,x0f,x0c,pars) %Problem must contain the fields %m %n_free %n_pos %n_soc_cones %soc_cones[] %n_sdp_cones %sdp_cones[] %n_exp_cones ...
function R = normalize(A,m) M = repmat(m,size(A,1),1); R = A - M; end
%% Nozzle Design for Liquid Fueled Rocket clear;clc; F = 10; % desired thrust Isp = 244; % specific Impulse Pc = 200; % chamber pressure in PSI (desired) r = 1; % Fuel/oxygen mixture ratio wt = F/Isp; % fuel flow wo = wt*r/(r+1); % flow rate of the oxydizer wf = wt*r/(r+1); % flow rate of the fuel % P...
function dist=contrib2dist(f_matstab,eq,var); % dist=contrib2dist(f_matstab,eq,var); % % Philipp Haenggi load(f_matstab,'geom','stab','termo','A0','AIm','B'); global geom stab kan=geom.kan; kmax=geom.kmax; nvt = geom.nvt; nvn = geom.nvn; dc = length(get_dcnodes); lp = length([get_lp1nodes get_lp2nodes]); core= ...
% A=eye(5); % t=[0:0.1:1]; % y=sin(t); % figure(1); % plot(t,y); % disp(A); % figure(2); % imagesc(A),colorbar,colormap gray; A=zeros(10,1); % for i = 1:10 % A(i)=2^i; % if i==6 % break; % end; % end; % i=1; % while true % A(i)=999; % i=i+1; % if i==6 % break; % end; % end; %...
% shows one (resulting) image % with dots, represanting maches for the particular transformation % with arrows, representin unmaches and the differenses for them % optionalRadius is the accuracy for maches % % default: % optionalRadius = 5 function showImageWithTransformation( im1, im2, trans, table, optionalAccura...
function t_ibs = random_ibs(input, scale) sz = size(input); if( isempty(scale) ) scale = 0.2; end t_ibs = double(input) + 1 * scale * (rand(sz(1), sz(2))-0.5); end
function [index] = feature_eval(X,Y) fprintf('======================================================\n'); fprintf('Running feature evaluation \n\n'); % separate negative and positive cases x1 as diabetic and x2 non-diabetic index_t = find(Y==1); index_f = find(Y==0); x1 = X(index_t,:); x2 = X(index_f,:); %% ==== his...
clear all,close all %构造原始图像 img=zeros(512,512); % 512 x 512 黑色 img(136:376,246:266) = 1; % 16 x 240 白色 figure(1) %% 原始状态 subplot(2,4,1);imshow(img); title('原图像'); %======================================================================== %原始图像的傅里叶频谱 F1=fftshift(abs(fft2(img))); % fft2(): 二维傅里叶变换,结果为复数类型 % abs...
% plot fuer hm2 aufgabe 21 f = @(x,y) e.^(x-y) .* (x.^3 ./ 3 - y); x = linspace(-3, 3, 601); y = linspace(-3, 3, 601); [xx, yy] = meshgrid(x,y); zz = f(xx,yy); surf(xx,yy,zz)
X = [0.25,0.5,0.75,1,1.25,1.5,1.75,2,2.25,2.5]; Y = [1.284,1.648,2.117,2.718,3.427,2.798,3.534,4.456,5.465,5.894]; Matrix = []; for j = 1:length(X) Matrix = [Matrix,[sin(X(j));cos(X(j))]]; end Result = inv(Matrix * Matrix') * (Matrix * Y'); fprintf("a = %.15f,b = %.15f\n",Result(1),Result(2)); Distance = 0; for j =...
classdef Color %Color enumeration Cyan([0,255,255]), Rouge([255,0,0]), Vert([0,255,0]), Jaune([255,255,0]), Bleu([0,0,255]), Magenta([255,0,255]), Blanc([255,255,255]) end properties R, G, B end methods ...
%% We will use minFunc for this exercise, but you can use your % own optimizer of choice clear all close all addpath(genpath('../common/')) % path to minfunc %% These parameters should give you sane results. We recommend experimenting % with these values after you have a working solution. global params; params.m = 100...
% Plots the motor data % Copyright 2006-2009 The MathWorks, Inc. figure('windowstyle', 'docked') plot(rpm,bench,'.-b','MarkerSize',15);hold on line(rpm,expmodel,'color','g','LineWidth',2); plot(rpm,lowerbound,':r'); plot(rpm,upperbound,':r'); legend('Benchmark motor data','Exponential fit',... '95% confidenc...
function [GR, ScopeTypeCell] = apex_waveforms_setup(ScopeType) %APEX_WAVEFORM_SETUP - Setup function for Ztec scopes and other waveforms % % Note % 1. Max Sample Rates - 500 MHz for the ZT4210 series % 400 MHz for the ZT4440 series ScopeTypeCell = { 'Photo Diode' % 'Ztec Scope #1' % 'Z...
function A = genDcube( d, figID) % % A = genDcube( d, figID) ; % d >= 1 % % generate the adjacency matrix A for the d-dimensional % hypercube. % % when nargin > 1, display the generation process % % --------------------------------------------------- % Xiaobai Sun % Duke CS % For Numerical Analysis Class ...
function px_output(ModeName) N = px_varname(ModeName); function [strname] = px_varname(varname) strname = input(varname,'s'); strname = varname; strname = who;
function varargout = edgesEval( model, varargin ) % Run and evaluate structured edge detector on BSDS500. % % This function first runs the trained structured edge detector on every % test or validation image in BSDS then call edgesEvalDir.m to perform the % actual edge evaluation. edgesEval is specific to the structure...
function v=getVertex3D(face,i) % Return vertex i from face. v=face((i-1)*3+1:(i-1)*3+3);
function subGs=AllSubGames(v) % ALLSUBGAMES computes all subgames of the TU-game v. % % % Usage: subGs=AllSubGames(v) % Define variables: % output: % subGs -- The corresponding sub-game of v on S. % % input: % v -- A Tu-Game v of length 2^n-1. % S -- A coalition/set identified by its unique in...
close all DL_prediction; uas_ShiTS_x_48A08AD_prediction; uasKir_DL_x_48A08AD_prediction; labelSize = .05; noiseSize = .05; f1 = figure('Color', 'w', 'units', 'normalized', 'position', [.2 .2 .4 .6]) plot([0 1], [0 1], 'k') hold on %% DL for aa = 1:size(DL_prediction,1) noiseTerm = noiseSize*randn(1); ...
function [ m ] = multi_lags(matrix, lags) % lags is array of different lags for each matrix column m = zeros(size(matrix)); for ii=1:length(lags) m(:,ii) = lagmatrix(matrix(:,ii),lags(ii)); end end
%% %% Copyright (c) 2021, Bradley A. Minch %% All rights reserved. %% %% Redistribution and use in source and binary forms, with or without %% modification, are permitted provided that the following conditions are met: %% %% 1. Redistributions of source code must retain the above copyright %% noti...
function [LRcomp, DUcomp] = RGBcompatibility(patches) sigmaSq = 0.2; s=size(patches); LRcomp = zeros(s(1),s(1)); DUcomp = zeros(s(1),s(1)); for i=1:s(1), for j=1:s(1), DUcomp(i,j) = sum(sum((patches(i,1,:,:) - patches(j,s(2),:,:)).^2./sigmaSq)); %compatibility of patch i to be at the left of patch j ...
function X = Nonlinear_Triangulation(K, C1, R1, C2, R2, C3, R3, x1, x2, x3, X0) %% Nonlinear_Triangulation % Refining the poses of the cameras to get a better estimate of the points % 3D position % Inputs: % K - size (3 x 3) camera calibration (intrinsics) matrix % x % Outputs: % X - size (N x 3) matrix o...
function [K, R, t, error] = runGoldStandard(xy, XYZ, IMG_NAME) normalize = 1; if normalize disp("Run with NORMALIZED data.") %normalize data points [xy_normalized, XYZ_normalized, T, U] = normalization(xy, XYZ); xy = vertcat(xy, ones(1, size(xy,2))); XYZ = vertcat(XYZ, ones(1, size(XYZ,2))); %...
%% Section 3 %Data management CD = readmatrix('car_data.xls'); %Formats command window to more readable numbers format long g %Deletes column 9, all values are missing CD(:,9) = []; %Creates new matrix without any missing values % CD=CD(~any(ismissing(CD),2),:); <-alternative CD = Deletion(CD); %% Tr...
function neuron_rate_plot(R, pop_ind, neuron_ind, seg, seg_size) sigma_gaussian = 50; % ms, which is width??? % Input check and default values if nargin < 5 seg_size = 4*10^4; % 2*10^4 for 2-pop, segmentation size for each plot end if nargin < 4 seg = 1; end % Dump fields dt = R.dt; step_tot = R.step_tot; ...
function [y,x,n,T,num_regress]=set_y_and_x(datay,datax,nlags,constant) % H1 line % % Syntax % ------- % :: % % Inputs % ------- % % Outputs % -------- % % More About % ------------ % % Examples % --------- % % See also: [n,smpl]=size(datay); if (~all(isfinite(datay(:)))) ||... (~isempty(datax) && ~all(isfini...
%---------------------------------------- %此程序用以仿真导弹导引系统 %作者: Jiangfeng %日期: 2011.4.11 %---------------------------------------- function [q]=guidance(sitemandt) sitet=sitemandt(1:3); sitem=sitemandt(4:6); xm=sitem(1);ym=sitem(2);zm=sitem(3); xt=sitet(1);yt=sitet(2);zt=sitet(3); qtheta=(yt-ym)/sqrt((xt-xm)^2+(zt-zm)^2...
function addVertices(scale) %ADDVERTICES - Add SAF vertices to the current plot % % ejovo.saf.addVertices(SCALE) adds SAF vertices to the current plot whose outer % most radius is SCALE. % % See also rot2saf, rot2vdb, plotSAF % function [u, v, w] = loadVertices() parent = ejovo.fn.getParentDir; ...
clear all m = []; error = []; % Adaptive Markov Chain Monte Carlo: Theory and Method Atchad % An Adaptive Metropolis Algorit Haario %% dt = C dx % Lax-Wendroff (temporal_error_LaxWendoff_dx.txt) nts( 1 ) = 2048 ; error( 1 ) = 2.3354105808755108E-002 nts( 2 ) = 4096 ; err...
%BCSBACKTEST2 BlueChipStock backtest analysis addpath ./source load BlueChipBacktest0 load BlueChipBacktest RefIndex = 45; % no adjustment [NumMonths, NumAssets] = size(RetHistory0); NumStocks = NumAssets - 3; NumPortfolios = 40; Periodicity = 12; NumPeriods = floor(NumMonths/Periodicity); StartI...
function [] =combine_output_eq(ID,type_sim) global par maps dim qom const %combine_input_files Function that files from processors in equilibrium. % Combines files written by format compact %% Looking for files if nargin==0 ID='1915611'; type_sim='prec'; elseif nargin==1 type_sim='full'; end evaluate_...
clear; clc; close all; addpath(genpath('meanShift')); datapath = 'flo'; %flo文件目录 filenms = dir(fullfile(datapath,'*.flo')); %读取目录下所有flo文件的文件名 % for i = 1:length(filenms) %对所有文件进行处理 for i = 1:5 %对前2个文件进行处理 file = fullfile(da...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % 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 [mod, bit, sym] = createdemodulator(Ns,M) %CREATEMODULATOR(Ns,M) % Ns = no. symbols % M = no. symbols in constellation B = log2(M); bit = Bit(1,Ns*B); sym = Discrete(0:M-1,1,Ns); mod = FactorGraph(bit,sym); for i=1:Ns mod.addFactor(@fn_demod,bit(B*(i-1)+1:B*i),sym(i)); end
function imgt = thres(imgmag, hthres) [imax, jmax] = size(imgmag); imgt = imgmag; for i=1:imax for j=1:jmax if imgmag(i, j) < hthres imgt(i, j) = 0; else imgt(i, j) = 1; end end end
close all hidden; clear all hidden; clc; cd('E:\DATA\Test\Lateralization'); fname = 'temporaldata'; load(fname); %% Mean over subjects & conditions a = M.matrix; mf = M.modulation; MF = squeeze(mf(1,:,1)); mu = mean(squeeze(mean(a)),2); nsubjects = size(a,3); ncond = size(a,1); nf = size(a,2);...
%% Histograma/Probabilidade da diferen?a entre os finais das tramas dos utilizadores licenciados PU1 e PU2, em "single frame" clear all; close all; %% SU 1 T_PU_ON_1 = 1e5; % # tramas PU 1 T_PU_1 = T_PU_ON_1*2; mu_on_1 = 5; % tempo medio ON PU 1 mu_off_1 = 5;...
% Parameter Estimation and Inverse Problems, 3rd edition, 2018 % by R. Aster, B. Borchers, C. Thurber % % return l curve parameters and models for truncated gsvd regularization % % [rho,eta,reg_param,m] = l_curve_tikh2(U,d,X,Lam,Mu,G,L,npoints,[alpha_min, alpha_max]) % % U, X, Lam, Mu are obtained from the gsvd of the ...
function [gmm, A] = getSiftGMM(siftTrainData,kd,nc) load = pca(cast(siftTrainData,'single')); A = load(:,1:kd); lowDdata = cast(siftTrainData,'single')*A; [gmm.m, gmm.s, gmm.p] = vl_gmm(lowDdata', nc); end
function [success] = submit(filename, TSName) success = false; if ~exist('filename', 'var') disp('Please specify a file for uploading!'); return; end if numel(filename) >= 2 if ~strcmp(filename(end-1:end),'.m') filename = [filename '.m']; end end if ~exist(filename, 'file') ...
%% % implementation of the path planning algorithm RRT* with obstacles on a 2D grid % parameter varation: stepsize, y_RRT, w_1, w_2 % Johann Diep, 6 May 2016, Focusproject Scubo %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
figure boxplot([new11',new6',new1',new12',new7',new2',new13',new8',new3',new14',new9',new4',new15',new10',new5'],... 'labels',{'S 1','S 2','S 3','S 4','S 5','S 1','S 2',... 'S 3','S 4','S 5','S 1','S 2','S 3','S 4','S 5'},'OutlierSize',1) % boxplot([new11,new6,new1,new12,new7,new2,new13,new8,new3,new14,ne...
function defaultFigLayout(hFig, cbNew, cbOpen, fhExport, editCallbacks) % Add menus and toolbars for standard SPARTAN figures. % % defaultFigLayout(FIG) modifies the appearance of the figure FIG to match % the style of typical SPARTAN functions. Some rarely used menus and toolbar % buttons are removed. % % defa...
function images = load_images(str) % str: string of the foldername containing images % images: all images % - height x width x rgb x num_images % % TASKS: - remove MAX_NUM_IMAGES to make code robust % MAX_NUM_IMAGES = 100; cd(str); for i=1:MAX_NUM_IMAGES file = sprin...
% demonstrate reading data from a file using textscan (pg 338) fid1=fopen('data1.txt','r'); b=textscan(fid1,'%1d'); b{:} fclose(fid1);
function dec_encipheredText = caesarCipher( inText, cipherMode ) %CAESARCIPHER Summary of this function goes here % Detailed explanation goes here cipherModeChoices = {'ENC', 'DEC'}; caesarShiftDefault = 3; whiteSpaceValue = 32; offsetAsciiCharValue = 65; charContents = upper(inText); % with whitespace charCo...
function exitcode = merge(self, clustIds, varargin) % Merge the specified clusters into a single cluster % exitcode = merge(self, clustIds, ...) % % Returns: % exitcode Numeric code indicating the outcome of this procedure: % 0: Completed successfully (only possible outcome) % Required a...
%% Code for running STAS methodology for the paper in JMS %% Copyright 2019 <Authors> % Permission is hereby granted, free of charge, to any person obtaining a % copy of this software and associated documentation files (the "Software"), % to deal in the Software without restriction, including without limitation % t...
% % Copyright (c) 2015, Yarpiz (www.yarpiz.com) % All rights reserved. Please read the "license.txt" for license terms. % % Project Code: YPEA124 % Project Title: Implementation of MOEA/D % Muti-Objective Evolutionary Algorithm based on Decomposition % Publisher: Yarpiz (www.yarpiz.com) % % Developer: S. Most...
clear % mb = load('~/Modeling/modeling_results/2019-04-13_synaptic_depression_param_workspace/2019-04-13_synaptic_dep_batch_workspace.mat'); mb = load('/n/scratch2/anb12/modeling_results/2019-04-24_unnormalized_synaptic_depression_param_workspace.mat'); param = mb.param; paramD = mb.paramD; nModels = mb.nModels; saveDi...
function ynew=adsmoothdiff(dados,xnew,sdx,isdx,q,nmin) % % function ynew=adsmoothdiff(dados,xnew,sdx,isdx,q,nmin) % written by Carlos J Dias % % ADAPTIVE DEGREE SAVISTZKY-GOLAY SMOOTHING AND DIFFERENTIATION % This function smooths and differentiates a sequence of numbers based on % an algorithm drawn on the idea...
function [output] = list_folder() % Function that generates a list of the existing folders in a directory. files=dir; n=1; for m=1:length(files) if files(m).isdir==1 output(n)=files(m); n=n+1; end end end
function fnval = exp_Cproc(coefs,bvals,pars,more) devals = exp(bvals.bvals * coefs); ddevals = (bvals.dbvals * coefs)*devals; % colnames(devals) = more.names; % colnames(ddevals) = more.names; % names(pars) = more.parnames; f = more.fn(ddevals,more.qpts,devals,pars,more.more); fnval = sum(f); end
function options = hampathset(varargin) % hampathset -- Sets options for hampath packages. % % Usage % options = hampathset(name1, value1, ...) % % Or % options = hampathset(oldopts, name1, value1,...) % creates a copy of oldopts with the named parameters altered % with the specified values. % % Inputs % name1 ...
% function digCode(codes) % % outputs digital codes to the bytes FIRSTPORTA and FIRSTPORTB, sending % sync pulses to the first bit of FIRSTPORTC. Can send a vector of doubles % or characters. % % recompile with this command: % mex digCode.c cbw32.lib
% A quick alternative to MATLAB's randperm function p = randpermquick(n) p = 1:n; r = rand(1, n); randpermquick_helper(p, r); end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % 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#...
%% quanitfy_global_spectra_20180121 % file created by Mehrdad Pourfathi on 2/18/2016 % % update(1) on 9/7/2016 by MP to include transplant data % % update(2) on 9/13/2016 by MP to use steve's fits for ratio measurements % and saves individual ones. % % update(3) on 9/14/2016 by MP now has the option to do the voxel se...
function results = gab_task_fmri_make_con(args) if ~iscell(args.spmmat) args.spmmat={args.spmmat}; end if ~isfield(args,'delete')||isempty(args.delete); args.delete=1; end if ~iscell(args.conName) args.conName={args.conName}; end if ~iscell(args.convec) args.convec={args.convec}; end if ~isfield(args,'...
function [aa,bb] = split_consecutive(a) % a is a vector of integer indeces, and we find consecutive parts % this is harder than it looks for some reason... % % % % % s = find(diff(a)~=1); % %s = [0;s]; % if ~isempty(s) % aa = cell(1,length(s)); % bb = []; % aa{1} = 1:s(1); % s = [s;length(a)]; %...
function show_results(RT, y_KN, y_CN, titel, saim_type, plot_flag) set_plot_default; iptsetpref('ImshowBorder', 'tight') iptsetpref('ImshowAxesVisible','on') hf = figure; set(hf, 'position', [1 1 770 450]); if plot_flag == 0 ax = subplot_tight(2,6,1); axis([0 1 0 1]); text(0.1,0.5, [...
function [norm_file_tt, norm_file_tr] = pattern_softmax_norm_cvip(file_tt, file_tr, file_out, r, count) % PATTERN_SOFTMAX_NORM_CVIP - two csv files are input, training and test % sets, and returns new csv files with the feature vectors normalized with % softmax scaling normalization % % Syntax : % ------- % [...
function RS_POS = GEN_RS_POS(PCI,RBs,TxAnt) RS_POS = zeros(1,RBs * 2); vp0 = 0; vp1 = 3; v_shift = mod(PCI,6); rs_shift0 = mod((vp0 + v_shift),6); rs_shift1 = mod((vp1 + v_shift),6); rs_pos_0 = rs_shift0:6:(RBs * 12 - 1); rs_pos_1 = rs_shift1:6:(RBs * 12 - 1); ...
function [x] = myfunc(a) x = plot(a); %KASS KOD color = 'none'; if (max(a)-min(a)) >= 0.05 color = 'red'; text(100, mean(a), 'Subject is moving, waiting for stabilizing', 'Color', color, 'Fontsize', 32); title('Plot av "Spine"-djup') xlabel('Tid/"frames"'), ylabel('Djupvärden [m]'); meanvalue = mean(a); ylim([min(...
% lisalOptions is a structure with fields { 'm1', 'm2', 'c', 'infCriterion' % , 'isExli', 'exliRatio' } % % m1 - number of latent locations learned in the preliminary selection % under LISAL by maximizing information on real dynamics instead of latent % dynamics. % % m2- number of latent locations learned in ...
function [mu, sig] = EKF_est(I, Model, c_sun, dt, t) %function outputs estimatations of state and covariance matrix at each %point in time. Inputs are the model values and the sun unit vector %measurments. Angular velocities are assumed to come directly from the %model. %moments of intertia I = diag(I); Ix = I(1); Iy...
% characterize Characterize measurement region. % % This method characterizes a time-frequency region in a PDV measurement. % object=characterize(object,mode); % Several characterization modes are supported: % -'reference' determines the reference frequency. % -'noise' determines the noise amplitude (and spect...
function P = demo_generalizedRieszTransformLearning(A, numScales, order, steeringType, equalizationType, equiAngular, showFilters) %DEMO_GENERALIZEDRIESZTRANSFORMLEARNING learn a generalized Riesz-wavelet %frame using principal component analysis % % P = DEMO_GENERALIZEDRIESZTRANSFORMLEARNING() % Learn a generalized R...
function [ke] = elemstiff(node,x,y,gauss,lambda,mu,e) % 2d QUAD element stiffness routine ke = zeros(8,8); one = ones(1,4); psiJ = [-1, +1, +1, -1]; etaJ = [-1, -1, +1, +1]; % plane stress D matrix young = mu(e)*(3*lambda(e)+2*mu(e))/(lambda(e)+mu(e)); pr = lambda(e)/2/(lambda(e)+mu(e)); fac = young/(1 - ...
%% a) Correr simulador1 10 vezes com critério de paragem P=10000 P = 10000; l = 1800; C = 10; f = 1000000; %Number of simulations N = 10; PL = zeros(1, N); APD = zeros(1, N); MPD = zeros(1, N); TT = zeros(1, N); for i = 1:N [PL(i), APD(i), MPD(i), TT(i)] = Simulator1(l,C,f,P); end alfa = 0.1; ...
function myPipe = block_split_pipeline(varargin) % BLOCK_SPLIT_FILES - Splits raw data files into single 30 min block files % % See also: btmn.pipes import meegpipe.*; import physioset.*; nodeList = {}; %% NODE: import from .mff file. myImporter = physioset.import.mff('Precision', 'single'); myNode = meegpipe.node.p...
% ---------------------------------------------------- %% Route Planner % ---------------------------------------------------- % ---------------------- % initial and final conditions % ---------------------- x0 = initPose(1); % [m] y0 = initPose(2); % [m] theta0 = initPose(3); % [rad] startPose = [x0, y0...
% This script demonstrates how to use the code provided in this project to % stabilize a Kalman Filter. % % This script will reproduce results of a single-day closed-loop % experiment, as described in the original paper. % % Note: The code below assumes you are in the main project directory (the % directory containi...
data = readSalesFigures(); [datesPeriods, salesPeriods, tempPeriods] = preprocessData(data, data.Bread); periodSlopes = []; ##plot(data.Days, data.Salad, "*"); ##hold on; for periodIndex = 1:size(datesPeriods, 1) datesPeriod = datesPeriods(periodIndex, :); salesPeriod = salesPeriods(periodIndex, :); ...
function writeStructArrayToCSV(fname, S) fid = fopen(fname, 'w'); if fid == -1 error('Could not open %s for writing', fname); end fields = fieldnames(S); nFields = length(fields); nEntries = length(S); % write fieldnames for iF = 1:nFields fprintf(fid, '%s', escapeValue(fields{iF})); fprintf(fid, ','); ...
close all clc warning off %% load single files dataPath = '..\Signal\M3C\'; files = dir(fullfile(dataPath,'*.mat')); for loop=1:length(files) y = importdata(strcat(dataPath, files(loop).name)); avg =mean(y,2); y = avg; figure; plot(y); waitforbuttonpress; end
clear all; close all; dataset = 'VOC2012'; %copy berkeley annotations orig_folder = '../Berkeley_annot/dataset/cls'; save_folder = ['../', dataset, '/SegmentationClassAug_Visualization']; if ~exist(save_folder, 'dir') mkdir(save_folder) end tmp = load('pascal_seg_colormap.mat'); colormap = tmp.colormap; annots...
original = imread('crayons.jpg'); mosaic = imread('crayons_mosaic.bmp'); reconstructed = demosaic(mosaic); imshow(reconstructed); error = (reconstructed - original).^2; error = sum(error, 3); figure; imshow(error, [min(error(:)) max(error(:))]); avg_per_pixel_sse = mean(error(:)) max_per_pixel_sse = max(error(:))
function [prec]= get_precision(Yte , Yval) % USAGE function [prec_disc, prec_rej]= get_precision(vect_ytest,mat_ypred_val) % % vect_ytest est un vecteur donnant le label de chaque individu % mat_ypred_val est la matrice donnant la confiance de l'appartenantce de chaque individu dans chaque classe if iscell(Yte) pr...
% Function to open the large text file of year long data and divide into % small text files of one year (technically 8months) % INPUTS: % textfile = text file name (massive file of all data per station for year) % must be a string, can be .dat file % month = desired month % day = desired day % year = desired...
%% OM %% cur_dir = pwd; temp_list = dir; for i=1:length(temp_list) if isfolder(temp_list(i).name) course_name=temp_list(i).name; end end course_dir = fullfile(cur_dir, course_name); cells_dir = fullfile(cur_dir, sprintf('cells_%s', course_name)); if exist(cells_dir, 'dir') delete(sprintf('%s\...
function[BestFirstMeans,WorstFirstMeans,BestSecondMeans,WorstSecondMeans,AllMeans,... AllNormality,BestNormality,WorstNormality,AllGroups,BestGroups,... WorstGroups,BestWorstDiff,FirstDiff,SecondDiff,FirstSecondDiff,... EleRecognitionMeans,EleRecog]=CompileLocalisationMeans(iccData,source) %COMPIILELocalisa...
function [eta_1d, eta_alt, eta, Ee, Ie, Ic, Jd, Je, Jc, res_norm, grad_phi, phi_last, f_new, phi_lap] = ... EHDsolverf(p,e,t,r_e,r_c,d,kV,U,meshdomain,rho0,max_iter,first_it,phi,Sext,pbdry) %% declare global variables global do_flow plot_debug no_flux %% set other parameters mu = 2*10^-4; epsi = 8.85418...
%% Parameters inputFilename = '20170303-115128-001.ns5'; inputFilepath = 'C:\Users\deudon\Desktop\SpikeSorting\_Data\CP15-Screening_20170303-115128'; resultsDirOri = 'C:\Users\deudon\Desktop\SpikeSorting\_Results\NoiseEstimation'; frameDuration = 60; % Sec overlap = 80; % Percent fMinHz ...
function Out = close_jh_scrapers(Command) % % % See also open_jh_scrapers if nargin < 1 Command = 'Set'; end % Note: use EPICS NoWaitFlag=1 % setpvonline(ChannelNames, NewSP, 'double', NoWaitFlag) Top = getproductionlattice('TOPSCRAPER'); Top = Top.Setpoint; ChannelNames = family2channel(Top.FamilyName, Top.Fie...
% Andrew Brown Lab 3 Problem 2 clc clear clf %How to save values you calculate in your for loops so you can plot them %later %Define given variables totalSum=0; n=10; saveSums=zeros(1,length(n)); saveDays=zeros(1,length(n)); %For loop counting from 1 to 10 going up for k=1:n if k==1 %use proper grammar for the ...
function [t,p]=solve_advDif(p, A1, A2, A12, t, ch, scheme) H = size(p,1); W = size(p, 2); dt = t(2)-t(1); tic() p_ch = reshape(p(:,:,ch)', H*W, 1); %ADI scheme assert(strcmp(scheme, 'ADI')||strcmp(scheme, 'OS')); if(strcmp(scheme, 'ADI')) % Second-order accurate scheme (not suitable for problems with A12(mixed d...
cd /home/caromk/simdata/rand_med1/ filename = 'rand_med1M'; load(filename); addpath('~/neuranalysis/SpikeSort/') addpath('~/neuranalysis/Opt/') addpath('~/neuranalysis/SimTraces/SortEval/') for count = [50 1700:100:2000 123 100:100:400] CT = subsetT(CT,1:count); save('-v7.3',sprintf('%s_%d.mat',filename,coun...
% clear % close all load('figures/PSD_64QAM_M1024_m2.mat');%, 'psdCos', 'psdOFDM', 'fOFDM', 'fCos') %fbmc load('figures/PSD_FBMC_M1024.mat')%, 'fFBMC', 'sumFBMCSpec') % hFig1 = figure('Position', figposition([46 15 30 30])); figure; plot(fOFDM,pow2db(psdOFDM),'linewidth',2); hold on plot(fCos,pow2db(psdCos),'linew...
function func_grid_generator() % This routine generates the grid of points needed to compute any Safe Set % or Asymptotic Safe Set for a flow. It needs to be given the following % paramenters to work properly: % % xi,yi,xf,yf: the corners of the square where we want to find the safe set. % N: t...
clear all; close all Italy_Infected_All =[]; Italy_Recovered_All = []; Italy_Dead_All = []; str1 = "Italy" str2 = "Italy" str3 = "Italy" for i = 27:29 fname = strcat ( '02-', num2str(i), '-2020.csv' ); P = readtable(fname); A = P.Country_Region; Array = strings(1, length(A)); for j = 1:length(A) Arr...
function [ next_row, next_col ] = next_state_Q3( curr_row, curr_col, action ) %UNTITLED5 Summary of this function goes here % Detailed explanation goes here deltaY = action(1); %change in x direction = change in column number deltaX = action(2); %change in y direction = change in row number next_row = max(curr_row...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Trim the aircraft %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% flight_data V_trim = 125; alt0 = 1000; alpha_0 = 1*pi/180; % this is an estimate, but it's not used beta_0 = 10*pi/180; gamma = 0*pi/180; phi_0 = 0/180*pi; de = 0; da = 0; dr = 0; dp = 0; [X0,de,dp,dr,da] = aero4500_...
clear all N=20; xmax = 2; x = linspace(-xmax,xmax,N); y = 10.^x; z = 1-0.9*exp(-sqrt(y)); errz = abs(randn(1,N)).*0.8.*z; dlmwrite('tmp.dat',[y',z',errz']," ")
function varargout = MRERECONSTRUCT(varargin) % CAT_MRI_AXES2 M-file for CAT_MRI_AXES2.fig % CAT_MRI_AXES2, by itself, creates a new CAT_MRI_AXES2 or raises the existing % singleton*. % % H = CAT_MRI_AXES2 returns the handle to a new CAT_MRI_AXES2 or the handle to % the existing singleton*. % % ...
function vic(inputFile) %% =======================================================================% % Preamble % ========================================================================% close all; fclose all; clc; profile off; diary off; % Add paths to the source code if ~isdeployed % add folder to ...