text
stringlengths
8
6.12M
function [A,V,Pos,t,sensores,G,Mag,tmag]=cadera(str) %Todos los datos deben estar en la misma carpeta. Ir a "HOME"->"Set Path"->Elegir carpeta con los datos %Los archivos de los datos deben estar en .csv %prompt = '¿Nombre del Archivo? '; %str = input(prompt,'s'); % convierte el nombre del archivo ingresado en ...
clc, clear all,close all t = 11:0.01:12; dt = (t-11); a = -1; b = 0; % y1 =(a*(dt).^3) y1 =(a*(dt*.415).^3)-0.15 plot(dt,y1)
[x, y, sensitive, training, test] = dataImport.importAdultData(); folds = 1; %x = [x sensitive]; % introduces disparate treatment (is redundant for Compass data) classifier = classifiers.AdaptiveWeights(classifiers.SimpleLogisticClassifier(0.0001)); accs = 0; pRules = 0; DFPRs = 0; DFNRs = 0; %validationFunction = @...
function [out1,analyticProblems,discont,ignore,maxderiv] = deriv(net,X,Xi,Ai,T,EW,MASK) %DERIV Test network subfunction derivatives. % % [numericProblems,analyticProblems,discont,ignore,maxderiv] = deriv(seed) % [numericProblems,analyticProblems,discont,ignore,maxderiv] = deriv(net,X,Xi,Ai,T,EW,MASK) % % This function ...
% make a red/blue colormap with nrblevels number of different levels % may be incompatible with some matlab versions, % hence this function is deprecated and no longer % called by any of the visualization functions function rstring = make_rbcmap(nrblevels) if nargin < 1 nrblevels=1024; end rbcmaple...
function [PathStore_apres,PathStore_apres_sep]=traitement_arrete_high_density(Path_num,D,numrobot) % disp('进行等待处理') % croise=[]; % % m_size=size(D,1); % n_size=size(D,2); % % for x= 1:m_size % for y=1:n_size % % [x,y]=spread_sin(i,n_size); % if x==1 % if D(x+1,y)==0 % cro...
clc; clear; % Ejemplo de Convolución en 1D x = rand(500, 1); y = rand(150, 1); y = [5 6 7 8 9 10 11]; m = length(x); n = length(y); z1 = zeros(1, m + n - 1); % Calculo de la convolución a mano tic for i = 1 : m + n - 1 % Recorre cada entrada de z v_ini = max([1 (i + 1 - n)]); v_fin = min(i, m); for j = v_ini :...
%% isss_multiband.m % Script to run for pilot scans comparing ISSS, multiband, and the new % hybrid scanning protocol. Ported from my previous ISSS_test script. % Author - Matt Heard %% Startup sca; PsychPortAudio('Close'); clearvars; clc; codeStart = GetSecs(); cd .. direc = pwd; InitializePsychSound %% Parameters ...
function La = f_vonBert_La(Lmax) % - calculate La parameter for the von Bertalanffy growth function % % USAGE: La = f_vonBert_La(Lmax); % % Lmax = maximum observed total length (in millimeters) % La = theoretical asymptotic length % % SEE ALSO: f_vonBert % -----References:----- % Pauly, 1980 (in Martinez-Andrade, 2...
clear all; addpath('image');addpath('image/inst'); load('data.mat'); % load filter bank load('dictionary.mat'); % load dictionary %-------------------------------------- % YOUR CODE STARTS HERE %-------------------------------------- %path for your selected image img_path = 'myBasilica.jpg'; %read the image I = im...
function mpcN = create_multi_time_step_case_file(mpc0) N = length(mpc0.load_profile(:,1)); nnodes = size(mpc0.bus,1); % Nb nbranches = size(mpc0.branch,1); % Ng ngens = size(mpc0.gen,1); if not(min(mpc0.bus(:,1) == (1:nnodes)')) error('buses not properly ...
function pcode = compute_part(obj, assign, poolpos, locs, anchors, radius) %COMPUTE_PART Summary of this function goes here % Detailed explanation goes here bottom = anchors - radius; top = anchors + radius; blk_count = size(anchors, 2); encode_len = obj.encoder_.get_output_dim(); pcode = zeros(encode_len,...
% Group analysis of tapping coherence PD-CKC . Takes individual coherence % and gives group level average % clear all % close all addpath /home/mikkel/PD_motor/global_scripts [dirs, sub_info, lh_subs] = PD_proj_setup('tap'); addpath /home/mikkel/matlab/export_fig/ cd(dirs.megDir); subs = dir(dirs.megDir); ...
%% Old defining batteries %% Defining battery as MLD system using a for-loop x_b1 = zeros(1,dim.t+1); x_b2 = zeros(1,dim.t+1); z = zeros(1,dim.t); u_b = [0.5 0 0.1 3 5 1 1 0 1 1]; s_b = [1 1 1 1 0 0 0 1 0 1]; for k = 1:dim.t if u_b(k) <= parB.u_up*(1-s_b(k)) if u_b(k) >= eps + (parB.u_low-eps)*s...
clc clear all %% % loading parameters needed for running simscape simulation load('parameters.mat') %% % motion planning for simscape simulation %plynomianl 3 4 5 a = 6; b = -15; c = 10; d = 0; e = 0; f = 0; tf = 1; Ts = 0.0001; T = 0 : Ts: tf; beta = atan(128/24); % initial theta : theta_i = [0 ; 0 ; 0 ; 0 ]; % fina...
% used to connect to fserver and parse frames, assumes default output % records and that the tracker is a Fastrak (any version) function di_stream = fst_startTracking(host_str, port_num) % use java Socket and DataInputStream classes import java.net.Socket import java.io.* % connect to the sock...
clear all clc clf %% outline %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % plot the train result result % bla bla %% main %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % load data --------------------------------------------------------------- % load Mat_cluster_pred_int.m...
results_ENS=struct(); results_ENS_raw=struct(); for treat=1:3 for dpf=3:7 idx_temp=ZS_guts{treat,dpf-2,2}; for fish_nb=1:max(unique(idx_Fish(idx_temp))) ZS_temp=ZS(idx_temp(idx_Fish(idx_temp)==fish_nb),:); if ~isempty(ZS_temp) Sm=smooth_ZS_fish{treat,dpf-2,fis...
function [res,Fnet,Mnet,AR,ct1,ct2,ct3,ct4,cq1,cq2,cq3,cq4] = Solve(trmvar,V,Btm,Vver) TO1 = trmvar(1); TO2 = trmvar(2); TO3 = trmvar(3); TO4 = trmvar(4); lambda1 = trmvar(5); lambda2 = trmvar(6); lambda3 = trmvar(7); lambda4 = trmvar(8); alphas = trmvar(9); phis = trmvar(10); sis =0; p=0;q=0;r =0; Tfp = 0; Btmdo...
function varargout = Controls_CollectData(varargin) %CONTROLS_COLLECTDATA M-file for Controls_CollectData.fig % CONTROLS_COLLECTDATA, by itself, creates a new CONTROLS_COLLECTDATA or raises the existing % singleton*. % % H = CONTROLS_COLLECTDATA returns the handle to a new CONTROLS_COLLECTDATA or th...
%------------------------------------------------------------------------------% %%%%%% Training a Quantized Neural Network using Differential Evolution %%%%%% %------------------------------------------------------------------------------% %%% Author: Ranitha Mataraarachchi %%% Date: 03.10.2019 %-------------...
%function QUAD0 = scandispquad % function QUAD0 = scandispquad QUADFamily = 'QFC'; % Master Osillator Starting Point QUAD00 = getsp(QUADFamily); BPMStraightSection = []; % Get Dispersion %[Dx,Dy] = measdisp; %Dx=Dx(BPMStraightSection); i = 0; for DeltaAmp=[0 .2 .4 .6 .8 1 1.2 1.4 1.6 1.8 2] i = i + 1; QUADne...
function [datapatches] = ExtractPatchesByIndexGabor(bandnum, Index,patchsize,datasetname ) %UNTITLED4 Summary of this function goes here % Detailed explanation goes here padx = fix(patchsize(1)/2); pady = fix(patchsize(2)/2); offsetx = padx * 2; offsety = pady * 2; feaNum = numel(Index); pdim = patchsize(1)...
clc; clear; close all; a=imread('cameraman.tif'); b=imadjust(a); c=histeq(a); d=adapthisteq(a); i=[a b c d]; figure, imshow(i); title('Orginal image and Enhanced Images using "imadjust", "histeq", "adapthisteq"');
function vector_script(p0,p1,c,alpha) x0 = p0(1); y0 = p0(2); x1 = p1(1); y1 = p1(2); p = p1-p0; hu = [x1-alpha*(p(1)+alpha*(p(2)+eps)); x1; x1-alpha*(p(1)-alpha*(p(2)+eps))]; hv = [y1-alpha*(p(2)-alpha*(p(1)+eps)); y1; y1-alpha*(p(2)+alpha*(p(1)+eps))]; plot([x0;x1],[y0;y1],c,...
function collection=data_export(choices, export_path, raw_data_struct) choices_size=size(choices); height=choices_size(2); %%Choose only relevant data for i=1:height data=raw_data_struct(choices(i)).data; data.ts=posixtime(data.ts); uuid=raw_data_struct(choices(i)).uuids; collection(i).data = data; ...
function [ solver, c ] = rule( class1, class2, pr, mod ) %RULE Summary of this function goes here % Detailed explanation goes here % clc; % ws = load ('classes.mat'); % pr = 10; % 5 <; 7 <; 9 <; % class1 = ws.class1(:, 1:pr); % class2 = ws.class2(:, 1:pr); % Amain(class1, class2, pr) % mod = true; class = [class1; cl...
function [] = func(temp,i,j) files = importdata('list.txt'); videos = importdata('index.txt'); str = sprintf('%s ',videos{i}); if j == 1 % disp('re'); str = sprintf('%s %s',str,'re'); end if j == 2 % disp('pr'); str = sprintf('%s %s',str,'pr'); end if j == 3 % disp('fm'); str = sprintf('%s ...
function [ e ] = appProp( imin, g, w ) %APPPROP an implementation of "all-pairs appearance-space edit propagation" % im, input image in Lab color space and m-by-n-by-3 dimension % g, a vector user specified edits' parameters % w, a vector holds user specified strength of g, range in [0,1] % imout, output image,...
function output_mask = slic_segment(svm_I, em_I) em_I = rgb2gray(em_I); em_I = imresize(em_I, 0.2); svm_I = im2double(svm_I); em_I = im2double(em_I); segments = vl_slic(single(em_I), 20, 100); output_mask = zeros(size(em_I)); for seg=0:max(segments(:)) segment = svm_I( segments==seg ); %if sum(segment)/numel(...
Spain_Infected_All =[]; Spain_Recovered_All = []; Spain_Dead_All = []; str1 = "Spain" str2 = "Spain" str3 = "Spain" for i = 7:1:9 fname = strcat ( '03-0', num2str(i), '-2020.csv' ); P = readtable(fname); A = P.Country_Region; Array = strings(1, length(A)); for j = 1:length(A) Array(j) = A{j}; end inde...
%%skrypt uczacy modele neuronowe dla zadania 5 clear; close all; nB = 5; tau = 6; nA = 2; n = 400; tol = 0.00001; algorytm_uczacy = 1; tryb_uczenia = 2; tryb_symulacji = 2; K_wektor = 9; ilosc_prob = 10; dane_ucz = readmatrix('dane.txt'); u_ucz = dane_ucz(:, 1)'; y_ucz = dane_ucz(:, 2)'; dane_wer = readmatrix('dane_...
function animacja0 %Matlab umożliwia bardzo łatwe tworzenie animacji wykresów. %Każde polecenie plot generuje nowe okno. % Zawartość tego okna można przy pomocy polecenie % getframe zapisać np.: w tablicy. % Utworzoną tablicę odtworzamy % wykorzystując polecenie movie(). for k = 1:16 plot(fft(eye(k+16))) axis equal M(...
classdef (Sealed) UTestLamg < amg.AmgFixture %UTestLamg Unit test of the LAMG wrapper class. % This class tests the runCycleAcf() function via the wrapper class % Lamg. % % See also: runCycleAcf. %=========================== PROPERTIES ============================== properties (Co...
function [x, itr] = newton_constrained(x, f, g, G, H, Dg, Hg, e, ~, ~) %Constrained Newtion itr = 0; %initialize iteration counter eta = .1; numV = length(x); % number or variables numC = size(g(x),1); % number of constraints / dual variables stopVal = inf; %stopping ...
function bisQ=belongToImputationSetQ(v,x) % BELONGTOIMPUTATIONSETQ checks if the payoff x belongs to the imputation set % using MPT3. % % Usage: bisQ=belongToImputationSetQ(v,x) % % % Define variables: % output: % bisQ -- Returns true (1) if x belongs to the imputation set, % otherwise false (0). %...
function ArmDemo( maxepisodes ) global TxtEpisode goal f2 grafica clc statelist = BuildStateList(); % the list of states actionlist = BuildActionList(); % the list of actions nstates = size(statelist,1); nactions = size(actionlist,1); Q1 = BuildQTable( nstates,nactions ); % the QTable Q2 ...
function [p0,yfit] = fit_EIT_narrow(w,Z,p0_wide,CAL,P_guess,gamma_ub) %returns fit parameters for wide EIT scan detuning data (reflection %coefficient contains optics only) w = w(:); phi = smooth(360*unwrap(angle(Z(:)))/2/pi); delta_guess = p0_wide(1); omegam_guess = P_guess.omegam/1e9; G_guess = P_guess.G...
function SBJ08c_TT_TFR_save_mean_window(SBJ_id,proc_id,feat_id) %% Save amplitude of condition-averaged TFR power in target time (TT) task % COMPUTATIONS: % Select trials for conditions of interest % Load and average single-trial TFR within condition % Average power within time-frequency window and across trials ...
function [angle, variance, possibleAngles, variances,err] = AngleBetweenScars(scar1, scar2, segmentLength, ... segmentNumber, useSPStable,... scars, file) if nargin < 6 ...
h = [zeros(1,100), ones(1,150) zeros(1,100)]; % h[n] x = [1:100]/100; % x[n] xa = [fliplr(x),zeros(1,250)]; % x[-n] xb = [zeros(1,50),fliplr(x),zeros(1,200)]; % x[50-n] xc = [zeros(1,100),fliplr(x),zeros(1,150)];% x[100-n] xd = [zeros(1,150),fliplr(x),zeros(1,100)];% x[150-n] xe = [zeros(1,200),fliplr(x),ze...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % 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#...
clear all; clc; PosData = [2 10;1 13; 5 13;4 15 ; 8 16; 7 19; 10 20; 9 22]; NegData = [6 12; 7 8;8 5; 8 11; 9 3;10 8; 11 6; 12 2]; TotData = [PosData; NegData]; %part one; Means = mean(TotData); disp('The mean for total') Means sigmaVec = sum((TotData - repmat(Means, length(TotData), 1)).^2)*(1/(length(TotData)- 1))...
function px = Pej_BetaBinomial(x, xc, p, vScale) vScale = exp(vScale); if numel(p)==1 p = ones(size(x))*p; end if numel(vScale)==1 vScale = ones(size(x))*vScale; end a = vScale .* p; b = a .* (1-p)./p; px = exp(gammaln(x+xc + 1)-gammaln(x + 1)-gammaln(xc + 1)+... betaln((a + x),(b + xc))-betaln(a,b)); end
% % Smooth point-set registration method using neighboring constraints % ------------------------------------------------------------------- % % Authors: Gerard Sanromà, René Alquézar and Francesc Serratosa % % Contact: gsanorma@gmail.com % Date: 15/02/2012 % % Nonrigid extension to non-rigidly register samples fro...
function [h,th_lim,ph_lim,Modp] = h_in_p(cfile,con) % USAGE: [h,th_lim,ph_lim,Modp] = h_in_p(cfile,con); % reads in elevation for constituent con from file cfile % th_lim,ph_lim - global grid limits % h - global elevations % Modp - structure of patched-in local models elevations % [conList]=rd_con(cfile); [nc,dum]=siz...
function [stat, raw] = cw_ecg_calc(dat, conds, sr, PHYS) % function stat = cw_ecg_calc(dat, conds, sr, trig) % % This function calculates the initial IBI deceleration and subsequent IBI % acceleration from some pre-stimulus baseline. % % dat is a (m x n) matrix with m trials and n timepts per trial % conds is a...
% This is material illustrating the methods from the book % Financial Modelling - Theory, Implementation and Practice with Matlab % source % Wiley Finance Series % ISBN 978-0-470-74489-5 % % Date: 02.05.2012 % % Authors: Joerg Kienitz % Daniel Wetterau % % Please send comments, suggestions, bugs,...
function plot_trajectories() global user_particle_all h_trajectories hold on for i=1:length(user_particle_all) h_trajectories{i} = user_particle_all(i).show(); end end
% This is the "heterogenous" input file. Area values are changed accor- % ding to holistic-noc-design/tables/SmallVSOCArea. Application Digraph is % changed to urand. (Doesn't make so much sense...) % TODO: there is no urand yet. n = 18; ell = 2; % Router Größen: % - gegebene Werte [3150, 1800] gelten für 3D-Router....
function [k_m,sigma_min]=MFS_ITE_ellipse_anisotropic(m,init,semi_x,semi_y,Rrel_S,n,a_xx,a_yy,a_xy) % ROUTINE: Computes approximate ITE for ellipse with modified MFS % INPUT: % m = number of boundary collocation points (or equivalently source points) % init = initial guess for approximate ITE location % se...
clc; clear; close all; % 加载模板库数据(X,Y) load('X'); load('Y'); X=X'; Y=Y'; %% 待测试的分割字符 读取: test_path = 'G:\微信\WeChat Files\DTi0113\Files\BigHead\results\test36'; figs = dir(test_path);%子文件夹 test_X=[]; for i=3:length(figs) fig_path = fullfile( test_path,figs(i).name); bw=imread(fig_path); bw = imresize(bw,[1...
k = 1.5; h = 50; Tinf = 25; Q = 0; % Gauss Points and weights for four point gauss quadrature % for triangular area integration % ------------------------------------------------------- xi1 = 1/3; eta1 = 1/3; w1 = -27/48; xi2 = 0.6; eta2 = 0.2; w2 = 25/48; xi3 = 0.2; eta3 = 0.6; w3 = 25/48; xi4 = 0.2; eta4 = 0...
function [occupancy timings t_change] = gen_simulation_profiles(A,p,N) % Generate occupancy profiles % A is a vector with the extremes of the occupancies (e.g. [0 49]) % p is the number of changes % N is the number of simulation samples % % example: % gen_simulation_profiles([1 10],16,100) % generates 16 switches in 1...
function detectStruct = detection_artifact_power(data,varargin) % Author Hyatt Moore IV % created 4/19/2013 % this allows direct input of parameters from outside function calls, which %can be particularly useful in the batch job mode if(nargin>=2 && ~isempty(varargin{1})) params = varargin{1}; else pfile ...
function outp = parse_tyre_params(txt_in) f1 = fopen(txt_in, 'r'); s = fscanf(f1, '%c'); fclose(f1); ll = strsplit(s, newline); outp = struct(); for ii = 1:length(ll) if contains(ll{ii}, '=') tl = replace(ll{ii}, ' ', ''); tls = strsplit(tl, '='); outp.(tls{1}) = str2double(tls{2}); e...
%% GetAxisInfo % manually select two axis(open axis and closed axis) and get the % coordinates of each ends of the axis. %% Show the Image imshow('bkg.png'); hold on; %% Prompt the coordinates % Warning : always select left-most location % Closed Axis axis_c = zeros(2,2); axis_c(1,:) = ginput(1); scatter(axis_c(1,1),...
% p1 = sequence(pipeline.DummyStep('1'), pipeline.DummyStep('2'), fork(pipeline.DummyStep('f1'), pipeline.DummyStep('f2')), pipeline.DummyStep('3')); % P = pipeline.Pipeline(p1); % P.execute('Dummy Sessions', D); % % p2 = sequence(pipeline.DummyStep('1'), fork(pipeline.DummyStep('f1'), pipeline.DummyStep('f2')), fork(...
function class=k_nearest_calc(class_train_sort,k) % pick k nearest classes and assisgn the one that is counted more ref=unique(class_train_sort); class_train=class_train_sort{1:k}; for i=1:length(ref) count=find(class_train==ref{i}); vote(i)=length(count); end [vote,ind]=sort(vote, 'descend'); % s...
ii=1 for i=200:300 load(['mcs_cluster_xy_var_' num2str(i) '.mat'],'vo','Nt','parm') if max(max(vo.pva{end}{ceil(Nt(i)/2)}(:,:,parm.i3km)))>0.6e-6% halflife max pva ii=ii+1; else disp(['no PVa i = ' num2str(i)]) end end
function Penalty = get_Penalty(NElements) %UNTITLED2 Summary of this function goes here % Detailed explanation goes here Penalty=zeros(sum(NElements(:,2)),1); for i=[5 9 12 16 21 27] Penalty(sum(NElements(1:i-1,2))+1:sum(NElements(1:i,2)))=ones; end for i=[35 36] Penalty(sum(NElements(1:i-1,2))+1:sum(NElement...
function phiFaceAverage = linearMean(phi) % This function gets the value of the field variable phi defined % over the MeshStructure and calculates the arithmetic average on % the cell faces, for a uniform mesh. % % SYNOPSIS: % phiFaceAverage = arithmeticMean(phi) % % PARAMETERS: % % % RETURNS: % % % EXAMPLE: % % SEE ...
function [stim_cmd] = formatUstimCmd(stim_chan) %function [stim_cmd] = formatUstimCmd(stim_chan) % % % eye movement = 50 uA, 70ms, 350 Hz, 250 uS, negative first? clock_cycle = 1/30 * 1000; % clock ticks in microseconds delay_length = clock_cycle / 32; % length of a single unit of delay in microseconds % b...
% function[psfimg]= drawbar3(psfimg,titlename) % psfimg=double(psfimg)/max(max(double(psfimg))); % psfimg=double(psfimg); % figure('name',titlename),psf=bar3(psfimg); % colorbar % for k=1:length(psf) % zdata=psf(k).ZData; % psf(k).CData=zdata; % psf(k).FaceCol...
load rxfil16_out_re_good.txt; load rxfil16_out_re_bad.txt; load rxfil16_out_re_good_v2.txt; load rxfil16_out_re_good_v3.txt; % figure(1); % plot(rxfil16_out_re_good); % hold on; % plot(rxfil16_out_re_good_v2, 'r'); % hold on; % plot(rxfil16_out_re_good_v3, 'k'); % hold on; figure(1); plot(rxfil16_out_re...
load 'BGridCOutDataL100E2t1/BGridL100E2t1_PlotGrid.mat'; PlotGridL100 = PlotGrid; load 'BGridCOutDataL400E2t1/BGridL400E2t1_PlotGrid.mat'; PlotGridL400 = PlotGrid; load 'BGridCOutDataL800E2t1/BGridL800E2t1_PlotGrid.mat'; PlotGridL800 = PlotGrid; load 'BGridCOutDataL1200E2t1/BGridL1200E2t1_PlotGrid.mat'; PlotGridL1200 =...
function obj = get_objective_val(parm,model) obj = 0; for sample = 1 : parm.numSamples, [ywhat, maxScore, partScore] = mvc_pf(parm,model,parm.patterns{sample},parm.labels{sample}); myloss = loss_pf(parm,parm.labels{sample},ywhat); s = double(dot(model.w,mypsi_parts_pf(parm,parm.patterns{sample},parm.labels{samp...
function [mImage] = updateCoordDescImageBM(mAdj, mImage, mMembership, fObjective) % % Updates mImage according to a coordinate descent update rule. % % % @author: Jeffrey Chan, 2013 % vX0 = fObjective.computeApprox(mAdj, mImage, mMembership); % loop through coordinates for r = 1 : size(mImage,1) ...
%% This is an incomplete code that explains the flowchart on the screen % 1- analyze this code and the output % 2- Add comments to help yourself understand what the code is doing % 3- Complete the code according to the flowchart on the screen. % 4- Make any changes or edits that make sense to your code clc clear clos...
function [Env_sum, Tfs_sum] = EnvTFSV2(in, noiseCarrier, CF, fs) out = hilbert(in); Env = real(out); Env_sum = Env.*noiseCarrier; Tfs = cos(angle(out)); Tfs_sum = Tfs.*rms(in); end
function multi_run_stats=make_multi_run_stats(runstuff,params,protoc) % how many simulations num_sims=runstuff.num_sims; % set random number seed rng(runstuff.seed) % intialize and make space multi_run_stats.days_asymp_lax=zeros(num_sims,1); multi_run_stats.days_asymp_strict=zeros(num_sims,1); multi_run_stats.total_i...
function CE_ipad(session) % This funciton performs the colinearity experiment and collects subjects' % data and store it in the result folder. % Yanli Zhou % 7/14/2016 %% Initiation % 1. Clear Matlab window: % % 2. Check for OpenGL compatibility, abort otherwise: AssertOpenGL; % 3. Reseed the random-number generator ...
clear all; load('HCTSA_N.mat'); for i = 1:length(TimeSeries) csvwrite(['./tsTxtFiles/ts_',num2str(i),'.txt'],TimeSeries(i).Data); end
function [ xr ] = iTIDFB_eig( Z1, DFBtype ) %ITIDFB_EIG Summary of this function goes here % Detailed explanation goes here L = length(Z1{1}); X = cell(1, 1); for k = 1:4; for l = 1:L X{k}{l} = iDFB_eig( Z1{k}{L-l+1}, DFBtype); end end xr = iTILP_sep(Z1{5}, X);
// Swift Struct // Define a Swift struct type. // // IDECodeSnippetCompletionPrefix: struct // IDECodeSnippetCompletionScopes: [TopLevel,ClassImplementation] // IDECodeSnippetIdentifier: 6AF2D458-8008-4880-BD9F-A8FF8097835A // IDECodeSnippetLanguage: Xcode.SourceCodeLanguage.Swift // IDECodeSnippetUserSnippet: 1 // IDE...
function [cores, varargout] = tr_als_sampled(X, ranks, embedding_dims, varargin) %tr_als_sampled Compute tensor ring decomposition via sampled ALS % %For loading from file: It is assumed that the tensor is stored in a %variable Y in the mat file. % %cores = tr_als(X, ranks, embedding_dims) computes a tensor ring (TR) ...
function nmse = nmse(A,B,C) flag = isnan(A) | isnan(B); A( flag ) = []; B( flag ) = []; if strcmp(C,'offset') E = (B-A) - mean(mean(B-A)); else E = B-A; end D = A - mean(mean(A)); nmse = sum(sum(E.^2)) / sum(sum(D.^2)); end
function y=getNaivepotentP2X4coop2back() y=[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]; end
function proclivityFeature = trendFeatureDetector( previousProclivity, currentProclivity ) %TRENDFEATUREDETECTOR % for the next round, only the latest proclivity is required for tracking, ie. latestProclivity = currentProclivity; %stateModes = {'plateau', 'ascent', 'descent'}; proclivityFeatureDetectModes = {'MAXI...
% Given a moving belt, find the best feasible time and path function [bfp, bft] = goal2belt_picker(sgp_index, sol, A, maxiter, alpha) % sgp_index: starting goal point index, 2x1 vector % sol: starting octo location, % A: pre-computed time and path storage % maxiter = max iterations of guesses % % bft = best feasible t...
%This is the file used to implement erosion. function res = IPdilate(image, structuringElement) A = imread(image); SEHat = flip(structuringElement,1) SEHat = flip(SEHat,2) [h w] = size(A); padded = padarray(A, [1 1]); temp = zeros(h+1,w+1); for i = 2:h+1 for j = 2:w+1 TArea = padded(i-1:i+...
%% Croke model to test whether filters can reproduce that clc clear all close all % load catchment(s) % Barden_Lane BELLEVER BROAD_GREEN Whitebridge Cappenham TREGONY stationname_vec = ["Barden_Lane","BELLEVER","BROAD_GREEN",... "Whitebridge","Cappenham","TREGONY"]; stationname = 'Barden_Lane'; fil...
function s = modelVentilation_in_loop_C(cnt_x,T_amb,save_interval) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % modelHoneybeeVentilation.m % % description: % % written by: Jacob Peters % model by: Jacob Peters and L. Mahadevan % date written: May 11, 2015 % last modified: Decem...
function [I] = edge_index_matrix(A) %-------------------------------------------------------------------------- % % Copyright (c) 2009-2011 Jeffrey Byrne % %-------------------------------------------------------------------------- %% Edge index matrix I(i,j) = edge index for e(i,j) N = size(A,1); [i,j] = find(tril(A,...
% sig = 0.1 v 0.2 v 0.5 for a workspace of of 5 SIGS = [0.2 * 20/5, 0.1*4, 0.5*4]; MEANX = rand(1,3) .* 20; MEANY = rand(1,3) .* 20; F = zeros(101,101); for points = 1:3 sig = SIGS(points); meanx = MEANX(points); meany = MEANY(points); for x = 0:0.2:20; for y = 0:0.2:20; F(floor(x...
function [ tau, sigma ] = inner_1(n) %inner_01 この関数の概要をここに記述 % 詳細説明をここに記述 tau = randi(n); sigma = 2*randi(n/2) - 1; end
% Extended Dynamic Mode Decomposition and/or Naturally Structured DMD % main script for Henon map clear all; close all;clc %% load dataset tic % Henon map(discrete time) z0 =[1;0.1]; % Intial condition N = size(z0,2); % number of initial conditions data = z0; a = 1.4; b = 0.3; f = @(z) [z(1)-z(1)^3+z(2);....
function [accuracy, loss] = ComputeAccuracyAndLoss(W, b, data, labels) % [accuracy, loss] = ComputeAccuracyAndLoss(W, b, X, Y) computes the networks % classification accuracy and cross entropy loss with respect to the data samples % and ground truth labels provided in 'data' and labels'. The function should return % th...
clc clear all load('YaleB_c.mat','A','Y'); % load('Orl.mat'); %载入数据:A:原始数据矩阵,10304*400;Y:分类下标,400*1,一个人有十张脸部图片,图片的尺寸为 112*92 % [M,N] = size(A); % M*N 为矩阵A的维数 % A_new = A; % 给一部分(80%)照片加随机遮挡规格为 30*40 % for i=1:400 % if mod(i,10) < 3 % continue; % end % a = A(:,i); % face = reshape(a,112,92); % l...
pkg load image; addpath('../'); useful_functions; FILE = csvread('Fr_and_Re.csv'); FrUO = FILE(5,2); FrO = FILE(6:10,2); ReUO = FILE(5,3); ReO = FILE(6:10,3); H = FILE(6:10,5); Hun = FILE(6,5); # f1 = figure; subplot(1,2,1); plot(FrO, H, 'xk', 'markersize', 10, FrUO, Hun, '.b', 'markersize', 20); xlabel('Froude num...
triangular = fopen ('FuncTriang.txt','w'); Tiempo = 0:2.2676e-5:100*2.2676e-5; for i = 1:101 if (i <= 50) y(i) = (176.5*Tiempo(i))-0.1; else y(i) = ((-176.5*Tiempo(i))+0.1)+2*y(50); end fprintf(triangular,'%i\n',y(i)); end fclose(triangular); load FuncTriang.txt; plot (Tiempo, FuncTriang,'x');...
%% Generate a set of data points from a plane %Copyright (c) 2011, The MathWorks, Inc. clear all clc [CleanX, CleanY] = meshgrid(1:10); CleanX = reshape(CleanX,100,1); CleanY = reshape(CleanY,100,1); CleanZ = 3*CleanX + 4*CleanY; scatter3(CleanX, CleanY, CleanZ, 'filled') hold on foo = fit([CleanX, Cle...
% Burger_Vector_Calculator_2D % This script was made to make a plot of the performance of the program % with the 2D data set to be used for analysis in the program's associated % paper %% Introduction % Computes the Burgers vector for a specified Burgers circuit from elastic % strain and lattice rotation data and ou...
% clear all clc % %Declarations x0= [4,0]; % y(0), y'(0) h = 0.031250000000000; % h is found from Task 1 axis_index = 1; fig_num = 1; for i=0.1:0.1:3, %i is u % run calculation with h [t x]=calc_sRK4(x0,h,i); % q=i td=t(3841:4801); % select interval t = [120,150] yd=x(3841:4801,1); % select inter...
function [para] = px_spm8_preprocess_smooth(fdp,para) %FORMAT px_spm8_preprocess_smooth(fdp,para) % Usage Call the spm8 for smoothing. % Input % fdp.scan - full path of the data files. Cell format for input, % with one run in one brace. e.g., {{run1};{run2}} % para % para.fwhm - th...
function [Yas,J]=J_LRPI(theta,xdata,var) %-------------------------------------------------------------------------- % Prototype: % [Yas,J]=J_LRPI(theta,xdata,var) % % Description: % Evaluates the MPC Relevant Identification cost function % % Inputs: % -theta: Matrix of parameters % -xdata: Contains Y and ...
%% Convert TWL time series from .mat to .csv % Pre-computed TWL from on of the six of Alfredo's time series % Not sure where this one is. Think these values were calculated by Ian infile = 'D:\crs\proj\2023_NCB_recovery\NCB_TWL_R2_6.mat' load(infile) n = length(TT) ofile = 'D:\crs\proj\2023_NCB_recovery\annual_max.cs...
function HistogramsYG( Result_cell, save_figure ) %UNTITLED Summary of this function goes here % Detailed explanation goes here disp('HistogramsYG...'); tic; if nargin == 0 Result_cell = CollectRYG(); end if nargin <= 1 save_figure = 1; % default end if save_figure == 1 figure_visibility = 'off'; % 'on...
function D = D_periodicFourthOrd(N,h) % Expicit Derivate M atrix with improved wave numbers of Tam and Webb % Periodic Version % D = D_TW(N,h) % N number of Points % h = Delta x alpha2= -1/12 ; %-1/(h)*0.18941; %*(2*pi)/h; alpha3= 0 ; %1/(h)*0.02652; % *(2*pi)/h; alpha1= 8/(12) ; %)-2*alpha2-3*alpha3 ; ...
function handle = DPU_TrackerProc_config() % global trackerProcObj; cfgFileName = 'D:\matlab_workspace\people_count\ODS_6m_default.cfg'; radarCfg = readRadarCfg(cfgFileName); %/* Convinience pointer to config params */ % pStaticCfg = pConfigIn.staticCfg; % %/*! @brief ...