text
stringlengths
8
6.12M
function [v] = elementsOf(s) v = s.elements;
%% setup paths rootPath = fileparts( mfilename('fullpath') ); while ~exist( fullfile( rootPath, 'setup_BCFW.m' ), 'file' ) rootPath = fileparts( rootPath ); end run( fullfile( rootPath, 'setup_BCFW' ) ); dataPath = fullfile(rootPath, 'data', 'horseSeg' ); resultPath = fullfile(rootPath, 'results' , 'horseSeg_larg...
function votECOGdiode(params) % % retECOGdiode(params) % % If we are doing eCOG experiment, then flash eCOG rect a few times so % eCOG photodiode will pick up 'start' signal. % % April, 2010, JW: Split off from doRetinotopyScan.m % % note: this function doesn't have to be specific to retinotopy. could now % be renamed...
clear all; close all; x = [2 4 -3 1 -5 4 7]; N=7; n0=6; n = -10:10; %%%%%% x1(n) %%%%%% for k=-10:10 index1 = mod(k+4, 7); if (index1 + n0) == N index1 = N; else index1 = mod(index1+n0,N); end index2 = mod(k+4, N); if (index2 + n0) == N index2 = N;...
function [v]=gaussian_quadrature(f,a,b,n) % Gaussian Quadrature Algorithm for Integration % % Solves int_a^b f(x) dx across n panels. % % Arguments: % f : function % a : lower bound % b : upper bound % n : number of intervals % Returns: % v : value of integral ...
function [H] = gen_data(N,M) H = sqrt(1/2).*crandn(N,M); end
% This week's tutorial demonstartes how to make a graphical user interface % (GUI, pronounced gooey) for your program. GUI are implemented inside % functions and the user interface controls (buttons and such) live inside a % matlab figure window. In matlab, GUI's can be create using matlab's GUI % tool called GUIDE or ...
%Exercitiul 3 %Se genereaza un vector cu elemente complexe %Creem o functie cu 3 parametrii de iesire si unul de intrare, anume %vectorul nostru. %Aplicand functiile din platforma se ajunge usor la rezultat. v = [1,1+i,5-3i,7,4-2i] functia_mea(v)
function scans_to_process = lzDTI_FSLFLIRTcoregisterFAtoT1( scans_to_process ) %lzDTI_FSLFLIRTcoregisterFAtoT1- coreg FA to T1 using FSL flirt % Creates an array of objects of the class lzDTI_participant % % Syntax: participants_to_process = lzDTI_FSLFLIRTcoregisterFAtoT1(scans_to_process ) % % Inputs: % % Outputs: sc...
function res = sig_trace1(dstr, xfile, pars) % Trace sliding fft signals. % Parameters: % f0 - starting frequency (default: auto, right of two highest peaks) % t1 t2 - time range (default: 0..end of signal) % df - tracing freq window (default: 50Hz) % dfs - tracing freq window (default: 10Hz) % window ...
%%%%% x(k+1) = A x(k) + B u(k) %%%%% y(k) = C x(k) + D u(k) Note: Assumes D=0 %%%%% %%%%% Illustrates open-loop prediction %%%% yfut = P*x + H*ufut + L*offset %%%% [offset = y(process) - y(model)] %%%% MIMO model A =[0.299843671875 0; 28.110344238 0]; B =[0.010667 0.010667; ...
function xs = randsInRange(range, count) % Generate random numbers in given range % range: [min, max] bounds for generated numbers % count: number of randoms xs = (range(2) - range(1)) .* rand(count, 1) + range(1); end
[t0,y]=ode23('inverted',[0 3],[0.01 0 0 ]) subplot(2,1,1),plot(t0,y(:,1)) % for e ylabel ('Angular position (rad)') subplot(2,1,2),plot(t0,y(:,3)) % for u ylabel ('Input force (N)')
function [sys]=params_fun(K, b) % motor paramretrs CL 321 Pn = 8; % W wn = 315; %rad/s Un = 110; %V In = 0.58; %A Mn = 0.123;% H*m Jm = 0.59*10^(-4); %kg*m^2 * 10^(-4) R = 25.8; %Om L = 130*10^(-3); %mHn %formules Ta = L/R; %s armature time constant ce = (Un - In*R)/wn; cm = Mn/In; Tm = (R*Jm)/(ce*cm);% electrom...
t=(1:77)/128; s_delay=diag( ones( 1 , 77 - 8 ) , 8 ); u60_delay=diag( ones( 1 , 77 - 16 ) , 16 ); u150_delay=diag( ones( 1 , 77 - 27 ) , 27 ); u240_delay=diag( ones( 1 , 77 - 39 ) , 39 ); ax=[0 0.7 -6 6]; subjects={ 'JP04' 'JP05' 'JP01' 'JP07' 'JP03' 'NJP01' 'NJP04' 'NJP06' 'NJP05' 'NJP02' 'NJP03' }; %subjects={ 'JP04...
clear all % establish users preferences as to how model is initialised and as to % type of threshold used for the predictability. random=str2double(inputdlg('0=chosen file as intro, 1=random intro sequence', 'Intro type',1,{'1'})); if random==0 introfile=inputdlg('Input file name (DONT INCLUDE FILE EXTENSION)'...
function gms2 = dgm2star(A,B,C,D,E,tol) %%DGM2STAR Infimum or Optimal Value for Discrete-time H2 Control % % gms2 = dgm2star(A,B,C,D,E) % % calculates the infimum or the best achievable performance % of the H2 suboptimal control problem for the system: % % x(k+1) = A x...
load([project.paths.processedData '/GMM_configs/GMM_scores_32_10_mwv_mfc.mat'],'gmmScores'); gmmScores = sum(gmmScores,2); load('C:\Users\SMukherjee\Desktop\behaviourPlatform\MNI\sankar\spic\dual_eng\surrogate_trial.mat','index_comb'); load([project.paths.processedData '/processed_data_word_level.mat'],'D'); load([pro...
function [histogram, bins] = histogram(indata, binStep) max = 255; vectIndata = reshape(indata, 1, []) * max; histogram = zeros(1, floor((max / binStep) + 1)); bins = (0 : binStep : max) / max; for i = 1 : length(vectIndata) index = floor(vectIndata(i) / binStep) + 1; histogram(inde...
function [ allAss ] = annotation3text(ass,txtP,mz) %annotation3text - toned down version of its predecessor if isstruct(mz) mz = mz.cmz; end wb = waitbar(0,'Initiating','Name','Exporting Annotations'); % Say to where you are exporting the data disp(txtP); % Create the file fid = fopen([txtP '.txt'],'w'); % Wr...
% FIR Filter clear clc Fs = 44100; fp = 440; fs = 2*fp; W = fs; % cutoff N = 64; % order type = "low"; B = fir1(N, W, type); stem(B); plot(B)
%% run heding backtest clear all; error = []; vol = [0.2:0.05:0.6]; for i = 1:length(vol) i h1.vol = vol(i); h1 = deltahedging_backtest; h1.init_etf50settings(); h1.total_val = 1000000; h1.invest_frac = 0.6; % 计算理论期权价格及其损益 h1.cal_theo_price(); h1.cal_theo_option_pnl(); %% 等间隔 delta对冲 h1.hedge_time_inte...
% get a slide from point cloud perpendicular to one of the axis % of the co-ordinate system with a tolerance % parameters: % fname - input coordinate file (default lidar.txt) % coo - coordinate of section (default 1000) % col - coordinate column (default 3) % tol - tolerance to co-ordinate (default 0.2) % sep...
function Mesh = IOrPoly(filename, args, hOrd, scal) % Mesh = IOrPoly(filename, args, hOrd, scal) % reads Triangle mesh generated files % filename = name of the *.poly file without extension % args = selected arguments % % The following args are enforced: % -p Triangulates a Planar Straight Line Graph (.poly f...
%% % Generate circles around each of the face features % based on the indices returned from the FITW detector % % The following indices correspond to eyes, nose, and mouth: % % Left Eye: [11, 12, 13, 14] % Right Eye: [22, 23, 24, 25] % Nose: [1, 6, 7] % Mouth: [38, 43, 46, 51] % % face_in_X = Input face points, x-com...
function feats = compute_CNNFeats_GPU(net, images, ker_factor) % use gpu to compute features on a set of 'images' using convnet 'net' if (nargin < 3) ker_factor = 0.6; end batchSize = 256; [h,w,dim] = size(images{1}); feats = []; nImages = length(images); numBatches = ceil(length(images)/batchSize); for k = 1:n...
function F_t = F_t(X_s) F_t = sigma(X_s); %needes to be in range of 0<=s<=t end
% This function adds all of the jars in the 'jars' directory. This function % will be called when the 'pop_hedconversion' and the 'validatehed' % functions are executed. % % Usage: % >> addJars(); % % Copyright (C) 2015 Jeremy Cockfield jeremy.cockfield@gmail.com and % Kay Robbins, UTSA, kay.robbins@utsa.edu % % % T...
function run_ivt(directory) root_directory = fileparts(mfilename('fullpath')); includes = {fullfile(root_directory, 'common'), ... fullfile(root_directory, 'ivt') }; for i = 1:numel(includes) addpath(includes{i}); end; if nargin < 1 if exist('traxserver') ~= 3 error('Traxserver MEX file not found!...
%testmyspline clc; clear; close all; x=1:20; x=x'; y=randn(size(x)); xx=linspace(min(x),max(x), 10000); type='d1'; d=[-1,10]; yy_d1=myspline(x,y,xx,type,d); type='d2'; d=[0,0]; yy_d2=myspline(x,y,xx,type,d); type='periodic'; yy_per=myspline(x,y,xx,type,d); figure(1); hold on; plot(x,y,'o'); plot(xx,yy_d1,'r'); plot(...
function [ P ] = HammRadiusRecall( trainZ, q, r, gnd, junk ) %HAMMRADIUSRECALL Summary of this function goes here % Detailed explanation goes here nquery = size(q, 1); P = 0; for i = 1:nquery point = q(i, :); dist = sum(bsxfun(@xor,trainZ,point),2); inds = find(dist <= r + 0.00001); if isempty(ind...
rtpset='full' data_path='/asl/data/cris/sdr60'; src='_noaa_ops'; data_str=''; rtp_core
function [p] = PL_intersect(L1, L2) % Intersect L1 and L2 intersect and return the point closest to L2 u1 = L1(1:3); v1 = L1(1:3); u2 = L2(1:3); v2 = L2(4:6); p0 = PL_closest_point_to_origin(L1); e = cross(u1,u2)/dot(u1,v2); v = v1./norm(v1); % solve the system e = p0 + t*u for variable t: t = v'*(e - p0); end
function [ output ] = selectbest(particles,bests) [a,b]=size(bests); [m,n]=size(particles); for i=1:a mi=particles(1,n-1); k=1; [m,n]=size(particles); for j=2:m if particles(j,n-1)<mi mi=particles(j,n-1); k=j; end end bests(i,:)=particles(k,:)...
function out = chi_jellium(rs); printf(" \n"); printf("rs = %f \n",rs); kF = 1.92/rs; %# from Ashcroft book chi0 = kF/pi^2; printf("chi0 = %f a.u. \n",chi0); printf("note: chi0(q=0,w=0) equals DOS at EF! \n"); printf("note: BGW output in rydberg, multiply by -2! \n \n"); n = 3/4/pi/rs^3; getIxc; %# divide by 4 bel...
function [samplingrate] = estimate_samplingrate_v01(timestamps) % function [samplingrate] = estimate_samplingrate_v01(timestamps) % This compute the empirical sampling rate of eytracker % recordings. Based on timestamps. % % Input: % - timestamps: A vector of time stamps from an eyetribe recording (i.e. % eye...
% Task2 Car License Plate Recognition (1) %% binarize the license plate and the alphanumeric template images im_CLP_original = imread('car_license_plate.bmp'); im_CLP = rgb2gray(im_CLP_original); im_AT_original = imread('alphanumeric_templates .bmp'); im_AT_reversed = imcomplement(rgb2gray(im_AT_original)); im_CL...
close all; clear all; % Answer to Problem 1 Problem1; % Answer to Problem 2(a) (b) (d) Problem2; % Answer to Problem 3 Note: need input to run Problem 3 jointAngle_ini = [3, 2]; jointVelocity_ini = [1, -1]; jointAcc_ini = [1,1]; Ini_states = [jointAngle_ini; jointVelocity_ini; jointAcc_ini]; Problem3(Ini...
function [mo] = ICV_MSE(mi1, mi2) % Function: ICV_MSE % Input: % mi1: 2-D matrix % mi2: 2-D matrix % Output: % mo: Mean square error mo = sum(sum((mi1-mi2).^2))/numel(mi1); end
function [hv] = hypervolume(obj_ori) %This function calculate the hypervolume of the input objective vector obj_refined=[]; obj_refined=domination_check(obj_refined,obj_ori); %initialize the hypervolume hv=0; %calculate the hypervolume [amount_indiv,~]=size(obj_refined); obj_refined=sortrows(obj_refined); for cnt_1=...
function [numopen, denopen, denclsd]=rldesign(num,den,s1) % Hadi Saadat, 1998 clc discr=[ ' ' ' The function rldesign(num, den, s1) is used for the root-locus design ' ' of a linear control system. num & den are row vectors of polynomia...
function plot_rewards( ) %PLOT_REWARDS 此处显示有关此函数的摘要 % 此处显示详细说明 x = 3:20; x_n=0; y = 21:30; signal = 9; rewards=zeros(length(x),length(y)); for short=x x_n = x_n + 1; y_n = 0; for long=y y_n = y_n+1; rewards(x_n,y_n)=calc_reward(short, long, sign...
clear; clc; %petunjuk : evaluasiindividu input = vector, output [fitness, cost] %random nilai daya %baru masuk ke pso maxCost = 9999999999; jumlahGenerator = 6; jumlahPopulasi = 10; iterasi = 200; c1 = 1; c2 = 1; r1 = 0.4; r2 = 0.5; [populasi, fitness, cost] = randomPopulation(jumlahPopulasi, jumlahGenerator, iterasi);...
%{ tp.Motion3D (computed) # my newest table -> tp.FineAlign -> tp.Ministack ----- frame_corr : longblob # (um) the correlation coefficient of frame to stack xyz_trajectory : longblob # (um) xyz trajectory of scan relative to the middle of the stack zdist : longblob # (um) z trajectory centered around...
function [convexity ,rev] = getConvexityByNewMeasure(seg_skull_in) convexity = 0; rev = 0; BW = seg_skull_in; BWSave = BW; [x,y] = mass_center_here(BW); center = [x,y] ; centered_img=centerimgHere(BW,center); for k = 0:2:179 imR = imrotate(centered_img, k); [row_ind, col_ind] = find(BW...
function hist = my_diphist(resim) I=imread(resim); hist=zeros(1,255); sz = size(I) for i=1:sz(1) for j=1:sz(2) say=I(i,j); hist(say) = hist(say) + 1; end end end % my_diphist('cameraman.tif') %cehars
%clear; matlabUtil = '../share/matlab'; addpath(genpath(matlabUtil)); JCMsuite_init(1); setup; jcmwave_jcmt2jcm('materials.jcmt', keys, 'outputfile', './jcmFiles/materials.jcm'); jcmwave_jcmt2jcm('layout.jcmt', keys, 'outputfile', './jcmFiles/layout.jcm'); jcmwave_geo('./jcmFiles'); jcmwave_view('./jcmFiles/grid.j...
% evaluation of the mask method when there are >1 matches for a single ROI and comparison of its output with the inpolygon method. figure; eftMatchIdx_mask = NaN(1, length(rois)); for iman = 1:length(rois) f = find(maskOverlapMeasure(:,iman)>0); if length(f)==1 eftMatchIdx_mask(iman) = f; ...
close all; clear;clc; rootPath = 'data'; streamline = 'Streamline6'; blade = 'Blade'; fileSuffixes = '.dat'; numOfBlades = 24; for i = 1:numOfBlades varName = [blade,num2str(i,'%02d')]; tmp = load(fullfile(rootPath, streamline, [varName,fileSuffixes])); tmp = tmp(1:2:end,:); data(:,i) = (3*tmp(:)+0.1*r...
%% Description % % The goal is to perform following task % 1. The train and test accuracy are calculated based on the Newton's method with regularization parameter % 2. To plot train and test accuracy rates Vs regularization parameter % ============================================================ %%Loading the...
function [activity, rois] = applyCustomROIsToTifs(imfilename, tifList) % activity = applyFijiROIsToTifs(pathToROIZip, tifList) % % Apply custom ROIs saved in imfilename to the tif files in the cell % array tifList. Returns an array activity, which is the mean fluorescence % over time (rows) in each ROI (columns). ...
clear all % Note that it already applies the negtive 10 volts shift % edit to where your files are stored %this must also be in your matlab path place_of_files = 'C:\Users\Jacob\Desktop\School stuff\AEM 4602\data_directory'; % Number of files that you have number_of_files = 257; dir_help= '\lab2-'; % May have to ch...
function res = intersectar (v1,m1,v2,m2) c = v1(2)-m1*v1(1); d = v2(2)-m2*v2(1); res = [(d-c)/(m1-m2) , (m1*d - m2*c)/(m1-m2)]; end
function dt = myODE(t,x) dt(1) = sin(x(1)); end
in_index = (1:16)'; % include in path, the foldername. FolderName = '.\furnace302\'; filename = 'furnace302.mat'; out_index = 17 ; n_obj = length(out_index); % currently the file PP_NNGA_subsets supports the input data in form of matrix (not cell) type. for out=out_index PP_NNGA_subsets(FolderNam...
function varargout=dewatermark_img(varargin) %Questa funzione effettua l'operazione di estrazione di un watermark di %tipo immagine, inserito tramite la funzione watermark_img. %Accetta almeno un parametro di ingresso e restituisce un solo parametro di %uscita (l'immagine appunto). Può accettare un'eventuale key numeri...
%% Image Analysis Script % This is code batch processes images for fractional cover. % Does NOT allow for cropping of images right now. %%%USER INPUTS%%%%%%%%%%%%%%% folder = 'C:\Users\susanmeerdink\Dropbox (UFL)\Dennison_Frac_Cover_Project\Photos_to_Process\012812\'; ext = 'CR2'; outputFile = 'C:\Users\susanmeerdink...
function Map = VMT_LoadMap(filetype,coord,varargin); % This routine loads a map file from either a text file or a .mat file. % % Input: filetype = 'txt' for a text file (2 col (x,y), no headers); 'mat' for a matlab data file % coord = 'UTM' for UTM coordinates or 'LL' for latitude, longitude (in dec de...
%Problem 10 clc;clear;close all; %% 4ASK mapping b=[0 0 0 1 1 1 1 0];%input a=fourASK(b); %% modulator Ts=0.002;T0=Ts/10; t=0:T0:Ts*(length(a)+1); xt=modu(a,Ts,t); %% after receive filter p = @(t) rect((t-Ts/2)/Ts); y = xt; tp = 0:T0:Ts; h = p(Ts-tp); z = T0/Ts * conv(y,h); ...
warning off mkdir('../pictures') %% a quick peak of lost data to decide the position of FILD m = importdata('../orbit_results/dist.plt'); lost = m.data; thet = lost(:,2); thet = rem(thet,2*pi); zet = lost(:,3); zet = rem(zet,2*pi); x=lost(:,4); z=lost(:,5); en=lost(:,6); ptch=lost(:,7); pz=lost(:,8); type=lost(:,13); ...
function [errorCode, errorMsg,entrustNoList, batchNo] = Order(connection,token,orderList) import com.hundsun.esb.* com.hundsun.esb.data.*; [errorCode, errorMsg, packet] = CallService(connection,MakeRequestPacket(token,orderList)); entrustNoList = -1; batchNo = 0; if errorCode == 0 [batchN...
function [w, b, obj, cvErrs] = ridgeRegInefficient(X, y, lambda) n = size(X,2); X = [X; ones(1,n)]; k = size(X,1); cvErrs = zeros(n, 1); W = zeros(k, n); I = [[eye(k-1);zeros(1,k-1)] zeros(k,1)]; for i = 1:n x_i = X(:,i); X_i = getXI(X, i); y_i ...
function gam = dgm8star(A,B,C,D,E) %DGM8STAR Infimum or Optimal Value for Discrete H-infinity Control % % gms8 = dgm8star(A,B,C,D,E) % % calculates the infimum or the best achievable performance % of H-infinity suboptimal control problem for the plant: % % x(k+1) = A x...
% This function is used in "Kinematics.m". % It is used for plotting the stationary triangle (mobile platform) function [x y x1 y1 x2 y2 x3 y3 x11 y11 x22 y22 x33 y33]=Triangle(pos,vec,dis, t1, t2, t3) L=2; l1=2;l2=2;c2=3;d2=0;c3=1.5;d3=3.5; pos1=pos; pos3=[pos(1,1)+dis*cosd(vec+60),pos(1,2)+dis*sind(60+vec)]; p...
function update_results_plot(varargin) %% update_results_plot.m % % Usage: % update_results_plot();% will use latest results file % update_results_plot('filename.rs');% with specified results file % % Plots current view of the Pareto frontier % import rbsa.eoss.*; import rbsa.eoss.local.*; import java.io.*;...
function [mean_evolution1, mean_evolution2, max_evolution1, max_evolution2] = dataAnalysis(data, wav_files, w_L, shift) %UNTITLED2 Summary of this function goes here % Detailed explanation goes here n_files = length(wav_files); w_prior = []; mean_evolution1 = []; max_evolution1 = []; mean_evolution2 = []; max_evol...
% function R = possiblePairs( features1 , features2 ) %thr=.1;%%set1 %thr=1;%%set2 R=[]; for i=1:size(features1,1) thr=immse(features1(i,:),features2(1,:)); min=[]; for j=1:size(features2,1) if immse(features1(i,:),features2(j,:))<thr min=[i j]; thr=immse(fea...
function power_total = trim_power_prop(Prop_theta_0,Prop_isEnable) %TRIM_POWER_PROP power_total = trim_power_prop(Prop_theta_0,Prop_isEnable) % 输出整机功率 % Prop_theta_0 (rad) % Prop_isEnable = 0(default) or 1 global LowerRotor UpperRotor global Prop global Fus if nargin == 1 Prop_isEnable = 1; else end % x = ...
function [mv] = calculate_multiplier(sensor_nodes, nn) %CALCULATE_MULTIPLIER Summary of this function goes here % Detailed explanation goes here %total_packets = 0; mv(1:sensor_nodes) = 0; %while total_packets ~= sensor_nodes % for i = 1:sensor_nodes % current_nn = nn(i); % ...
function [CCBefore, CCAfter, BW1, BW2] = detectROIsC(imageSeqBeforeStd, imageSeqAfterStd, displayFig) % ************************************************************************************ % edge detection in order to find ROIs % performing CC algorithem in order to find the actual index of ROIs. % % ***************...
s := BelyiDBInitialize(); /* Base Field Data */ base_field_data := [* *]; K1<nu1> := NumberField(Polynomial([RationalField() | 1, -1, 1])); place1 := InfinitePlaces(K1)[1]; conj1 := true; CC<I> := ComplexField(20); z1 := 0.00000000000000000000p20; base_field_data_1 := [* K1, place1, conj1, z1 *]; Append(~base_field_d...
% % history points for wavy wall cases % in X-Y plane going up to Y=0.5 % function wwMpts(casename) % mesh points lx1=8; xlen=1; ylen=1; if(strcmp(casename,'smoothWavyWall')) nelx=64*0.25*xlen; nely=16*ylen; elseif(strcmp(casename,'roughWavyWall')) nelx=128*0.25*xlen; nely=32*ylen; end x=semmesh(nelx,lx1,0)*xlen;...
%% Define Red Pitaya as TCP/IP object clc close all % IP= '192.168.101.108'; % IP of your Red Pitaya... IP= 'rp-f01b63.local'; % rp-MAC.local MAC are the last 6 characters of your Red Pitaya port = 5000; % If you are using WiFi then IP is: RP=tcpip(IP, port,'InputBufferSize',3...
%load data %ptbCorgiData = uiGetPtbCorgiData(); % loadGroupedData; % ptbCorgiData{1} = ptbCorgiDataShort; % ptbCorgiData{2} = ptbCorgiDataMid; % ptbCorgiData{3} = ptbCorgiDataLong; nP = ptbCorgiDataShort.nParticipants nGroup = 3; for iP = 1:nP, for iGroup = 1:nGroup, participantData = ptbCorgiData{i...
function handle = run(varargin) % RUN % % DESCRIPTION: % Wrapper for calling ground truthing tool % % % COMMENTS: % Arguments passed on directly to tool % % %@ % Copyright 2016 The Johns Hopkins University Applied Physics Laboratory % % Permission is hereby granted, free of charge, to any person obtain...
(FirstYear, LastYear)=> let YearStart = #date(FirstYear, 1, 1), YearEnd = #date(LastYear, 12, 31), DayCount = Duration.Days(YearEnd - YearStart) +1, DayList = List.Dates(YearStart, DayCount, #duration(1,0,0,0)), DayTable = Table.FromList(DayList, Splitter.SplitByNothing()), RenamedCols = Table....
%---------------------------------------------------------------------------- % plot_temp.m % % read in data from a historical and control run. plot several manifistations % of the data. % % compute a simple linear regression of the data % % compute a running mean % % there are two ways of computing the temperature...
function [estado,index_G,ajuste_limiar,fator_peso,flag_fim] = ... state_machine(estado,buffer,flag_fim,index_G,ajuste_limiar,fator_peso,tam_nivel) %========================================================================== % Função recebe o estado atual e toma a decisão da escolha do próximo % estado através da matr...
function image_features = get_pyramid_gist_fisher(image_paths) gists = get_gist(image_paths); sifts = get_fisher_sifts(image_paths); pyramids = get_pyramid_sift(image_paths); image_features = [gists sifts pyramids]; end
function J_toe = J_toe(in1) %J_TOE % J_TOE = J_TOE(IN1) % This function was generated by the Symbolic Math Toolbox version 8.5. % 04-Dec-2020 16:29:36 q_t1 = in1(:,1); q_t2 = in1(:,2); q_t3 = in1(:,3); q_t4 = in1(:,4); q_t5 = in1(:,5); q_t6 = in1(:,6); t2 = q_t1+q_t2; t13 = atan(5.18251222829003e-1); t14 = a...
function merged_ROIs = mergeROIs_set(mouse, imagingFolder, mdfFileNumber, thMerge, doEvaluate, saveMergedVar) % % Newest method for merging ROIs: uses Eftychios's method however instead % of defining spatial overlap as A'*A, it uses your custom method, ie based % on fraction overlap of masks driven from A (at .95 c...
function kappa_f = getkappa_f(sgPriorName,parameter) % getkappa_f returns kappa_f function needed to estimate SG prior parameters % % input arguments: % sgPriorName SG prior name % parameter SG prior parameter % % output arguments: % kappa_f kappa_f function % % Pérez-Bue...
%% DATA EXPLORATION % 1. Data structure exploration % 2. Visualization %% Load depedencies addpath '../../data/test alpha 5s' % Data, Not: the data has been bandpass filtered, descripiton is in the README.md addpath '../../tools/spectral' % tools ALLEEG = load('5sopen_close.mat').ALLEEG; ...
function [low, high]=iqr(x, f, skipNaN) if exist('skipNaN','var') && skipNaN x=x(isfinite(x)); end if nargin==1; f=0.68; end if min(size(x))==1 & size(x,2)>size(x,1); x=x(:); end if isempty(x) low=NaN; high=NaN; return end if length(x)==1 [low, high]=deal(x); if nar...
% test struct: grades = []; level = 5; semester = 'Fall'; subject = 'Math'; student = 'John_Doe'; fieldnames = {semester subject student} newGrades_Doe = [85, 89, 76, 93, 85, 91, 68, 84, 95, 73]; grades = setfield(grades, {level}, ... fieldnames{:}, {10, 21:30}, ... newGrades_Doe); spindle(1).sensor = 'Cz'; spindle(1...
function cmenu = setAnnotationContextMenu(obj, hPoly ) % SETANNOTATIONCONTEXTMENU % % DESCRIPTION: % % % SYNTAX: % % % INPUTS: % % % OUTPUTS: % % % COMMENTS: % %@ % Copyright 2016 The Johns Hopkins University Applied Physics Laboratory % % Permission is hereby granted, free of charge, to any person obtaining ...
thickness % Extracts ri and kh from a file calculates ocean mask finds width. % Establish weight as thickness times mask. wt=width.*mask' %Initialize sums sumwt=0.; sumwtri=0.; sumwtkh=0.; for k=1:n sumwt=sumwt+wt(k); sumwtri=sumwtri+wt(k)*ri(k); sumwtkh=sumwtkh+wt(k)*kh(k); end riwtav=sumwtri/sumwt khwtav=...
% $Header: svn://192.168.32.71/trunk/AMIGO_R2012_cvodes/add_DynamicOpt/Preprocessor/AMIGO_private_defaults_OD.m 770 2013-08-06 09:41:45Z attila $ function [inputs_def]= AMIGO_private_defaults_DO() % AMIGO_private_defaults: Assign defaults that may not be modified by user % %*******************************************...
clear A = [1 2; 3 4; 5 6]; B = [1 2 3; 4 5 6]; % 1. Which of the following is posssible ? C1 = A'+B % -> 3x2 transp + 2x3 = 2x3 + 2x3 -> fine C2 = B*A % -> 2x3 * 3x2 -> inner match -> fine % C3 = A+B % C4 = B'*A % 2. Which of the following indexing expressions gives B=⎡⎣⎢⎢⎢16594211714⎤⎦⎥⎥⎥? Check all that apply A =...
varOfInterest = repmat({'prob_offset.mat'},length(folderName),1); varOfInterest2 = repmat({'output_offset.mat'},length(folderName),1); for iFile = 1:length(fileSave) posterior_probability{iFile,j} = importdata([fileSave{iFile} filesep varOfInterest{iFile}]); output{iFile,j} = importdata([fileSave{iFile} file...
cond=2*tol; iter = 0; dvF = zeros(N,1); dvB = zeros(N,1); while cond>tol % value function iteration V_in =V; % Finite difference approximation dvF(1:end-1) = (V(2:end) - V(1:end-1))./(s_vec(2:end) - s_vec(1:end-1)); % Forward dvF(N) = (y2 + r_vec(end)*s_vec(end)-c_bliss)^(-gamma); dvB(2:end) ...
%{ olf.SiteMetrics (computed) # -> olf.RespOpt -> preprocess.Spikes -> preprocess.MaskType --- sparseness_on : float # sparseness sparseness_off : float # sparseness pactive_on : float # ratio of active cells pactive_off ...
%% clear %clc %N = 50000; %E = 250968; N = 2048; k = 7; E = (k*N)/2 %13712; if E< (N-1)+ceil(((N+2)*sqrt(3*(N+2)))/9) fprintf('Correct!!!\n'); end eps2 = 0.02; sigma = 1.0 - eps2; %a = 1 p = -2*sigma - 4; q = 8*sigma + sigma^2 + 1 - N; r = 2*E - 4*sigma^2; %fprintf('p= %0.4f q= %0.4f r= %0.4f\n',p,q,r); a = (1/...
%% Przykladowe zadanie 1 % Dana funkcja % y' + y = -2*pi*e^(-x)*sin(2*pi*x) % y' = -2*pi*e^(-x)*sin(2*pi*x) - y % Warunki poczatkowe % x0 = 0, y0 = y(x0) = 1 % Dodatkowe dane % Policzy? w przedziale <0, 10> % h = 0,001 % Wynik analityczny = y(x)=e^(-x)*cos(2*pi*x) clc; clear; dydx = @(x, y) (-2*pi*exp(-x)*sin(2*pi*x) ...
function [nll,g,H,T] = LogisticLoss(w,X,y, lambda) % w(feature,1) % X(instance,feature) % y(instance,1) [n,p] = size(X); Xw = X*w; yXw = y.*Xw; % Compute NLL(w) nll = sum(log(1 + exp(-yXw))) + (.5*lambda*w'*w); if isinf(nll) % Fallback on log-sum-exp trick if you overflow nll = sum(mylogsumexp(...
close all; clear all; FieldSize = [ 2 2 ]; % cm %FieldSize = [ 10 10 3 3 ]; % cm Depth = 10; % cm MU = 200; % Location of cross profiles x_offset = 0; y_offset = 0; filename = sprintf('W:\\Private\\Physics\\21eX91 Validation - DJJ\\1 - Open Field\\01 - Symmetric Fields\\Mapcheck\\%dx%d_%dcm_%dMU.txt',FieldSize(1),...
function [ TangoPosesRGB_SS, TangoPosesRGB_AL, tangoTimesRGB ] = getRGBPoses( folder,tangoPose,validFiles ) %GETRGBPOSES Summary of this function goes here % Detailed explanation goes here %% List images imageFiles = dir([folder filesep '*.jpg']); imageFiles = cat(1,{imageFiles(:).name})'; TangoPosesRGB_SS = cell(l...
function [varargout] = pdpts(n,varargin) %------------------------------------------------------------------------------- % USAGE of "pdpts". % % Pad = pdpts(n) % Pad = pdpts(n,xyrange) % [X1,Y1,X2,Y2] = pdpts(n) % [X1,Y1,X2,Y2] = pdpts(n,xyrange) % % Compute the (first family of) Padua points, either as a matrix Pad ...
function [index, boolean] = essentialBoundaryOnCircleFilter(p,t,problem) tol = 10000*eps; [n, ~] = size(p); e = boundedges(p,t); e = unique(e)'; switch problem case 1 index = e; case 2 boundaryPoints = p(e,:); filtro = ( abs(boundaryPoints(:,1)) < tol & ~(abs(boundaryPoints(:,2...
clear; clc; addpath('E:\Dropbox (MGEP)\RepositoriosGitHub\VariabilityModelingSimulink\SimManipulation'); init; %Initialize variables configName = 'default'; configFileName = [configName '.config']; simulinkConfigurationNameNoSLX = ['TanksModel_' configName]; simulinkConfigurationName = ['TanksModel_' configName '.sl...