text
stringlengths
8
6.12M
clear all; brick = ConnectBrick('HYLIFT'); brick.beep(); global key; InitKeyboard(); lTurnTime = .54; rTurnTime = .52; while true pause(0.01); switch key case 'leftarrow' disp('left'); leftTime(brick,lTurnTime); stop(brick); ...
% berechnet und plottet den Zeitbereich des Frequenzsignals function frequenz_im_zeitbereich (x_t,t) N = length(t); abtastfrequenz = 1/N; abtastwerte = ones(N,1); miximas = zeros(N,1); null= zeros(N,1); minimas = zeros(N,1); %indizes for i=1:N if x_t(i)>0.99 maximas(i) =1; end end figure(101) hold on ...
function [PC_back,cycle_back,intmem_back]=RotcRightACC(PC,cycle,intmem) intmem_back=intmem; ACC=intmem(225,1); if(mod(ACC,2)==1) h=1; else h=0; end %load Rn,PSW PSW=loadPSW(intmem(209,1)); CY=PSW(1,1); AC=PSW(2,1); F0=PSW(3,1); RS1=PSW(4,1); RS0=PSW(5,1); ...
%% Init clear all; % close all; % Organization of the data for Experiment 1a % % % CH1: time % % % CH2-161: ECoG 1-160 % % % CH162: DI (unused) % % % CH163: StimCode % % % CH164: GroupId % % % GroupIds: % % % 1 ... Left Stim (instruction to attend left hand) % % % 2 ... Left Rest (rest) % % % 3 ... Right Stim (instru...
function [temporal_derivative] = temporal_derivative(images, filter) %TEMPORAL_DERIVATIVE Summary of this function goes here % Detailed explanation goes here h = floor(size(filter) / 2); if (mod(size(filter), 2)) l = h; else l = h - 1; end x = size(images, 1); y = size(...
%{ Copyright (c) 2017 Raghvendra V. Cowlagi. All rights reserved. Copyright notice: ================= No part of this work may be reproduced without the written permission of the copyright holder, except for non-profit and educational purposes under the provisions of Title 17, USC Section 107 of the United States Cop...
function [STRUCT] = find_normed_gr(STRUCT,EMP, name) growth_rate = calculate_growth_rate(STRUCT); Mc = [.185,.381,.546,.69,.883]; rho_1 = [1.1527,1.1418,1.1344,1.188,1.3555]; rho_2 = [1.1206,.9633,.7941,.729,.5980]; for i = 1:5 [upper_speed, lower_speed,~,~,~,~,~,~] = getInfo(i); r = lower_speed/upper_speed; s = rho_2...
function [dist, angle]=calDistAngleInHorizen(vectorAB,vectorBC) vectorAB(3) = 0; vectorBC(3) = 0; dist = norm(vectorBC); cosAngle = dot(vectorAB,vectorBC)/(norm(vectorAB)*norm(vectorBC)); angle = acos(cosAngle); % [0,pi] crossABBC = cross(vectorAB,vectorBC); if crossABBC(3) < 0 direction = -1; % clockwise elseif c...
clc clear [X1,Y1,X2,Y2,X3,Y3,X4,Y4,X5,Y5,X6,Y6,X7,Y7,X8,Y8,X9,Y9]=CreateObstacleSpace(); hold on xInitial = [30,160]; plot(xInitial(1),xInitial(2),'kO','MarkerSize',20); hold on xGoal=[160,30]; plot(xGoal(1),xGoal(2),'mO','MarkerSize',20); %Set the Goal Biasing Probability Probability = 0.5; %Create ...
%% Descriptive Statistics of Trend of Solar Irradiance Over Time %Read-in data Solar1 = readtable("solarFINAL2.csv"); %Pre-Processing - identify variable columns Irrad = Solar1{1:end,1}; Zenith = Solar1{1:end,2}; Azimuth = Solar1{1:end,3}; Day = Solar1{1:end,4}; Hour = Solar1{1:end,5}; ...
function rev = get_li8_ideal_onepersonjuly10(stru, adjust) if ~adjust get_li8_ideal_onepersonjuly10(stru); end rev = 0; % % stru(person_postion).imFilePathAndName = imFilePathAndName; % stru(person_postion).imgnameWithoutExtendName = imgnameWithoutExtendName; % stru(person_postion).imgname = imgnam...
function x=ifct(x,n,dim) %IFCT Performs an Inverse Discrete Cosine Transform along a given %dimension. It is based on Andriy Myronenko's implementation in %https://uk.mathworks.com/matlabcentral/fileexchange/24050-multidimensional-discrete-cosine-transform--dct- % X=IFCT(X,{N},{DIM}) % * X is the array t...
n_metrics_all=1:29; n_metrics_standard = [1 2 3 4 6 7 10 11]; %[9 12 13 14 15 16 17 28]; %9:29; %[1 2 3 4 6 7 9 10 11 12 13 14 17,15,16,18:29]; n_metrics_pairwise = []; %[1 2 3 4 6 7 10 11 12]; n_metrics_gazewise = []; %[10 11 13 14 17];%[13 14 17]; n_ow_metrics=[];
function display = drawText(display,center,str,col) % display = drawText(display,center,str,[col]) % % Draws text string 'str' centered at center = [x,y] in real-world coordinates. % % Text attributes can be set by setting the fields in 'display.text'. This % sets the attrubute using the corresponding Screen ...
% ========================================================================= % Function: FrameMain % % Parameters: driverMass (kg), jumpHeight (m) % % Outputs: finalFrameMass (kg) % % Description: Calculates the final mass of the frame by finding the % minimum tube thicknesses based on safety factors. The s...
function f=fkfuns() f.fk = @fk; f.force = @force; f.plotconfig = @plotconfig; f.energy = @energy; f.spect = @spect; f.initx = @initx; f.fkgrad = @fkgrad; f.energies = @energies; f.plotEnergies = @plotEnergies; f.plotw = @plotw; f.plotground = @plotground; f.plotconfigfirs...
clear all close all clc warning off; iptsetpref('ImshowBorder','tight'); tsta=cputime; im = imread('test.jpg'); if(size(im,3)==3) im = double(rgb2gray(uint8(im))); end if(max(im(:)) > 255) im = (double(im)*255)/65535; end w = 5; % bilateral filter half-width sigma = [5 0.1]; % bilateral fil...
%% Housekeeping and initialisation clear %delete workspace clc %clear command window close all %close all figures and other popups order = 0; %conditions for first iteration pressurechange = 0; %conditions for first iteration %READ: %THIS CODE IS AN IMPLEMENTATION OF THE INVERSE MARCHING METHOD DESCRIBED BY %ZUCROW ...
function [part_thetas, part_outputs, part_summaries, part_Ds] = performSMCABC(N_parts, f_simulate, f_summaries, f_discrepancy, target_data, params_mins, params_maxs, scale_param, desired_D, visualise, varargin) % This function performs SMC-ABC as laid out by: % Drovandi, C. C. and Pettitt, A. N. (2011). Estimation of...
function [R] = quat2RotMat(q) %QUAT2ROTMAT Calculates rotation matrix of a quaternion % Detailed explanation goes here R = [q(1)^2+q(2)^2-q(3)^2-q(4)^2, 2*q(2)*q(3)-2*q(1)*q(4), 2*q(2)*q(4)+2*q(1)*q(3); 2*q(2)*q(3)+2*q(1)*q(4), q(1)^2-q(2)^2+q(3)^2-q(4)^2, 2*q(3)*q(4)-2*q(1)*q(2); 2*q(2)*q(4)-2*q(1)*q(3),...
clear; clc O = [1; 0]; X = [0 1; 1 0]; H = (1/sqrt(2))*[1 1; 1 -1]; rng('shuffle','multFibonacci') % Pseudo Random Generator simulation = 20; for n=1:1000 for s=1:simulation %% Alice alice_bits = randi([0,1],1,n); alice_bases = randi([0,1],1,n); for i=1:n if alice_bits(i)==0 ...
function X2 =diffn(X,n) %function X2 =diffn(X,n) % % computes diff of X along dimension n s = size(X); X = permute(X,[n,setdiff(1:length(s),n)]); X2 = diff(X); X2 = ipermute(X2,[n,setdiff(1:length(s),n)]);
main_dir = '/mnt/40086D4C086D41D0/Reverb_data/For_analysis/Process'; t_bin_ms = 20; animal_list = dir(main_dir); animal_list = animal_list(~ismember({animal_list.name},{'.','..'})); for animal = 1:numel(animal_list) fprintf('== Processing animal %s ==\n',animal_list(animal).name); pen_dir = dir([fullfile(anima...
function I_rec = inPainting(I, mask) % Load parameters from file load('params.mat'); % Start parametrized inpainting I_rec = inPaintingParameterized(I, mask, parameters); end
function makeblocksfrommrphys(fname,nthresh) % finds areas in fname in which there are % triggers and separates them into files for % further processing % usage: makeblocksfrommrphys(fname,nthresh) % noise threshold if nargin<2, nthresh=20; end if ~probe(fname) fprintf(1,'physio data not found for %s\n',...
str = []; for i = 1:size(p,1) if p(i,2)==0 str = [str sprintf('%1s',key(p(i,1)))]; elseif p(i,2) == 1 str = [str sprintf('%1s ',key(p(i,1)))]; else str = [str sprintf('%1s\n',key(p(i,1)))]; end end fprintf('%s\n',str);
function [Calls,audiodata,ClusteringData] = loadCallfile(filename,handles) data = load(filename); Calls = table(); audiodata = struct(); ClusteringData = table(); %% Unpack the data if isfield(data, 'Calls') Calls = data.Calls; elseif nargout < 3 % If ClusteringData is requested, we don't need Calls error('T...
% load('a01m.mat'); % pan_tompkin(val2,100,1); % % load('a06m.mat'); % pan_tompkin(val,100,1); load('a03m.mat'); pan_tompkin(val(525:6000),100,1);
function varargout = solve_align_symmtop_v2(varargin) % use atomic units, except for some of the constants below tic; a0=5.29e-11; % [m] eps0=1/4/pi; c_au=1/137; t_scale=24.18884e-18; % [s] I_scale=3.51e4; % conversion from TW/cm2 to atomic units (1 a.u.=35.1e15 TW/cm2) h_SI=6.626e-34; % [J*s] c_SI=2.99792e8...
function out_idx = cal_idx(cal, cal_type) %CAL_IDX Returns the index of the calibration structure matching the %desired type out_idx = find(strcmpi({cal.type}, cal_type)); end
%% clc;clear; load ideal_ivs.mat figure1=figure(1); clf; subplot1 = subplot(1,2,1,'Parent',figure1); hold on plot([0:0.0001:2], [0:0.0001:2].^2) box on; grid on title('Ideal Flux-Charge Curve Example, $\varphi(q)=q^2$', 'fontWeight', 'normal') xlabel('Charge') ylabel('Flux') set(subplot1,'XTick',[0 0.25 0.5 0.75 1 1....
function Out = rgb2HSV(R,G,B) if nargin == 3, RGB = [R G B]; elseif nargin == 1, RGB = R; else error('wrong number of arguments') end [n,~]=size(RGB); for i=1:n var_R=(RGB(i,1)./255); var_G=(RGB(i,2)./255); var_B=(RGB(i,3)./255); var_...
function [MAC,x_dist,y_dist] = MAC_calculator(cr,ct,b_2,sweep_dist) % function to calculate the mean aerodynamic chord of a wing section, as % well as the sweep distance at the MAC (x_dist) and the MAC distance from % the root (y_dist) %x_dist x_dist = (sweep_dist*(cr+2*ct))/(3*(cr+ct)); %MAC MAC = cr-(2*(cr-ct)*(0....
%------------------------------------------------------------------------- % Calculation of maximum size of input given the upper bounds of the % size of input-output gain (gamma =3) for a 2-state system as described below. % The example has been taken from: % % E. Summers and A. Packard. L2 gain veri?cation for int...
%% SIF_Shadow.m % Work on the relationship between the shadow fraction calculated from % ArcMap Hillshade (Hilker et al., one of his RSE papers), and % SIF/SIFyield. We also compare the sunlit leaves fraction from the % estimation of FLiGHT model by Hideki Kobayashi. We focus on the data % from year 2013. clear v...
function estReportMsgReceived(address, message, connectionName) disp(message)
function s = initializeSimulatedUAV( ) % It creates the ground truth (real values without noise) of a simulated UAV s = [ 0 + randn(); % 0 + N(0,1) 0 + randn(); % 0 + N(0,1) rand()*2*pi ]; % Random angle between 0 and 2*pi end
close all clear all clc code_folder = '/Users/akiranagamori/Documents/GitHub/MN-Model/Cisi2008'; data_folder = '/Users/akiranagamori/Documents/GitHub/MN-Model/Cisi2008/MN Parameter'; cd(data_folder) load('mn_parameter') cd(code_folder) Fs = 10000; time = 0:1/Fs:5; noise_amp = 0; amp = 0.1; U_syn = zeros(1,length(t...
function [sigma,mu,var_dirs,var_amts] = scm_ex(Y,A,R,sigma0,mu0,sigma_max) %SCM_EX Summary of this function goes here % Detailed explanation goes here [N,M] = size(A); [~,B] = size(R); sigma_min = 1e-6; C = kron((A'*A),eye(B)); S = (mu0^2/(sigma0^2))*eye(M*B,M*B); h = (Y-A*R)'*A; h = h(:); gamma = 1/(mu0^2); ls...
function meanLogWageM = wage_by_year(sexCode, yearV, setNo) % Show stats for wages by year % --------------------------------------- cS = const_cpsearn(setNo); ny = length(yearV); % Mean log wage by school group meanLogWageM = zeros([cS.nSchool, ny]); for iy = 1 : ny % For wages in year 1, must load year 2 varia...
%close all % figure(1) % simulation step size in milliseconds. % 1 usec per step. (or 0.001 msec) dt = 1e-3; showEvolution = 0; isControl = 0; T1 = 1700; %ms T2 = 165; %ms from Qin paper % % T1 = 1400; %ms % T2 = 65; %ms from Qin paper homogeneity = 'perfect'; % 'perfect' % 'bad_B0_B1' refocus...
function [A] = imgseg(im, nseg) run('../../../cvitstuff/vlfeat-0.9.20/toolbox/vl_setup.m'); esp = 0.001; eps = 1; J = rgb2hsv(im); H = J(:,:,1); Igray = rgb2gray(im); M = size(im,1); N = size(im,2); R = im(:,:,1); G = im(:,:,2); B = im(:,:,3); E = entropyfilt(Igray); ...
function RSVP_analysis = run_analysis_RSVP(Target_EEG,Nontarget_EEG,rsvp_settings) twin = rsvp_settings.twin; window_length = rsvp_settings.window_length; window_overlap = rsvp_settings.window_overlap; trigger_tag = rsvp_settings.trigger_tag; [trig_time,trig_ind] = analysis_RT(Target_EEG,trigger_tag); Target_EEG =...
% Part 2 of MECH 105 Homework 15 function [x,c] = Fahrenkrug_reactor(D,U,k,c0,cL,L,dx) % This function solves the system linear of equations created from % approximating a steady-state mass balance equation for a chemical in a % one-dimensional canal. % Inputs: % D= diffusion coefficient % U= the fluid Velocity % k= th...
%% This function waits for the trigger to come % Show an empty screen DrawFormattedText(w,params.txt_trigger,'center','center',params.psych_background_white); Screen('Flip',w); no_trigger = 1; time_start = GetSecs(); time_this = time_start; while no_trigger && (time_this - time_start) < params.time_await_tr...
function undefinedVars = find_undefined_variables(modelName) undefinedVars = []; stillErrors = 1; while stillErrors try Simulink.findVars(modelName); stillErrors = 0; catch err % If the error is an undefined block parameter then find the name and add it to...
t=(-100:0.01:100); a=0.35; T=5; p=1/T; if(t==0) f=1-a+(4*a)/3.14 else if(t==(T/(4*a))|(t==(-T/(4*a)))) f=((a/sqrt(2))*(1+2/3.14)*sin(3.14/(4*a)))+((1-(2/3.14))*cos(3.14/(4*a))) else f=((sin(3.14*(1-a)*p*t))+ (4*a*p*t.*cos(3.14*(1+a)*p*t)))./(3.14*p*t.*(1-(4*a*p*t).^2)) end e...
function MakeFolder(varargin) % if isempty(folderpath);return;end for i = 1:length(varargin) folderpath = varargin{i}; [~,~,thisext]=fileparts(folderpath); if not(isempty(thisext)) && not(strcmp(thisext,"")) folderpath = fileparts(folderpath); end if not(exist(folderpath, 'dir')) m...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Euler Angles %%%% %% input : acceleration x, y, z in G %%%% %% output: pitch and roll angles in degrees %%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [ pitch, roll ] = eulerAngles(accX,accY,accZ) pi...
function [AIC, SBC, logL] = VARlag(ENDO,maxlag,const,EXOG,lag_ex) %========================================================================== % Determine VAR lag length with Akaike (AIC) and Schwarz Bayesian % Criterion (SBC)criterion. %========================================================================== % ...
% Replication paradigm % Figure 10 clear; close all;clc; flag = 1; repl = 0; % set t = 0 as 0 in the simulation arkysd = 0.056;% standard deviation of arky inputs peak = 2.4; % peak sensory cortical input run SecondOrder_LOOP_2_GP_Populations
function [ Channel_Filtered, extendedChannel] = medianFilter5( CHANNEL) % WINDOWSIZE should be the length of the entire window, such as % 3x3 should be written as 9. extendedChannel = zeros(size(CHANNEL)+4); Channel_Filtered = zeros(size(extendedChannel)); for r=1:size(CHANNEL,1) for c=1:size(CHANNEL,2) ...
function [sm] = Achanta(img) %--------------------------------------------------------- % Copyright (c) 2009 Radhakrishna Achanta [EPFL] % Contact: firstname.lastname@epfl.ch %--------------------------------------------------------- % Citation: % @InProceedings{LCAV-CONF-2009-012, % author = {Achanta, R...
exp_folder = 'D:\GoogleDrive\retina\Chou''s data\20210331'; cd(exp_folder) load(['Analyzed_data\unsort\0224_cSTA_wf_3min_Q100_re.mat']) load('Analyzed_data\30Hz_27_RF_15min\unsort\STK.mat') load('rr.mat') figure('units','normalized','outerposition',[0 0 1 1]) ha = tight_subplot(8,8,[.04 .02],[0.07 0.02],[.02 .02]); fo...
%% Display Results % Copyright (c) 2020 KIOS Research and Innovation Centre of Excellence % (KIOS CoE), University of Cyprus (www.kios.org.cy) % % Licensed under the EUPL, Version 1.1 or – as soon they will be approved % by the European Commission - subsequent versions of the EUPL (the "Licence"); % You may not ...
%param selection % Emanuel Ravemyr 19/11 -2020 %%setup clear rng(1); N = 100; % number of source particles %% Parameter selection L = 1; % box side length box = [L L L]; % periodic box opt.box = box; %Ewald params M0 = 128; % Set M0=M/L, the restu * 1+ is automatic opt.M = M0*[1,1,1]; opt.xi = 5; opt.betaP = 2.5;...
function [X,Y,Rx,Ry,V,LAMBDA,Sx,Sy,lambx,lamby,Cp,rho]=Mesh(COOR,N,M,W,Mat) %% MESH GENERATOR %% [px,py]=coordinates(COOR); %extracts the coordinates x and y that do not repeat %% Increments %% IncX(1)=px(1)/N(1); for i=2:size(px,2) IncX(i)=(px(i)-px(i-1))/N(i); end IncY(1)=py(1)/M(1); for i=2:size(py,2) In...
function [output] = plotResults(params) %PLOTRESULTS Summary of this function goes here % Detailed explanation goes here % Plotting Simulation Results "Operating Nodes per Round" % figure(2) plot(1:params.rnd,params.op(1:params.rnd),'-r','Linewidth',2); title ({'LEACH'; 'Operating Nodes per Round';...
function varargout = SubtractBackground(varargin) %SubtractBackground Subtracts background from images % IM_proc = SubtractBackground(IM) % [IM_proc, refImg] = SubtractBackground(IM,refFrames); % Inputs: % IM - Image stack where 3rd time is time % refFrames - A vector specifying the frames to average for background % ...
function [erms] = calculate_erms(y,t,range) erms = sqrt((y - t)'*(y - t)/length(range)); end
function mx = moving_max(v,w) % Moving maximum % % max = movingmax(x,m) % % x is the timeseries. % m is the window length. % v is the variance. % % Ryan Julian 2011 % n=size(x,1); % % mx = zeros(size(x)); % for i = 1:n % if i <= floor(m/2) % left = 1; % else % left = i - ...
clc;clear;close all; load('rawdata_wifi_c14-a19_45.mat'); load('rawdata_accl.mat'); load('rawdata_attitude.mat'); load('radiomap_kalman.mat'); map = openfig('map.fig','reuse'); [pdrtime, stepsize, stepvelocity] = PDR(rawdata_accl, rawdata_attitude);%迈步时刻,步长,步速 wifiresult = Improvedwknn(rawdata_wifi, radiomap_kalman); ...
function [theta_all, dis_all, x3, y3] = calculate_theta_all(dis_range, angle_range, x1,x2,x3,y1,y2,y3) dis = sqrt((x3 - x2).^2 + (y3 - y2).^2); x3(find(dis > dis_range)) = []; y3(find(dis > dis_range)) = []; dis(find(dis > dis_range)) = []; if length(x3) == 0 theta_all = 500; dis_all = 500; else theta = c...
close all clear all load('pngNames.mat') noPic = length(pngNames); picDim = [276,511]; %verticalDrift = 36.1507; %5.3; %horizontalDrift = 34.7595; %4; %mean(mean(uv))(1) = 34.7595, (2) = -36.1507 %in plotflow, meshgrid x dimension is size(uv)(2) and y dimension is %size(uv)(1) %rescale average drift found from OF...
function This = group(This,Grp) % group Retrieve VAR object from panel VAR for specified group of data. % % Syntax % ======= % % V = group(V,Grp) % % Input arguments % ================ % % * `V` [ VAR ] - Panel VAR object estimated on multiple groups of data. % % * `Grp` [ char ] - Requested group nam...
function dydt = five_link_dyn(t,x,ut,u) % x is the state vector, [q1,q2,q3,q4,q5,dq1,dq2,dq3,dq4,dq5] u = interp1(ut,u,t); q = x(1:5); dq=x(6:10); M = five_M_simp(q(2),q(3),q(4),q(5)); V = (five_V(q(2),q(3),q(4),q(5),dq(1),dq(2),dq(3),dq(4),dq(5)))*dq; G = five_G(q(1),q(2),q(3),q(4),q(5)); ddq = M\(u.'-V-G.'); dydt...
function [] = display2images(img_cell, title_str) figure subplot(1,2,1), subimage(img_cell{1}); subplot(1,2,2), subimage(img_cell{2}); set(gcf,'NextPlot','add'); axes; h = title(title_str); set(gca,'Visible','off'); set(h,'Visible','on');
function varargout = eventtrigger(pulseon, tevent, rng, varargin) % function [A,B,C...] = eventtrigger(pulseon, tevent, rng, A,B,C,..., % options) % Reshapes tevent around pulseon for a certain number of events before % and after the pulse. Optionally also reshapes other variables % (A,B,C,...) that have the sam...
% Evaluative input selection method. Only concern with single output. % Using SE to calculate the reinforcement for each changes. % [returning weight vector of features] = evalsel(.. % .. input matrix, output matrix, number of learning epoch, underlying model) % function [weight] = evalsel(x,y,epoch,model,net) f...
sig=ch2(1:3000); t = 0:T:(numel(sig)*T)-T; level = 6; wpt = wpdec(sig,level,'sym6'); figure; [S,T,F] = wpspectrum(wpt,sr,'plot');
function [m,s,NormTP] = ShowROCcaFamily(caROC, extrastring, Color, LineWidth) %function ShowROCcaFamily(caROC) % %like ShowROC, but takes a cell array of ROCs %plots the 'mean' roc and error bars using boxplot if(nargin < 4) if(nargin < 3) if(nargin < 2) extrastring = 'b-'; end Color = [0 0 1]; e...
%% TrainNewSensorLocs.sh if false projectdir = 'C:\wrk\Rheem\Phase 2 Analysis'; NoHupScriptPath = fullfile(projectdir,'TrainNewSensorLocs.sh'); [fid,errmsg] = fopen(NoHupScriptPath,'wt'); fwrite(fid, '#!/bin/bash','char'); fwrite(fid,newline,'char'); SensorIdxs = {'M1','M2','M3','M4',...
function testlabel3d_mult(Pfile, offset ) if nargin <2 offset = -0.8 end !rm *.nii %sprec1_3d(Pfile,'m'); %sprec1_3d(Pfile,'h','N'); sprec1_3d(Pfile,'N','n',128, 'C',1); vols = dir('vol*.nii'); volname = vols(1).name; hdr = read_hdr(volname); aslsub(volname(1:end-4), 1, 1, hdr.tdim, 0, 0, 0); % aslsub(volname...
function [yEstimated, excitation, coef]=sift(y, lpcOrder, plotOpt); if nargin<1, plotOpt=0; end if nargin<2, lpcOrder=20; end if nargin<3, plotOpt=1; end coef = lpc(y, lpcOrder); yEstimated = filter([0 -coef(2:end)], 1, y); % Estimated signal excitation = y - yEstimated; % Prediction error if any(isnan(coef)) % Wh...
function H = new_mapRegion(C, varargin) % % NAME % % function C = new_mapRegion(C) % % ARGUMENTS % INPUT % C class curvature_analyze class % % OPTIONAL % % OUTPUT % H handle a handle to the created region % map. % % DESCRIPTION % % This method creates a new region da...
function [U, GridX, GridY] = topology(X) %% Calculate the topology map specifying the density of areas of X % Lie dense mesh over X and calculate the distance between every map point % and its closest node in X %% Input/Output: % X: node positions in n-dimensional space % U: topology matrix (distance between mesh poin...
%程序 x=[676 825 774 716 940 1159 1384 1524 1668 1688 1958 2031 2234 2566 2820 3006 3093 3277 3514 3770 4107 ]; lag=5; % 自回归阶数 iinput=x; % x为原始序列(行向量) n=length(iinput); %准备输入和输出数据 inputs=zeros(lag,n-lag); for i=1:n-lag inputs(:,i)=iinput(i:i+lag-1)'; end targets=x(lag+1:end); %创建网络 hiddenLayerSize = 11; %隐藏层神...
clear variables; close all; set(0, 'defaultAxesFontSize', 12); set(0, 'defaultTextFontSize', 20); set(0, 'DefaultAxesLineWidth', 1.0, 'DefaultLineLineWidth', 1.0); L = 0.2; % rotation-center to control point [m] v = 0.1; % velocity on wheel-center[m/s] gain_lat = 1.0; gain_yaw = 1.0; param(1) = L; param(2) = v; pa...
%{ # experimental paradigm event timing marker(s) for this trial -> acquisition.TrialSetTrialEventTime (trial_event) -> reference.ExperimentalEvent.proj('event') --- event_time = null: float # (in second) event time with respect to this session's start time %} classdef TrialSetTrialEventTime < dj.Imported end
function csd = get_csd(animalid, block, channels) if nargin == 0 animalid = '180626'; block = 12; channels = 16; allchannels = [32]; electrode = 1; depth = 600; penangle = 65; end ellength = 25*(channels-1); highest = depth-ellength; depthax = depth:-25:highest; depthax = depthax.*(cosd(90...
classdef (ConstructOnLoad) TimeStepData < event.EventData properties x t end methods function obj = TimeStepData(t, x) obj.x = x; obj.t = t; end end end
function [fig, ax] = time_plot_nodate(P, tl, Title, visib ) %% function [fig, ax] = timeseries2(P, tl, Title, visib ) % generates a time series plot abitary number of time series % P{i} : structure containing all information for a pannel (i) is panale % P{i}.X{j} : time arrays % P{i}.Y{j} :...
%% Authors: Simone Parisotto, Marco Caliari function A = osmosis_discretization(v) % Input: % umat = shadowed image % umask = shadow boundary indicator function [mx, my, ~] = size(v); x = linspace(1,mx,mx)'; y = linspace(1,my,my)'; hx = (max(x)-min(x))/(mx-1); hy = (max(y)-min(y))/(my-1); [~,D1classic,D2cla...
classdef REX_CODE_MAP properties (Constant) %% codes EVENTCODEMIN = 1000; START = 1001; FPON = 1003; GAP1ON = 1004; JMP1ON = 1005; JMP1OFF = 1006; JMP2ON = 1034; JMP2OFF = 1035; RFON = 1007; RFOFF = 1010; RF2ON = 1047; RF2OFF = 1040; CUEON = 1016; C...
classdef sensEncodingMatrix % Generates sparse stripe-diagonal sensitivity encoding matrix % % Last Modified: % Mark Chiew % June 2014 % % Input: % sens - ND array of complex coil sensitivities % Assumes 1st dimension is coils % [Nc, Nx, (Ny), (Nz)] ...
% This code was generated using ADiGator version 1.4 % ©2010-2014 Matthew J. Weinstein and Anil V. Rao % ADiGator may be obtained at https://sourceforge.net/projects/adigator/ % Contact: mweinstein@ufl.edu % Bugs/suggestions may be reported to the sourceforge forums % DISCLAIMER % ADiGator is a gene...
%% RBES_Evaluate_Mission.m function [score,panel_scores,objective_scores,subobjective_scores,data_continuity_score,data_continuity_matrix,cost,orbit] = RBES_Evaluate_Mission2(mission) global params r = global_jess_engine(); n = length(mission.instrument_list); if n>2 || params.USE_LOOKUP_TABLES == 0 %% (Option by defau...
function varargout = Optomotor_Setup(varargin) % OPTOMOTOR_SETUP MATLAB code for Optomotor_Setup.fig % OPTOMOTOR_SETUP, by itself, creates a new OPTOMOTOR_SETUP or raises the existing % singleton*. % % H = OPTOMOTOR_SETUP returns the handle to a new OPTOMOTOR_SETUP or the handle to % the existing si...
function sr_lut_frac_core(filename,i_r,end_path) [Vdec,Cdec] = read_ply([end_path '/' filename '.ply.bin.decoded.ply']); gp = nextpow2(max(max(Vdec))); s = 1/TMC13_positionQuantizationScale(i_r, gp); ##T = min(Vdec); T = zeros(1,3); Vds = round((Vdec - T)/s); if s <= 2 Vlut = LUT_SR_fractional_octave(...
%to generate the data, simple run this script (press F5) and you'll have %the data generated in `data` variable. p = 100; nu = 1 ; M = 4; n = 8; k = n-M+1; %g = @(x,k) 100*(k+(sum((((x-0.5).^2) - (cos(20*pi*(x-0.5)))),2))); g = @(x,k) (sum((x-0.5).^(2),2)); % k is passed for DTLZ3.m alpha = 100; %usu...
function [ErrorQuotient] = SuperLinear(x, xout) TotalNum = size(x,2); ErrorQuotient = zeros(TotalNum-1, 1); Error = zeros(TotalNum, 1); Diff = x - repmat(xout, 1, TotalNum); Err1 = ( sqrt( sum( Diff(:,1:TotalNum-1).^2 ) ) )'; Err2 = ( sqrt( sum( Diff(:,2:TotalNum).^2 ) ) )'; %LogErrorQuotient = log10(Err2) - log...
function [file_format,first_channel,second_channel,first_phase,second_phase,... direction_matrix,n_directions,n_channels,n_lines,sampling_rate,... begin_of_signal,end_of_signal,xaxis,comment] = r_frq(fid,filetype) % function [file_format,first_channel,second_channel,first_phase,second_phase,dir...
function [weights_u, means_u,covs_u,Ncom_u,logical_active_u]=GMPHD_filter_update(weights_k, means_k,covs_k,Ncom_k,logical_active_k,z,H,R,p_d,l_clutter,Area) %GMPHD filter update %See "B.-N. Vo and W.-K. Ma, “The Gaussian mixture probability hypothesis %density filter,” IEEE Transactions on Signal Processing, vol. 54, ...
% Vinay Ramakrishnaiah % Main program that implements Virtual Terrain Leveling % clear close all global Gain deltheta % look angles deltheta = 0 : pi/720 : 2*pi-pi/720; % deltheta = [deltheta,0]; %% define parameters for FSM f = 9e08; c = 3e08; lambda = c/f; %% define parameters for WIM % h_B = height of building i...
% Header_Team.m : Save the world % File : % By : Shadman Jubaer % Mark Rackish % Tom Yurek % Ethan Kayser % Login : sjubaer % mrackish % tyurek % kayser % Section : 3Whalen % Team : Team 51 % % ELECTRONIC SIGNITURE % Shadman Jubaer % % The electronic signature above indicates % th...
%% Stelling 2 % % Het is niet mogelijk om binnen een functie een andere % functie aan te roepen. % Antwoord = 0;
% EM Gun coil calculations % calculates coil winding characteristics % Damon Printz % 12/26/2020 clc; close all; clear; %{ fprintf('Wound copper wire stack\n') wire_dia = 0.511 % mm, wire diameter coil_id = 12 % mm, inner diameter of coil layers = [1:1:10]; % number of layers to analyze % material constants wire_...
%% RBES_Init_Params_EOS.m function RBES_Init_Params_EOS(varargin) global params params.startdate = 1995; params.enddate = 2012; params.lifetime = 6; params.missions_to_be_considered = 'ESA+NASA+CNES no EOS'; if nargin > 0 RBES_Init_params_common(varargin{1}); mode = varargin{1}; else RBES_Init_p...
% Foundation Class: SYGraphicsContext < SYObject. % Written by Satoshi Yamashita. % Fundamental class managing drawing. classdef SYGraphicsContext < SYObject properties (Constant) % Comoposite mode. CompositeModeOver = 0; CompositeModeLighten = 1; CompositeModeDarken = 2; CompositeModeMultiply = 3;...
clear all; close all; clc; fid = fopen('Learning_data12.txt', 'r'); Learning = fscanf(fid, '%g %g %g %g %g %g %g %g', [8 inf]); fclose(fid); T = [1 10;1 10; 1 10; 1 10; 1 10; 1 10; 1 10; 1 10]; %Создать нейронную сеть (например, 2?2) на основе карт Кохонена net = newsom(T,[2 2]); %ф-ция классификации векто...