text stringlengths 8 6.12M |
|---|
function IlusionPaperCodeForFigures
% This function plots data in all figures of Agrochao, Tanaka et al.
% (2020) Mechanism for analogous illusory motion perception in flies and
% humans. margarida.agrochao@yale.edu
%% Figure 1D: Wild-type turning response
load('Figure1D_data.mat')
load('general_parameters.mat')
Figur... |
function coeffs = fourierbasis(X, T, N)
% X has colums as time-series
dim = size(X);
M = dim(1); d = dim(2);% no. of timepoints
t = linspace(0, T, M);
phi = ones(M, 2*N+1);
% least squares fit to find coeffs
for i = 1:M
for j = 2:N+1
phi(i,j) = cos(2*pi*(j-1)*t(i)/T)... |
function [dydt,ChirTime]=VTD_Landscape_Model_Fitting_v3(t,y,p, dt, ChirTime)
%Epi as glued attractor
%%Sixth version of the landscape model for Vertebrate Trunk Development.
%Chir integration with time.
%% Parameters
%p=(WNT, FGF,a0,b0,c0,u0,v0,a1,b1,c1,u1,v1,a2,b2,c2,u2,v2,a3,b3,c3,u3,v3,lambda,mu,e1,e2, alpha, g... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% -DESCRIPTION
% Running complicated tasks sometimes take huge amount of execution time in matlab. Supose you want to stop running a command,
% if it takes too much execution time, then this is the code for you. Using function 'ev... |
% This function use the result (R,T) in eight point algorithm and the given
% camera intrinsic matrix K, transfor the coordinates of two corresponding
% pixel points to two 3d coordinates of two cameras
function [XYZs_1,XYZs_2]=get_3d_location(xys_1,xys_2)
R=[0.816469717915658,-0.206449333203566,-0.5392178340397... |
function [r, v] = rv_from_oe(a,e,RA,incl,omega,theta,mu)
% This function computes the state vector using the
% classical orbital elements (oe).
% Based on Algorithm 4.5 from Orbital mechanics for engineering students,
% 2010, by H.D. Curtis
%
% INPUTS:
% oe = vector of orbital elements
% mu = g... |
function IcC(Ej,Ec)
% IcC Calculates Ic, C from Ej,Ec.
% Units:
% Ej: GHz; Ec: GHz.
FluxQuantum = 2.067833636e-15;
PlanksConst = 6.626068e-34;
ee = 1.602176e-19;
Ic = 2*pi*PlanksConst*1e9*Ej/FluxQuantum/1e-9; % Unit: nA.
C = ee^2./(2*PlanksConst*1e9*Ec)/1e-15; % Unit: fF.
disp(['Ic = ', num2str(Ic), 'nA; C = ', num2st... |
global Sum deltaM1 INMatrix Norm_AIM ;
global HOUTy HINx HOUTx HINy INx INy OUTx OUTy halfx halfy;
global z0 a0;
global xu_x xu_y ;
global AIM;
global Norm_Sum
global field
% AIM=imread('ZJUlogo.bmp');figure(1);imagesc(AIM);
% small_AIM = scale(AIM,70,100);
[INx,INy]=size(AIM);
% OUTx = INx;OUTy = INy;%... |
% Este programa retorna a resposta do exercício 5 da lista 1.
disp('5) Calcule a altura total dos dentes de uma engrenagem cilíndrica de dentes retos cujo módulo é 1,75.')
m=1.75 %módulo.
disp('5)A resposta do exercício 5 da lista 1 é : a altura total dos dentes em mm da engrenagem cilíndrica (h)=')
disp(2.166*m) %... |
function res = saveVol (path, header, BScanHeader, slo, BScans, options)
%SAVEVOL Stores Heidelberg Engineering (HE) OCT raw files (VOL ending)
% Currently version HSF-XXX-102 is used, without Thickness Grid
% May be not completly bug-free!
%
% Writen by Markus Mayer, Pattern Recognition Lab, University of
% Erlangen-N... |
function plot_radscanresults_step23(step2dir,step3dir)
if step2dir(end-3:end)=='.dat'
dirlist={};
fid = fopen(step2dir);
tline = fgetl(fid);
while ischar(tline)
if tline(1)~='%' && tline(1)~='!'
dirlist={dirlist{:},tline};
end
tline = fgetl(fid);
end
fclose(fid);
[runs2,miss2]=getresult... |
% Running overhead runs AS in full.
clear all
close all
fclose('all')
% User input file names
bdf_file = 'BDF.txt';
loadcase_file = 'LOADCASES.txt';
wing_nodes = [1:26]; % these are the node ID's affected by the aero.
% loadcase_file = [];
[nodes,beams,pbeams,materials,loads,sfcs,aero,vel,gravity,g,n,mass_... |
function [f, G] = least_squares_1D_cost_grad_params_parallel(X, params, sample3)
N = params.N; %#ok<NASGU>
W = params.W;
M1data = params.M1;
M2data = params.M2;
M3data = params.M3;
sigma = params.sigma; %#ok<NASGU>
list2 = params.list2;
list3 = params.list3;
bias2 = params.bias2;
... |
function status(gitDir,fid,amend)
%JGIT.STATUS Return the status of the repository.
% JGIT.STATUS(GITDIR) Specify the folder in which Git Repo resides.
% JGIT.STATUS(GITDIR,FID) Output status to file identifier, FID.
% JGIT.STATUS(GITDIR,FID,AMEND) Add "Initial commit" text to status.
%
% For more information s... |
function W = randInitWeights(L_in, L_out)
%epsilon_init = sqrt(6) / sqrt(L_in + L_out +1);
epsilon_init = 0.12;
W = rand(L_out, 1 + L_in) * 2 * epsilon_init - epsilon_init;
end
|
%RHS
%% ureal and preal piecewise and periodic
% (0,1/2)
% (1/2,1)
ureal={@(x) (-x+1/4);
@(x) (x-3/4)};
preal={@(x) (-1);
@(x) (1)};
%% Gu
% (0,delta)
% (delta,1/2)
% (1/2,1/2+delta)
% (1/2+delta,1)
Gu={@(x) (2*(delta*(x - 1/4) - (x*(2*x - 1))/4 + ((delta - x)*(2*x - 2*delta + 1))/4))/delta^2;
@(... |
classdef NonlinearProgram < handle
% NonlinearProgram defines an abstract class for general nonlinear
% programing problems
%
%
% @author Ayonga Hereid @date 2016-10-26
%
% Copyright (c) 2016, AMBER Lab
% All right reserved.
%
% Redistribution and use in source and binary forms... |
function [inputSignals, inputBus, t_end] = MotorDriveUnitBasic_inputs(nvpairs)
%% Input Signals for Motor Drive Unit
% Copyright 2021 The MathWorks, Inc.
arguments
nvpairs.InputPattern (1,1) {mustBeMember(nvpairs.InputPattern, {...
'all_zero' ...
'drive' ...
})} = 'all_zero'
nvpairs.PlotParent (1,... |
function structmat_figure(Cens,varargin)
% structure subplot.
if ~varargCheck('ExtFigureCmd',varargin{:})
figure(next_fig);
end
plotData = ~varargCheck('AccOnly',varargin{:});
accessorize = ~varargCheck('DataOnly',varargin{:});
% default blue colormap
bluemap = @(n_) flipud( ...
[... |
function measDisplacement(dirName,pxl2mic)
print('Loading python modules')
P = py.sys.path;
insert(P,int32(0),'C:\Users\miguel\Anaconda2\Lib\site-packages');
insert(P,int32(0),[pwd,'\postProcessingModules'])
%insert(P,int32(0),'C:\Users\miguel\Anaconda2\pkgs\opencv-3.2.0-np112py27_204\Lib\site-packages')
nFreqIDX = fin... |
clear;clc;clear;clc;
%% get path to folder
dot = '/Users/brandomiranda/home_simulation_research/overparametrized_experiments/';
path = fullfile(dot,'pytorch_experiments/test_runs_flatness2');
%NL
path_all_expts_NL = fullfile(path,'flatness_May_label_corrupt_prob_0.0_exptlabel_RadiusFlatnessNL_samples20_RLarge50')
%RLNL... |
function [bciStruct] = bciCsv2struct(csv_filename)
%This Function aims to decomposed a given BCI csv file
%into structure of trials
%input : csv_file_path
csvMatrix = csvread(csv_filename,1,0);
screeningEEG = csvMatrix(:,1:32);
mentalTaskId = csvMatrix(:,33);
trialNumber = csvMatrix(:,34);
runId = csvMatrix(:,35);
pha... |
function [imgs, time] = preProcVSFP2(fDate, fNum, method, stimTrial)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Preprocessing for VSFP imaging data (Dual Camera Acquisition)
%
% Usage:
% [imgs, time] = preProcVSFP(fDate, fNum, method, stimTrial)
%
% 7/16/2015 - Much faster Version 2.0
% 9/02/2015 - Included "... |
%MATLAB CODE ASSIGNMENT 2 ENPM662
%ANSWER 1
clc
clear all
%writing the code for A matrices
%%declaring the variables and symbols for the matrix multiplication
syms theta1 theta2 theta3 l1 l2 l3 d4 l4
d1=0;
d2=0;
d3=0;
alpha1=0;
alpha2=0;
alpha3=-90;
alpha4=0;
theta4=-90;
%%The general form of the matric... |
% Cam Osborn 2/28/2020
% F16TestCase Declares the control vector and the state vector.
% The script then calls the F16sixDegreeFreedom to test the inputs
% with the state derivative vector.
% INPUTS:
%
% OUTPUTS:
%
% Declare Input Vector
u = [0.9;20;-15;-20;];
% Declare State Vector
x = [500; 0.5... |
clear;
maxNumCompThreads(1)
load movielens100kbrenorm
lambda = 14;
k = 100;
t = tic;
[U1, V1, obj, time]=mc_alt(Y',lambda, 1e-3, 1000, 150);
toc(t)
|
function [shape] = B2Shape(obj,b)
%B2Shape Summary of this function goes here
% Detailed explanation goes here
shape = obj.pca.Coeff2Data(obj.mu,obj.pc(:,1:obj.n_b),b);
end
|
function varargout = GUI_Image(varargin)
% GUI_IMAGE MATLAB code for GUI_Image.fig
% GUI_IMAGE, by itself, creates a new GUI_IMAGE or raises the existing
% singleton*.
%
% H = GUI_IMAGE returns the handle to a new GUI_IMAGE or the handle to
% the existing singleton*.
%
% GUI_IMAGE('CALLBACK',hO... |
%Exercise 7, Andrew Banman
%Computes the VR complex for a random point cloud
% create the set of points and initialize parameters.
load pointsTorusGrid.mat
point_cloud = pointsTorusGrid;
max_dim = 3;
filtration = 0.9;
num_divisions = 100;
results = zeros(5,3); %matrix of computation time/size results
for i = 1 : 5
ti... |
%% Stelling 10
%
% Een functie kan worden aangeroepen vanuit
% de Workspace.
%
Antwoord = 0;
|
%% Initalization of variables, data and distributions
training_data = [];
test_data = [];
n_formants = 14; %variable to enable use of a subset of formants
%get the testing and training data for all vowels
for i = 1:12
[train, test] = vowel_data(i);
training_data(:,:,i) = train;
test_data(:,:,i) = test;
en... |
function [sinoRaw, sinoPrime, sinoScatter] = estimateScatterFromCollimatedPixels( sinoRaw, ...
sinoPrime, sinoScatter, veiwDownSampleRate, scatterCorrection )
% function [sinoRaw, sinoPrime, sinoScatter] = combineScatterSimulation( sinoRaw, ...
% sinoPrime, sinoScatter, veiwDownSampleRate )
%
%
% Meng Wu at St... |
% take in x, y, fs arguments and gives sample outputs
[ h,t ] = impulse_response( x, y, fs )
test1 = h(1);
test2 = t(1); |
%% MILP Formulation of Multi-Robot Task Planning with Space-Time Constraints
%
%
% $Author Dharini Dutia ` $Created October 2018
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Initialization
% Cleanup
clc; clear all; close all;
% Mersenne-Twister with seed 0
% This makes ... |
%% pressurealt.m
% Author: Julianna Evans
% Date: 07.25.17
% Last Revsion: 04.01.18
% Convert pressure altitude (m) to pressure in millibars (used for indexing)
% NOTE: code based off of equation and matlab script from:
% 'https://physics.stackexchange.com/questions/14678/pressure-at-a-given-altitude'
function [pre... |
clear;clc;if ~exist('scripts') | ~endsWith(scripts,'ComplementaryScripts'); run('../../init_rhtoGEM.m'); end
%% This script generates a first draft of a genome-scale model (here: R.
% toruloides) using the getModelFromHomology function in RAVEN. It uses
% S. cerevisiae as a template model,
% BLAST against Sce genome.... |
clear;
clc;
format longg;
activation_function = @(tot) (1 ./ (1 + exp(-1.*tot)));
sequence_x = [1:27,37:68];
sequence_y = [1+68:27+68,37+68:68+68];
sequence = [sequence_x, sequence_y];
NODES = [length(sequence), 50, 4]; % total number of nodes (without bias in layer)
LAYERS = length(NODES);
HIDDEN_LAYERS = LAYERS - 2... |
function mitte
tra = load('pendigits.tra');
f = 'mean_digits.mat';
A = [];
for n = 0:9
A = [A ; mean(filterByLast(tra, n)) n];
end
dlmwrite(f, A, ' ');
end
function r = filterByLast(data, n)
r = data(ismember(data(:,end),n),1:end-1);
end
function [m c] = meanAndCov(data)
m = mean(data);
c = ... |
function[] = currentflowtop()
clear;
clc;
close all;
%calculate the current
I1=currentflow(30,20,15,15,1,1e-2)
%manually select each investigation case
i=0;
if i==1
%mesh density
close all;
I2=currentflow(60,40,30,30,1,1e-2)
close all;
I3=currentflow(90,60,45,45,1,1e-2)
close all;
figure(5)
... |
function [ unmetDemand ] = UnmetDemand( startIndex,endIndex,demand,production )
%% UNMETDEMAND _Function_ UnmetDemand
% Uses for loop to calculate unmet demand over a certain period of time
% Shortens demand and production vectors to specific time period
demand=demand(startIndex:endIndex);
production... |
more off;
addpath("/auto/jlischner/chiM/octave_code");
%# read input.m file:
input;
setup;
%# read stuff (use epsinvomega code):
nmtxdat = load("nmtx.dat");
%# factor of two because spin-resolved chi (see Rousseau/Bergara)
chi0 = load("fulleps.dat")/2;
vcdat = load("gvecs.dat");
n = load("cd.dat");
if( coreflag == ... |
function X = ksplineBHO(ts)
%Baue die Kubic Spline
[n,m] = size(ts); %Bestime Matrix
s=ts(:,1); %Bestime S
t=ts(:,2);%Bestime t
A = zeros(n,4);
for i=1:n
A(i,:) = [t(i) t(i)^2 t(i)^3 1];
end
X = mldivide(A,s)
|
classdef Predictors
methods(Static=true)
function ScoreMatrix = randomPredictor(UserUser, Training, TargetEdgeSet, TrainingValid, ValidationEdgeSet, numPredictionsForValidation, initParams);
ScoreMatrix = zeros(size(Training));
end
end
end |
% Matthew Mangione
% AMATH 482
% Homework 4
%% Setup
% load MNIST training and test datasets
[images, labels] = mnist_parse('train-images-idx3-ubyte', 'train-labels-idx1-ubyte');
[test_images, test_labels] = mnist_parse('t10k-images-idx3-ubyte', 't10k-labels-idx1-ubyte');
% reshape images to vectors // convert pixe... |
clear all
% change those to your local gdrive
addpath script/helpers
data_dir = 'data';
load([data_dir '/camat_fj_20comps_1000iter'])
load([data_dir '/camat_fi_20comps_1000iter'])
figure;
plot(diag(mean(camat_fj.^2,3)), '-ko');
hold on
plot(diag(mean(abs(camat_fj),3)), '-ro')
legend({'Squared Correlations';'Absol... |
% Unscented Kalman filter for parameter estimation.
% Estimate the spacing, velocity and Bando OV parameters of the
% car-following system
clear all
% close all
clc
tic
% plot data
data = csvread('data/VehA_dip_min.csv');
data = data(300:1200,:);
data(:,1) = data(:,1) - data(1,1); % normalize time stamps
% save('data... |
function [ max_Nernst ] = percent_Nernst( log_Conc_Ratios, z )
PhysicalConsts;
max_Nernst = [];
for log_ConcRatio = log_Conc_Ratios
Voltage = 2.3026 * R_Const * (T_Const / (z * F_Const)) .* log_ConcRatio;
Voltage_mV = Voltage;% * 1000;
max_Nernst = [max_Nernst, Voltage_mV];
end
end |
function desiAnnoCopy
%desiAnnoCopy - copy annotations from one mat file to another. File names
%must be the same for this to work
annoPath = '/Volumes/Data/Data/PBC Liver/MAT files/';
blankPath = '/Users/jmckenzi/DB/PBC/';
% Get the file list for both locations
annoList = fileFinderAll(annoPath,'mat');
blankList = f... |
% Analyze complex impulse responses from measurements
% Author: Rick Candell
% Organization: National Institute of Standards and Technology
% Email: rick.candell@nist.gov
clear;
clc;
%% cloud/stationary measurements
% cd('Boulder_c')
% delete('cloud_stats.dat')
% estimate_cloud_cwd('*.mat', [1 1 1 0 1]')
% cd('..')
%... |
% Created on 3 Mar 2015
% Primary author: Kiefer Forseth
% kjforseth@gmail.com
% 602.531.6430
%
% Summary
% Quickly load any patient & task list.
%
% Input
% paths: struct containing directories generated by get_paths()
% patients: string for single patient | cell list f... |
close all
clear;
clc
% load('FigureBlayeredModel3DTraScheme110.mat')
load('FigureClayeredModel3D110.mat')
plotimage(squeeze(Vx(:,80,:))')
xlabel('x/dx')
ylabel('z/dz')
title(' ')
plotimage(squeeze(Vy(:,80,:))')
xlabel('x/dx')
ylabel('z/dz')
title(' ')
plotimage(squeeze(Vz(:,80,:))')
xlabel('x/dx')
... |
function [data_received_equalized, channel, channel_pilot] = Kalman_lovers_v2( rx_data_reshaped, train, rx_train, phase_init, nr_carriers, nr_used_car, length_cpre, length_cpost, Q, pattern,pattern_pilot, data_pilot,nr_OFDM_symbols,nr_pilot,gain_pilot_0,theta_est,length_past, length_fut)
% !!!!!!!!!!!!!!!!!!!Attention... |
function Miscl=Misclpanel(T, EXP, list_params);
% SPLpanel - generic SPL and DAchannel panel for stimulus GUIs.
% S=SPLpanel(Title, EXP) returns a GUIpanel M named 'Levels' allowing the
% user to specify a fixed sinusiodal amplitude modulation to be applied
% to all the stimuli of a series. Guipanel S has title... |
function [IR,IRy,IRx]=ir(gx,hx,x0,T)
%IR=ir(gx,hx,x0,T) computes T-period
%impulse responses of the
%vector [y x], whose law of
%motion is:
% x(t+1) = hx x(t)
% y(t) = gx x(t)
% with initial condition x0
% Inputs: gx, hx, x0, and
%T (optional, default value 10)
%[IR,IRy,IRx]=ir(gx,hx,x0,T) computes the im... |
function [x,f,iter] = ADMM_Lasso_small(x0,z0,u0,tol,maxit,rho,A,b,lam)
% ADMM for Lasso small problem
fun = @(x,lam)0.5*sum_square(A*x-b)+lam*norm(x,1);
f0 = fun(x0,lam);
iter = 1;
AA = A'*A + rho*eye(size(A,2));
Ab = A'*b;
z = z0;
u = u0;
function out = S(a,k)
% soft thresholding o... |
clear;
clc;
load('dvrk_mtm_psm.mat');
mtm = MtmArmModel();
for i=1:60
T = FKine(mtm, mtm_q(:,i));
end
|
function [K] = Koeff(x,y)
for i = 1:(length(x)-1)
K(i) = (y(i+1) - y(i))/(x(i+1) - x(i));
end
end |
function jmp=isclockjump(obuf,obs,poob,jlmt,djlmt,cst,otptu)
%
% Function isclockjump
% ====================
%
% Determine if the current epoch has the effect of a clock jump or not
% It uses a "geometry free" comparison between carrier phase measurements
% in both frequencies, as well as the measurements at... |
function y = lpf(time, u, tau)
%LPF - Low pass filter (PT1)
%
% Y = LPF(TIME, U, TAU) low pass filters the input signal U with
% corresponding time vector TIME using the model pt1.mdl residing in
% ~/Library/Matlab/models/. The differential equation satisfied by U and Y
% is given by
%
% y = w/(s+w) u
%
% where... |
function [ FiltroGeom ] = untitled( input_args )
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
%Leemos nuestra imagen con imread, la transformamos a una sola matriz en
%escala de grises con rgb2gray, le damos un formato doble y la normalizamos
ImOr=double(rgb2gray(imread('rm_rodilla.j... |
global global_rep;
% MUST CHANGE ACCORDING TO SIMULATION!
filtername = 'Sim_Param2';
filter = [0.05];
xaxis = 'Sim_Param1';
%yaxis = 'DHT_RouteFailed_Count';
%yaxis = 'DHT_GetMessage_Hops_Avg';
yaxis = 'Lookup_Latency';
%yaxis = 'DHT_GetMessage_Resent_Count';
%yaxis = 'Get_Failures';
%yaxis = 'DHT_GetMess... |
% Lec 5.1 : Non-linear equations in single variable
% Script file to use Bisection method
% To solve 2-x +ln(x) = 0
%% Initial Guess
xl = 1; % Lower bound of x
xu = 4; % Upper bound of x
fl = fun4Bisec(xl); % 2-xl+log(xl);
fu = fun4Bisec(xu); %2-xu+log(xu);
% Check if signs of fl and fu are different
% The above che... |
function [] = Print_Array(R, N, g)
% Scriu R in fisierul g element cu element
for i = 1 : N
fprintf(g, '%.6f\n', R(i, 1));
endfor
% Un rand liber dupa R
fprintf(g, '\n');
endfunction
|
function [all_channel, Channel_estimate, channel_estimate] = tmp_channel_estimation(signal, RefSignal, M, symbol_size, guard_front, guard_back, Ncp, Ncs, noise_pwr, e1)
useful_signal = signal(guard_front+1:end-guard_back,:);
RefSignal = RefSignal(guard_front+1:end-guard_back,:);
useful_repetitions = floor(size(us... |
function x = calc_thresholds_for_person(person_data, others_data, norm_type, features )
%UNTITLED3 Summary of this function goes here
% Detailed explanation goes here
x0 = [10 10 10 10];
fun = @(x) dc_misclassifications_for_person(person_data, others_data, x, norm_type, features);
options = optimset('Disp... |
function [g]=testAllSVM_2(svmStruct,nMinFrame)
nSl = 1;
nExhale = 14;
nInhale = 14;
% read all the audio files
for i = 1:nExhale
fileNames{i} = strcat('F:\CMUlab\breath detect\trainData\exhale',num2str(i+8),'.wav');
end
for i = 1:nInhale
fileNames{i+nInhale} = strcat('F:\CMUlab\breath detect\trainData\inhale',... |
function varargout = zPulseCrossTalk(varargin)
% <_o_> = zPulseCrossTalk('sourceQ',_c|o_,'targetQ',_c|o_,'numZPulses',<_i_>,...
% 'sourceZLength',_i_,'sourceZAmp',_f_,'targeZLonger',<_i_>,'targetZAmp',<_f_>,...
% 'notes',<_c_>,'gui',<_b_>,'save',<_b_>)
% _f_: float
% _i_: integer
% _c_: char or char string
... |
function [ uvStackNew ] = resizeFlowStack( uvStack )
[rows,cols,~,T] = size(uvStack);
uvStackNew = zeros(rows,cols,T*2);
for t=1:T
uvStackNew(:,:,2*t-1) = uvStack(:,:,1,t);
uvStackNew(:,:,2*t) = uvStack(:,:,2,t);
end
end
|
function [sp] = update_seg(lab_image_gpu, sp, params, gpu_helper, option,...
kernel_find_border, kernel_update_seg_subset)
for iter = 1:option.nInnerIters
for xmod3 = 0:2
for ymod3 = 0:2
%find the border pixels
[~, sp.border... |
% ASLtranslate
% Author: Andrea Murphy
% Date: Spring 2020
%%% Using Bag-of-features to
%%% Extract SURF features from all images
%%% Constructs the visual vocabulary by reducing
%%% the number of features through quantization of feature
%%% space using K-means clustering
% Bag-of-Features
bag = bagOfFeatures(traini... |
%script10_1.m
for i=1:3
eval(['s' num2str(i) '=' 'sqrt(i)'])
end |
%% calculate the mean amplitude of non-quantal responses
function nq_amp = G_Nq_Amp(avg_array,onset,offset,ba)
bmean = mean(avg_array(ba:onset)); % baseline mean, 20ms
%nqmean = mean(avg_array(onset:offset)); % average from beginning to the
%end
nqmean = mean(avg_array((onset+5000):(onset+5500)));
nq_amp = nq... |
function output=preprocess(TT,NP,s)
% s=0 se senza FRF
% s=1 se con FRF
%%{
% fs_filter=60; TT = smoothdata(TT,'movmean',seconds(1/fs_filter));
T=timetable2table(TT);
T(:,1)=[]; %tolgo il tempo
if s==0
if NP=='N'
T(:,1:3)=[];
elseif NP=='P'
T(:,1:3)=[];
end
elseif s==1
if NP=='N'
... |
%[T,Y]=ode45('exo6_dydt',[0 20], [1 1]) ;
%plot(T,Y(:,1))
%[T,Y]=ode23s('exo6_dydt_2',[0 6000], [1 1]) ;
%plot(T,Y(:,1));
[T,Y]=ode45('exo6_dydt_2',[0 6000], [1 1]) ;
plot(T,Y(:,1));
|
function J = uq_Kriging_eval_J_of_theta_CV(theta, parameters)
% UQ_KRIGING_EVAL_J_OF_THETA_CV : Leave-K-Out Cross Validation objective
% function
%
% See also: UQ_KRIGING_OPTIMIZER, UQ_KRIGING_EVAL_J_OF_THETA_ML,
% UQ_KRIGING_CALCULATE
X = parameters.X;
CorrOptions = parameters.CorrOptions;
evalR_handle = CorrOptions.... |
function beta_star = BI_BD(data)
% BI-BD algorithim, edited by Zhengqi Gao, Sep 8th.
% data[matrix R^{K*N}]:corner number * total samples
% esti[vector R^{K*1}]: yield estimation result
%##################################################
[K, N] = size(data);
Mk = sum(data,2);
MAX_ITER1 = 3000;
MAX_ITER2 = 300... |
load('C:\Users\Julia\work\data\others\elenascottX94\ScottElenaCREDOGX94.mat')
mouseno = [1 1 1 1 2 2 3 3 4 4 5 6]
fileid = [1331 1332 1333 1334 1339 1340 1344 1345 1350 1351 1324 1349]
cll = 1;
for fi = 1:length(fileid)
structname=strcat('ID',num2str(fileid(fi)));
tetname = f... |
function R_2 = coefficient_of_determination(L_star, ASWSpread, reference)
% Compute the the coefficient of determination R^2, that is an indicator
% about the quality of model fit.
%
% INPUT:
% L_star: column vector of least residual sum of squares. [real]
% ASWSpread: vector of structs containing the com... |
function [C,CS] = elasticconst(c11,c12,c44,T)
% Generate elastic stiffness tensor C_ijkl in the global coordinate
% C_ijkl is a rank 4 tensor
% Initialize C for non rotated crystal, as xi = ei
C0=zeros(3,3,3,3);
% delta function
delta=eye(3);
% Define H
H=2*c44+c12-c11;
% For cubic crystals presents in... |
function [ A, C_i, C_j, K_ij ] = GenerateAjacencyMatrix( choice, varargin )
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
addpath(genpath('C:\Users\yigu8115\Desktop\My network toolbox'));
switch lower(choice)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... |
function [X,Obj,XTotal] = quasinewton(A,b,X0,NIter,tol)
% minimize norm(Ax-b)
% quasi-newton
k = 1;X = X0;
Diff = (A * X - b);
G = 2 * A' * Diff;
M = size(A,1);
N = size(A,2);
H = opEye(N);
XTotal = zeros(length(X0),NIter);
while ((k <= NIter))% && (norm(G) ... |
function [G, W, E, S, num_Gu, G_x2, W_x2, E_x2] = regulation_constraints_reformulation(A, B, H, F, Sx, Su, Ny, Nu, Umax, Umin, Xmax, Xmin, Refmax, Refmin)
%[G, W, E, S] = constraints_matrices_reformulation(A, B, H, F, Nu, Umax, Umin, Xmax, Xmin)
%
%Return the constraints matrices G, W and E from the reformulated cos... |
filefolder = 'Dataset\';
imagefiles = dir(fullfile(filefolder,'*.*'));
nfiles = length(imagefiles);
for i=3:14
tic
filename = imagefiles(i).name;
fullfilename = fullfile(filefolder,filename);
Ic = imread(fullfilename);
im = rgb2ycbcr(Ic);
omega=0.95;
[rows, column, depth] = size(im);
Y... |
function Z=monomials(vars,deg)
% function Z=monomials(p,deg)
%
% DESCRIPTION
% Construct list of monomials
%
% INPUTS
% p: A polynomial, vector of pvars or a non-negative integer.
% deg: A vector of non-negative integers specifying the degrees
% of monomials to be included Z.
%
% OUTPUTS
% Z: lz-by-1 li... |
%load in variables from handles structure
dowel = handles.dowel;
current_position = handles.current_piece;
board = handles.board;
chess_images = handles.chess_images;
name=get(hObject,'Tag'); %tag of button just pressed
handle_name = strcat('handles.',name);
move_pieces = handles.move_pieces;
moves = handles.mo... |
function [theP,issig] = ztop(zscore,is1tailed,alpha)
% ZTOP returns the equivalent p-value of an input z-score,
% assuming a normal z-score distribution of mean 0 and std 1.
% INPUTS: zscore - a matrix of any size containing z-scores from
% a normal distribution with mean 0 and std 1.
% is1tai... |
function compName = getComputerName()
% Returns the name of the computer (hostname)
% output string is converted to lower case
% By Noam Omer Dec17
[re, compName] = system('hostname');
if re ~= 0,
if ispc
compName = getenv('COMPUTERNAME');
else
compName = getenv('HOSTNAME');
end;
end;
compName = strtrim(low... |
clear
close all
% decide of the cycle
% for now, east part, let's fix it at: (112+112+156+136)/4 = 516/4 = 129
% we could also decide of weights
cycle = 129;
windowtype = 'pretimed';
% let's fix delta at 0
% this has to be checked as delta = 20 on Huntington Dr & Santa Clara St
delta = 0;
A = load_Huntington_cut_v1... |
clc; clear; close all;
X = [3.5; 4.5]; Xdot = [0; 0]; Xddot = [0; 0];
T = 1000;
k = 1; lambda = 1;
t = 0; dt = 0.1;
ne = inf;
O_obs = [-1; 0]; R_obs = 0.5;
%
while ne > 0.05
A = [0 0 1 0
0 0 0 1
0 0 0 0
0 0 0 0];
... |
function [forceplate] = processForceplateWrenches(forceplate, subjectParamsFromData)
% PROCESSFORCEPLATEWRENCHES processes raw external wrenches estimates coming
% from the forceplate.
%
% Inputs:
% - forceplate : forceplate 1 and 2 wrenches (linear-angular);
% - contactLink : human links in cont... |
function [newTable] = sortTable(inputTable,date,id,status,location)
%% Expl.
% Input
% inputTable: table from DB cont...
% date:
% string: 'Date'
% cell array of strings: {'Date','Milisec'}
% id
% status
% Output
% newTable containing 'date','id','status' sorted by date
%% TODO Remove NaN Cells
%inputTable(cellf... |
function [ave, oave] = RWRM(beta,mute)
tic
load DBLP_4AREA\AC_Nets_v4.mat
S_Net = A_Net;
D_Net = C_Net;
D_Class = C_Label;
A_Net = CA_Net';
indexes = find(D_Class);
AT = A_Net';
AT = AT ./(sum(AT)+1e-5);
D_Net = D_Net./sum(D_Net);
A = A_Net./(sum(A_Net)+1e-5);
% A(isnan(A)) = 0;
% AT(isnan(AT))... |
%Written by Patrick Strassmann
function plotStimPatches(relStimTimesOn, relStimTimesOff)
alpha = 0.2;
for i = 1:numel(relStimTimesOn)
p=patch([relStimTimesOn(i) relStimTimesOff(i) relStimTimesOff(i) relStimTimesOn(i)]*10/1000, [i-.3 i-.3 i+.3 i+.3],rgb('cyan'));
set(p,'FaceAlpha',alpha','edgecolor',r... |
%Run the model of the 3copter
clear all
close all
clc
global throtle_1 throtle_23 eta_23
addpath(genpath('Used Functions'))
T_sim=0.01;
%% Load data
SetupComplete;
% Airport
latitude=52.0733;
longitude=0.6278;
close all
% return
%% Find trim point
Alt_0 =input(' Give the initial altitude (m): ');
... |
%% Equal axis among rats
% fil='Average_Frequency_Allconditions_complete_';
%fil='Average_Frequency_Violin_Allconditions_complete_';
%fil='Peak_Frequency_Violin_Allconditions_complete_';
%fil='Peak_Frequency_Allconditions_complete_';
%fil='RippleDuration_Outliers_Allconditions_complete_';
%fil='RippleDuration_Violin_Al... |
function [ProjectionMatrix] = GeneralizedPerspectiveProjection(pe, pa, pb, pc, n, f)
%[ProjectionMatrix} = GeneralizedPerspectiveProjection(pe, pa, pb, pc, n, f)
%==========================================================================
% This function provides a more genrealized version of the parallel
% proje... |
% --------------------------------------------------------
% ObjectNet3D
% Copyright (c) 2016 CVGL Stanford University
% Licensed under The MIT License [see LICENSE for details]
% Written by Yu Xiang
% --------------------------------------------------------
% load the vertices and faces of an .off file
function [v,f] ... |
%% Load VLFEAT
run('../vlfeat/toolbox/vl_setup.m');
%pointTracks = chaining('../data/TeddyBear', 0.1, 1000, 50, 0);
pointTracks = chaining('../data/House', 0.1, 1000, 0.5, 1); |
function [AC, T, G, P] = Inputs_A320()
% clear all
% close all
% clc
%% load initial data from EMWET
cd Data
load T_A320
cd ..
%% Wing geometry definition
% ******** FOKKER 100 Wing ***************
AC.Wing.Geom = [0 0 0 7.0518 0
3.3006 6.3403 0.5547 3.7584 -2.5
... |
% MakeCircle - Draw filled circle in 2D Matrix
%
% [img] = MakeCircle(img,circX,circY,circR)
%
% img
function [img] = MakeCircle(img,circX,circY,circR,val)
imageSizeX = size(img,1);
imageSizeY = size(img,2);
[columnsInImage rowsInImage] = meshgrid(1:imageSizeX, 1:imageSizeY);... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.