plateform stringclasses 1
value | repo_name stringlengths 13 113 | name stringlengths 3 74 | ext stringclasses 1
value | path stringlengths 12 229 | size int64 23 843k | source_encoding stringclasses 9
values | md5 stringlengths 32 32 | text stringlengths 23 843k |
|---|---|---|---|---|---|---|---|---|
github | LeventhalLab/Development-master | ghostscript.m | .m | Development-master/ChoiceTask/Helpers/Third Party/exportFig/ghostscript.m | 7,902 | utf_8 | ff62a40d651197dbea5d3c39998b3bad | function varargout = ghostscript(cmd)
%GHOSTSCRIPT Calls a local GhostScript executable with the input command
%
% Example:
% [status result] = ghostscript(cmd)
%
% Attempts to locate a ghostscript executable, finally asking the user to
% specify the directory ghostcript was installed into. The resulting path... |
github | LeventhalLab/Development-master | fix_lines.m | .m | Development-master/ChoiceTask/Helpers/Third Party/exportFig/fix_lines.m | 6,441 | utf_8 | ffda929ebad8144b1e72d528fa5d9460 | %FIX_LINES Improves the line style of eps files generated by print
%
% Examples:
% fix_lines fname
% fix_lines fname fname2
% fstrm_out = fixlines(fstrm_in)
%
% This function improves the style of lines in eps files generated by
% MATLAB's print function, making them more similar to those seen on
% scre... |
github | LeventhalLab/Development-master | distinguishable_colors.m | .m | Development-master/ChoiceTask/Helpers/Third Party/plotSpread/distinguishable_colors.m | 5,757 | utf_8 | fca45f69c92db37c685d6625d42565bd | function colors = distinguishable_colors(n_colors,bg,func)
% DISTINGUISHABLE_COLORS: pick colors that are maximally perceptually distinct
%
% When plotting a set of lines, you may want to distinguish them by color.
% By default, Matlab chooses a small set of colors and cycles among them,
% and so if you have more than ... |
github | LeventhalLab/Development-master | RunExperiment.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/RunExperiment.m | 19,132 | utf_8 | 2854d87f3ba013857b79b10ec63fcccf | function result = RunExperiment ( doTrial, ex, params, blockStart )
% The body of the experiment: RunExperiment (@doTrial, ex, params [, @blockStart])
% (c) Sanjay Manohar 2008
%
% What It Does:
% ------------
% 1) Create screen (type 'help prepareScreen' for details)
%
% 2) Initialise eyelink (if ex.useEyelink... |
github | LeventhalLab/Development-master | pairwiseComparisons.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/pairwiseComparisons.m | 3,594 | utf_8 | a7d76cb6257a292ef4de6a27f3aa5cbc | function [varargout] = pairwiseComparisons(X, varargin)
% function [p, t] = pairwiseComparisons(X)
% X ( SUBJECTS, CONDITIONS )
%
% runs a paired t-test between thc conditions represented by columns of X.
%
% Returns CONDITIONS x CONDITIONS matrixes of p-values and t-values.
% Note that only the upper triangle... |
github | LeventhalLab/Development-master | errorBarPlot_old.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/errorBarPlot_old.m | 4,331 | utf_8 | 5d96c0fed7004ea5eab54e92c585bdb5 | function h=errorBarPlot(X, varargin)
% h = errorBarPlot(X, varargin)
% plot with within-subject standard error bars - means are taken over dimension 1.
% options: 'maineffect' dim
% dim should be 2 or 3 to indicate a main effect of
% dimension 2 or 3 of the data.
% s... |
github | LeventhalLab/Development-master | generalRaceModel4.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/generalRaceModel4.m | 13,676 | utf_8 | d0538c226459f18b7114f16678b86c38 |
function [responseType RTs distr seqtrig seqt ] = generalRaceModel4( ...
nTrials, ...
p, ...
data, ...
options )
% [responseType RT] = generalRaceModel(nTrials, parameters, data, options );
% Run Simulation
% Simulates an arbitrary number of rise-to-threshold units.
% They have independent distributio... |
github | LeventhalLab/Development-master | browsePlotFields.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/browsePlotFields.m | 9,298 | utf_8 | b73463e0a0241ba6323d7e9549b90d11 | function selectedFields = browsePlotFields(r, drawfunction, varargin)
% function browsePlotFields(r, drawfunction, ...)
%
% calls drawfunction for each field in r, but allows you to browse forward
% and backward, and search, and save figures.
%
% [pvals, anovatable] = drawfunction ( field_name ):
% is a functi... |
github | LeventhalLab/Development-master | findregions.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/findregions.m | 477 | utf_8 | 6bdcfa95b1922e4a9017f40df4c77618 | % function Y=findregions(X)
% return a list of regions of true values of X
% i.e. findregions( [1 1 1 0 0 0 1 1 1] )
% returns [ 1, 4
% 7, 10 ]
% meaning items 1 until 4 are true, and items 7 until 10 are true.
function Y=findregions(X)
if sum(size(X)>1) > 1
warning('findregions:... |
github | LeventhalLab/Development-master | addBetweenSubjectsDimension.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/addBetweenSubjectsDimension.m | 1,838 | utf_8 | 5f8e6b196f7aa8e25d40aa4058a977c2 |
function X = addBetweenSubjectsDimension(X1,X2, X3)
%%
% X3 = addBetweenSubjectsDimension(X1,X2)
% add a between-subjects dimension at position 2, to compare two groups of
% subjects, X1 and X2.
%
% Xi are arrays that you would normally provide to anovanTable.
% The first dimension must represent which subjec... |
github | LeventhalLab/Development-master | browseFig.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/browseFig.m | 1,878 | utf_8 | 480d64a4ec7a5e9acf249143271402e4 | function [selection]=browseFig(variable, command, valueSet, selection)
% browseFig(variable, command)
% allows you to go back and forward through figures
% with different values of a parameter
% if valueSet is not given, values of variable start at 1 and
% range up and down the integers.
% keys: p,n
idx=1;
i... |
github | LeventhalLab/Development-master | flushEyelinkQueue.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/flushEyelinkQueue.m | 232 | utf_8 | 3d07d9895e90c12f9199703fe06760bc | % function flushEyelinkQueue(el)
% calls eyelink GetQueuedData until the buffer is empty
% sanjay manohar
function flushEyelinkQueue(el)
drained=0;while(~drained)
[samples, events,drained]=eyelink('GetQueuedData');
end
|
github | LeventhalLab/Development-master | WaitForFixation2.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/WaitForFixation2.m | 5,567 | utf_8 | cbcbf1e0054047bbc603b91890d656ec | function result=WaitForFixation2(el, location, accuracy, duration)
% Eyelink wait for fixation.
% result = WaitForFixation(el, location, accuracy, duration)
% Used at the beginning of experiment to wait for eye to fixate
% on a spot.
% location (if not [0]) specifies required target,
% accuracy specifies radiu... |
github | LeventhalLab/Development-master | runSingleTrialAndProcess.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/runSingleTrialAndProcess.m | 3,584 | utf_8 | ce57668918012b92a16dfb92a0786bb8 |
function tr=runSingleTrialAndProcess(scr,el,ex,tr,doTrial,b,t)
% this prepares a trial structure for the experiment,
% calls "doTrial" of your experiment,
% checks if it needs repeating, and checks for things like calibration
% requests or if the eyelink computer 'abort' or 'end' was pressed.
tr.block=b; tr... |
github | LeventhalLab/Development-master | killBadProcesses.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/killBadProcesses.m | 7,190 | utf_8 | 375fc25619701482bf893ef7c371b068 | function killBadProcesses(ADMIN_PW)
% function killBadProcesses(ADMIN_PW)
% Kill a large number of Windows processes that might interfere with the
% smooth running of an experiment. By default, the network services,
% printing, encryption, updates, and firewall are turned off -- so make
% sure the network cable is... |
github | LeventhalLab/Development-master | groupedScatter.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/groupedScatter.m | 2,753 | utf_8 | 97b4a8c62d1eac227ad472a84d199e42 | function ym=groupedScatter(X,Y,N,q,r)
% groupedScatter(X,Y,N)
% take x and y coords, and plot a kind of
% scatter where points are grouped according to quantiles
% and mean Y values plotted.
% N is number of quantile bins, if X is continuous
if(exist('q','var'))
if(exist('r','var'))
ym=groupedScatter2(... |
github | LeventhalLab/Development-master | isSaccade.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/isSaccade.m | 343 | utf_8 | 5f67cc8173355eb43bf748619ce19bb4 |
function sc=isSaccade(p, thresholdv)
dt=(p(2:end,1) - p(1:end-1,1));
vx=(p(2:end,2) - p(1:end-1,2)) ./ dt;
vy=(p(2:end,3) - p(1:end-1,3)) ./ dt;
v2=vx.*vx + vy.*vy; %individual v-squared
vv=((p(end,2)-p(1,2))^2+(p(end,3)-p(1,3))^2) / (p(end,1)-p(1,1))^2; %nett v-squared
sc=vv>2*threshold... |
github | LeventhalLab/Development-master | ssa2.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/ssa2.m | 11,056 | utf_8 | 593740295c3249724fbcf5abe93b4dda | % Contents:
% ssa.m - SSA shell: calls ssaeig, pc, and rc.
% ssaeig.m - Calculates SSA eigenvectors/values (calls ac.m).
% ac.m - Estimates the autocovariance function.
% pc.m - Calculates PCs for SSA.
% rc.m - Calculates RCs for SSA.
% ssaconf.m - Calculates variance estimates for eigenvalues.
% itc.m - Uses informati... |
github | LeventhalLab/Development-master | histograms.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/histograms.m | 1,092 | utf_8 | c7734f033bd7e3c3f1dd27dd39a0a887 | function histograms(data,criteria,bins, normalise)
% histograms ( data, criteria, bins )
% data is an array same size as criteria.
% each each unique value of criteria generates a sepearate histogram.
% colours taken from the current colormap.
% bins - number of histogram bars per dataset
if exist('bins')~=1, bin... |
github | LeventhalLab/Development-master | ndSparse.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/ndSparse.m | 86,937 | windows_1250 | 1a19b0f7fc8a763bf201bc328b14ea60 | classdef ndSparse
%ndSparse - A class of N-dimensional sparse arrays.
%
% by Matt Jacobson
%
% Copyright, Xoran Technologies, Inc. 2010
%
%
% USAGE:
%
% S=ndSparse(X) where X is an ordinary MATLAB sparse matrix converts X into
% an ndSparse object. S can be reshaped into an N-dimensional sparse ar... |
github | LeventhalLab/Development-master | nancat.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/nancat.m | 4,955 | utf_8 | bb50db88c4497d3cb7c11a4682885a0d | function C=nancat(DIM, varargin)
% X = nancat( DIM, x1, x2, x3... )
% Concatenate arrays xi along dimension DIM, with nan padding.
% X = nancat( [SOURCE_DIM, DEST_DIM], cell_array )
% Concantenate elements from SOURCE_DIM in the cell array, along DEST_DIM.
% e.g. nancat([1 2], { [1;2], [3... |
github | LeventhalLab/Development-master | WaitForFixation.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/WaitForFixation.m | 5,075 | utf_8 | 81375f5b59f48c2d5346f0e4adacc164 | function result=WaitForFixation(el, location, accuracy, duration)
% Eyelink wait for fixation. result=WaitForFixation(el, location, accuracy,
% duration)
% Used at the beginning of experiment to wait for eye to fixate
% on a spot. location (if not [0]) specifies required target, accuracy
% specifies radius permitt... |
github | LeventhalLab/Development-master | errorBarPlot.old1.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/errorBarPlot.old1.m | 5,539 | utf_8 | e51dccb81d01beffd974587a61a16a75 | function h=errorBarPlot(X, varargin)
% h = errorBarPlot(X, varargin)
% plot with within-subject standard error bars - means are taken over dimension 1.
% options: 'maineffect' dim
% dim should be 2 or 3 to indicate a main effect of
% dimension 2 or 3 of the data.
% s... |
github | LeventhalLab/Development-master | generalRaceFit2.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/generalRaceFit2.m | 18,392 | utf_8 | d118e309ed0332fe7ea62e6fbe1ef879 | function [parameters logLikelihood solution] = generalRaceFit2( ...
RTs, conditionVector,...
baseRaceParameters, varyParametersFunction, initialParameterVector, ...
varargin)
% function [parameters, logLikelihood, solution] = generalRaceFit(
% RTs, conditionVector,...
% baseRaceParameters, varyParamete... |
github | LeventhalLab/Development-master | isStillFixating.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/isStillFixating.m | 3,308 | utf_8 | 4616b1d40a65769306c884cdf28848f7 | function result=WaitForFixation2(el, location, accuracy)
% Eyelink wait for fixation.
% result = WaitForFixation(el, location, accuracy, duration)
% Used at the beginning of experiment to wait for eye to fixate
% on a spot.
% location (if not [0]) specifies required target,
% accuracy specifies radius permitte... |
github | LeventhalLab/Development-master | plotField.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/plotField.m | 15,515 | utf_8 | d021d773284fc7b025ec24019f7952b5 |
function [y xznames, pval, anovatable, anY, anX, h]= plotField(r, f, doAnova, plotIndividuals, factorLevels, varargin)
% [ y, xznames, pval, anovaTable, anovaY, anovaX, plothandles ] =
% plotField(r, f, doAnova, plotIndividuals, factorLevels, ... )
%
% Plot a field of a structure, using "CamelCase" field names.
% ... |
github | LeventhalLab/Development-master | generalRaceFitExample.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/generalRaceFitExample.m | 1,093 | utf_8 | fb9de9d2aecb1dde31b3d847aabac816 | function generalRaceFitExample()
% example data
test=@(N)1./(3+randn(N,1));
t = [ test(80) inf*ones(80,1) % condition 1 correct
inf*ones(20,1) 2*test(20) % condition 1 error
test(80) inf*ones(80,1) % condition 2 correct
inf*ones(20,1) 2*test(20) % condition 2 erro... |
github | LeventhalLab/Development-master | generalRaceModel3.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/generalRaceModel3.m | 12,338 | utf_8 | 05c9a75541da787b172871111c95af3c |
function [responseType RTs distr seqtrig seqt ] = generalRaceModel3( ...
nTrials, ...
p, ...
data, ...
options )
% [responseType RT] = generalRaceModel(nTrials, parameters, data, options );
% Run Simulation
% Simulates an arbitrary number of rise-to-threshold units.
% They have independent distributio... |
github | LeventhalLab/Development-master | isFixated.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/isFixated.m | 345 | utf_8 | dd0cd9b922bd55b2e8aad1098986b00e |
function sc=isFixated(p, thresholdv)
dt=(p(2:end,1) - p(1:end-1,1));
vx=(p(2:end,2) - p(1:end-1,2)) ./ dt;
vy=(p(2:end,3) - p(1:end-1,3)) ./ dt;
v2=vx.*vx + vy.*vy; %individual v-squared
vv=((p(end,2)-p(1,2))^2+(p(end,3)-p(1,3))^2) / (p(end,1)-p(1,1))^2; %nett v-squared
sc=vv<thresholdv ... |
github | LeventhalLab/Development-master | adaptiveReward.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/adaptiveReward.m | 2,999 | utf_8 | f26ec2d5f549c74c0fbfe5735b3fbf79 | function reward = adaptiveReward( t, parameters )
% reward = adaptiveReward( t )
% calculate an adaptive reward given a reaction time
% reward increases with shorter reaction times
% but adapts to subjects' mean speed over last 20 trials
% reward = adaptiveReward( t , thread )
% use specified thread (defa... |
github | LeventhalLab/Development-master | fitModels.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/fitModels.m | 16,418 | utf_8 | 55a7ff7956c40bfdec3a65e23beb5cee | function [params, ll, aic, bic, out, extraInfo] = fitModels( ...
modelFunctions, modelParamRanges, datasets, varargin )
% [params, aic, ll, out] = fitModels( modelFunctions, modelParamRanges, datasets, ... )
%
% fit a list of models to a list of datasets, given the likelihood functions.
%
% modelFunctions contains... |
github | LeventhalLab/Development-master | ksdensity2d.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/ksdensity2d.m | 1,801 | utf_8 | 34bac864579eee8de985322cd7a9d1a3 |
function f = ksdensity2d(x,gridx1,gridx2,bw, varargin)
% KSDENSITY2D Compute kernel density estimate in 2D.
% F = KSDENSITY2D(X,GRIDX,GRIDX2,BW) computes a nonparametric estimate
% of the probability density function of the sample in the N-by-2
% matrix X. F is the vector of density values evaluated at the points
% i... |
github | LeventhalLab/Development-master | readEDFASC.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/readEDFASC.m | 5,234 | utf_8 | 712b11d8aff124549aa40017dfd03d28 | function result=readEDFASC(fname, readPos, automatic)
% result=readEDFASC(fname, readPos, automatic)
% Read an EDF file or an ASC file.
% 1) If filename ends with '.edf' (case sensitive), run edf2asc - this needs to
% be on the path!
% 2) Open resulting '.asc' file (or the specified '.asc' file) and read the
%... |
github | LeventhalLab/Development-master | fitSigmoid.m | .m | Development-master/ChoiceTask/Helpers/Third Party/smanohar/fitSigmoid.m | 6,598 | utf_8 | e0bef0952daa098e17cd7d474a10808b | function [params, values, hplot, means]=fitSigmoid(Y, varargin)
% [params, values] = fitSigmoid(Y, varargin)
% Fit a sigmoid curve to each column of Y.
% Fitting is done by least squares.
%
% 'X' specifies X values corresponding to each Y. If X is not specified,
% X increases linearly, i.e. X = [ -(N-1)/2 : ... |
github | LeventhalLab/Development-master | uTest_RunLength.m | .m | Development-master/ChoiceTask/Helpers/Third Party/RunLength/uTest_RunLength.m | 15,591 | utf_8 | acab848b9ff82a4150479f0cb4353eb7 | function uTest_RunLength(doSpeed)
% Automatic test: RunLength
% This is a routine for automatic testing. It is not needed for processing and
% can be deleted or moved to a folder, where it does not bother.
%
% uTest_RunLength(doSpeed)
% INPUT:
% doSpeed: Optional logical flag to trigger time consuming speed tests.
% ... |
github | LeventhalLab/Development-master | InstallMex.m | .m | Development-master/ChoiceTask/Helpers/Third Party/RunLength/InstallMex.m | 8,490 | utf_8 | 5a9b26d835970b0ab2e56498de7a7183 | function Ok = InstallMex(SourceFile, varargin)
% Compile a C-Mex file
% This function calls MEX() to compile a C/C++/F-Mex source file.
% Advanced users can call "mex -O SourceFile.c ..." instead, but beginners are
% sometimes overwhelmed by compiling instructions.
%
% Ok = InstallMex(SourceFile, ...)
% INPUT:
% Sour... |
github | LeventhalLab/Development-master | gaussianMix.m | .m | Development-master/ChoiceTask/Helpers/Third Party/unitID/gaussianMix.m | 5,437 | utf_8 | 94a8851958ca5e7ae4b1ce86088d8b87 | function gaussianMix(channel, unit, corrscore, wavescore, autoscore, basescore, survival)
sameChan = cell(size(corrscore));
sameUnit = cell(size(corrscore));
for iid=1:length(corrscore)
sameChan{iid} = bsxfun(@eq,channel{iid}(:),channel{iid+1}(:)');
sameUnit{iid} = sameChan{iid} & bsxfun(@eq,unit{iid}(:),u... |
github | LeventhalLab/Development-master | computeSurvival.m | .m | Development-master/ChoiceTask/Helpers/Third Party/unitID/computeSurvival.m | 2,614 | utf_8 | eb6aae0e3a1656adf8fd842a2c0f37e2 | function [survival, score] = computeSurvival(channel, unit, corrscore, wavescore, autoscore, basescore, survival)
sameChan = cell(size(corrscore));
sameUnit = cell(size(corrscore));
for iid=1:length(corrscore)
sameChan{iid} = bsxfun(@eq,channel{iid}(:),channel{iid+1}(:)');
sameUnit{iid} = sameChan{iid} &... |
github | LeventhalLab/Development-master | plotslm.m | .m | Development-master/ChoiceTask/Helpers/Third Party/SLMtools/plotslm.m | 16,039 | utf_8 | a0e643558b868f722252d6214b17b8a6 | function hfig = plotslm(slm)
% plotslm: plots a Shape Language Model (slm) or its derivatives
% usage: plotslm(slm)
% usage: hfig = plotslm(slm)
%
%
% arguments: (input)
% slm - slm struct, as returned by slmengine or slmfit,
% or evaluated by slmeval
%
%
% arguments: (output)
% hfig - figure handle. Only retu... |
github | LeventhalLab/Development-master | slmset.m | .m | Development-master/ChoiceTask/Helpers/Third Party/SLMtools/slmset.m | 54,680 | utf_8 | 88f47a5a33757671fcb558b6ceed2eb1 | function prescription=slmset(varargin)
% slmset: defines the shape prescription for a model
% usage 1: prescription=slmset(prop1,val1,pro2,val2,...)
% usage 2: prescription=slmset(prescription,prop1,val1,pro2,val2,...)
%
% A set of property/value pairs are parsed into a structure
% to use as the prescription for slme... |
github | LeventhalLab/Development-master | slmfit.m | .m | Development-master/ChoiceTask/Helpers/Third Party/SLMtools/slmfit.m | 13,603 | utf_8 | 8f132b22e3d2e92a3bfa456522d8c73d | function slm = slmfit(x,y,varargin)
% slmfit: GUI tool to estimate a spline function (Shape Langauge Model) from data
% usage 1: slm = slmfit(x,y);
% usage 3: slm = slmengine(x,y,prop1,val1,prop2,val2,...);
%
% Note: slmfit is a GUI tool for fitting a shape language model
% to data. The user supplies information abou... |
github | LeventhalLab/Development-master | slmengine.m | .m | Development-master/ChoiceTask/Helpers/Third Party/SLMtools/slmengine.m | 89,736 | utf_8 | b20f3075d1cb3880c4602af9cc12845f | function [slm,xp,yp] = slmengine(x,y,varargin)
% slmengine: estimates a spline function from data plus a fit prescription
% usage 1: slm = slmengine(x,y);
% usage 2: slm = slmengine(x,y,prescription);
% usage 3: slm = slmengine(x,y,prop1,val1,prop2,val2,...);
% usage 4: slm = slmengine(x,y,prescription,prop1,val1,prop2... |
github | LeventhalLab/Development-master | slmeval.m | .m | Development-master/ChoiceTask/Helpers/Third Party/SLMtools/slmeval.m | 18,719 | utf_8 | 6d897ef7d959e827cc56bbb891ee3482 | function y = slmeval(x,slm,evalmode)
% slmeval: evaluates a Hermite function, its derivatives, or its inverse
% usage 1: y = slmeval(x,slm) % evaluates y = f(x)
% usage 2: y = slmeval(x,slm,evalmode) % general form
%
% As opposed to extrapolation as I am, slmeval will not extrapolate
% unless you explicitly ... |
github | LeventhalLab/Development-master | slmsolve.m | .m | Development-master/ChoiceTask/Helpers/Third Party/SLMtools/slmsolve.m | 4,969 | utf_8 | 98909b85801992b14ccefdb6145518d3 | function xloc = slmsolve(model,yvalue,derivorder)
% slmsolve: all locations (roots) where an SLM or PP spline (or a derivative thereof) takes on a specified value
% usage: xloc = slmsolve(model)
% usage: xloc = slmsolve(model,yvalue)
% usage: xloc = slmsolve(model,yvalue,derivorder)
%
% Search for all real "roots" or s... |
github | LeventhalLab/Development-master | tutorial_filters.m | .m | Development-master/ChoiceTask/Helpers/Third Party/plot2svg/tutorial_filters.m | 5,669 | utf_8 | 2851aa1347386c724ec5b56aa321f9a6 | function tutorial_filters
file = 'matterhorn_small.jpg';
fig = figure;
set(fig, 'DefaultAxesFontName', 'Arial')
set(fig, 'DefaultAxesFontSize', 6)
plotCounter = 1;
xPlots = 3;
yPlots = 4;
% a) Original plot with a line, patch, and text object
subplot(yPlots, xPlots, plotCounter)
plotCounter = plotCounter + 1;... |
github | LeventhalLab/Development-master | createTrialsStruct_simpleChoice.m | .m | Development-master/ChoiceTask/Helpers/Behavioral/createTrialsStruct_simpleChoice.m | 33,705 | utf_8 | 08e25fac81da3d19896adb03c84e1533 | function trials = createTrialsStruct_simpleChoice( logData, nexData )
%
% usage:
%
% INPUTS:
% logData - behavioral log data as read in by the readLogData function.
% See readLogData comments for structure details
% nexData - nex data structure created by box2nex_useHeader
%
% OUTPUTS:
% trials - trials str... |
github | LeventhalLab/Development-master | ExtractTimeEventsfromNexMatlab.m | .m | Development-master/Skilled Reaching Ephys/ExtractTimeEventsfromNexMatlab.m | 1,842 | utf_8 | bec57440ea2b70ebebf9143c07e41cab | %Titus John
%7/21/2015
%Leventhal Lab, University of Michigan
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% TTL/Event Breakdown
% EventlineNum TTL
% 33 TTL1on actuator pos 1(all the way down)
% 34 TTL1off actuator pos 1(all the way down)
%... |
github | LeventhalLab/Development-master | makeSheet.m | .m | Development-master/Skilled Reaching Ephys/makeSheet.m | 3,903 | utf_8 | 4f04c90cd7fb0bbf3b7ddfd4fbaf51ab | %%Create sheet of information for one neuron
function [] = makeSheet(varargin)
%Inputs:
% -sessionConf
% -whichNeuron = name of tetrode/wire and which sorted neuron to look at
% -i.e. "T01_01" for 1st sorted neuron on tetrode1 or "100_1" for wire100
%Assumes that combined nex file stored in
% '.... |
github | LeventhalLab/Development-master | sinc_interp.m | .m | Development-master/Skilled Reaching Ephys/sinc_interp.m | 1,420 | utf_8 | f14f6dc5f393949039618b31d04cdb23 | % Ideally "resamples" x vector from s to u by sinc interpolation
function y = sinc_interp(x,s,u)
% Interpolates x sampled at "s" uniformly spaced instants
% Output y is sampled at "u" uniformly spaced instants
% ("s" for "sampled" and "u" for "upsampled")
% (consequently, length(x)=length(s))
% Fin... |
github | kkamb/crisisnetwork-master | fAt.m | .m | crisisnetwork-master/fAt.m | 446 | utf_8 | 47e88ae590d4fa5391ff65676ec2a921 | %% "fAt" sets matrix lower-triangular matrix with free
%% elements inserted from 1*na vector "a"
%% based on Ox Code by Nakajima
%%
%% [input]
%% va: 1*na vector
%% nk: # of variables
%%
%% [output]
%% mAt: nk*nk lower-triangular matrix with diagonal
%% elements equal to one
%... |
github | kkamb/crisisnetwork-master | fXh.m | .m | crisisnetwork-master/fXh.m | 310 | utf_8 | 85e058fc4516d42581b1ac7c45d99b85 | %% "fXh" sets matrix "X_hat" from 1*nk vector "y_hat"
%%
%% [input]
%% vyh: 1*nk vector
%% nk, na: scalar
%%
%% [output]
%% mXh: nk*na matrix
%%
function mXh = fXh(vyh, nk, na)
mXh = zeros(nk, na);
for i = 2 : nk
mXh(i, (i-1)*(i-2)/2+1 : i*(i-1)/2) = -vyh(1:i-1);
end |
github | kkamb/crisisnetwork-master | finvm.m | .m | crisisnetwork-master/finvm.m | 354 | utf_8 | 5b2630f047016ffc6474c6302d24fbf2 | %% mAi = finvm(mA)
%%
%% "finvm" outputs inv(A)
%% when singular, Moore-Penrose pseudoinverse of matrix
%%
%% [input]
%% mA: nk*nk matrix
%%
%% [output]
%% mAi: nk*nk matrix
%%
function mAi = finvm(mA)
drA = rcond(mA);
if isnan(drA) || (drA < eps*10^2)
mAi = inv(diag(diag(mA)... |
github | kkamb/crisisnetwork-master | flt_SPM.m | .m | crisisnetwork-master/flt_SPM.m | 2,453 | utf_8 | 2128e210eb4ed06a52bc1ccbc41ff966 | %% fSampSPM samples (Sig, Phi, mu)
%% conditional on time-varying parameter and truncated variables vd and dk0
%%
%% B_{t+1} = mu + Phi*(B_t - mu) + eta_t,
%% eta_t ~ N(0, Sig), eta_0 ~ N(0, Sig/(I-Phi^2))
%%
function [mSign, mPhin, vmun] = flt_SPM(mp, mSig, mPhi, vmu, dnu, dV0, da0, db0, dm0, ds0, vd, d... |
github | kkamb/crisisnetwork-master | fXt.m | .m | crisisnetwork-master/fXt.m | 368 | utf_8 | 175b4f70066dba0295109db499750044 | %% "fXt" sets matrix "X_t" from y(t-1)...y(t-p)
%%
%% [input]
%% myi: data (nl*nk matrix -- {# of lags}*{# of series})
%% fli: intercept flag
%%
%% [output]
%% mXt: nk*nb matrix
%%
function mXt = fXt(myi, fli)
myif = flipud(myi)';
if fli == 1
vyi = [1 myif(:)'];
else
vyi = myif(... |
github | kkamb/crisisnetwork-master | fK0.m | .m | crisisnetwork-master/fK0.m | 91 | utf_8 | c06a46e16c6296bf36a4653448ec6f05 |
function mK0 = fK0(dmu, dsig2, dphi, dk0)
mK0 = abs(dmu) + dk0*sqrt(dsig2/(1-dphi^2)); |
github | kkamb/crisisnetwork-master | fSampSPG.m | .m | crisisnetwork-master/fSampSPG.m | 1,338 | utf_8 | 7420e67f556c4c6ec1e0706b113f4cf1 | %% fSampSPG samples (Sig, Phi, gamma)
%% conditional on time-varying parameter
%%
%% [NOTE]
%% y_t = sqrt(gam)*exp(h_t/2)eps_t, eps_t ~ N(0,1)
%% h_{t+1} = Phi*h_t + eta_t,
%% eta_t ~ N(0, Sig), eta_0 ~ N(0, Sig/(I-Phi^2))
%%
function [mSign, mPhin, vgamn] = fSampSPG(my, mh, mPhi, vgam, dnu, dV0, ... |
github | kkamb/crisisnetwork-master | fSampLT.m | .m | crisisnetwork-master/fSampLT.m | 912 | utf_8 | 7cb0cf49f840331483418eb929fb8dfd | %% fSampLT samples latent threshold conditional on time-varying parameter
%% based on Ox Code by Nakajima
%% y_t = X_t*b_t + e_t, e_t ~ N(0, G2)
function [vdo, ca] = fSampLT(my, amX, mp, amG2inv, vd, vdc)
%vd - vda (na*1 alpha threshold) or vdb (nb*1 beta threshold)
%vdc - vdac alpha prior for U or vdbc ... |
github | kkamb/crisisnetwork-master | ftsvar.m | .m | crisisnetwork-master/ftsvar.m | 418 | utf_8 | 46fbefdd3820854fd0ac29b032894ab3 |
function dvar = ftsvar(vx, iBm)
ns = length(vx);
vi = (1 : iBm)' / iBm;
vK1 = 1 - 6 * vi.^2 .* (1 - vi);
vK2 = 2 * (1 - vi).^3;
vxm = vx - mean(vx);
dvar = 0;
for i = 1 : iBm
davar = vxm(1:end-i)' * vxm(i+1:end) / ns;
if vi(i) < 0.5
dvar = dvar + vK1(i) * davar;
else
dvar... |
github | kkamb/crisisnetwork-master | lt_setvar.m | .m | crisisnetwork-master/lt_setvar.m | 1,344 | utf_8 | bc8ff0ed406f7f7ffc99b6496f0f69fa | %% "setvar" sets variables or options as global variable
%%
%% [input]
%% (stype, ...)
%%
%% ('data', my, nlag) -> set data and lags
%%
%% ('intercept', fli) -> set time-varying intercept
%% 0: off, demean (default)
%% 1: on
%%
%% ('LTb', flLT) -> set threshold for b
%% 0: off
%% ... |
github | kkamb/crisisnetwork-master | lt_ssmooth.m | .m | crisisnetwork-master/lt_ssmooth.m | 2,593 | utf_8 | 53adde424e03ad2f13b332d31ade9a9b | %% "ssmooth" implements simulation smoother
%% by de Jong & Shephard (1995)
%%
%% [model]
%% y_t = Z_t*a_t + G_t*u_t
%% a_{t+1} = Wb+T_t*a_t + H_t*u_t
%% a_1 ~ N(va0, H02)
%% u_t ~ N(0, I)
%% G_t*H_t' = O
%%
%% y_t: nk*1 vector
%% Z_t: nk*np matrix
%% a_t: ... |
github | kkamb/crisisnetwork-master | fSampLTBv.m | .m | crisisnetwork-master/fSampLTBv.m | 3,527 | utf_8 | 81065953807a2b723d3d6b1aa8725402 | %% fSampLTBv samples beta with latent threshold in multivariate model
%% by singe-move sampler
%% based on Nakajima's Ox Code
%%
%% [model]
%% y_t = X_t*b_t + e_t e_t ~ N(0, G2)
%% b_t = B_t*s_t s_t ~ I(B_t>=d)
%% B_{t+1} = mu + Phi*(B_t - mu) + eta_t,
%% eta_t ~ N(0, S... |
github | kkamb/crisisnetwork-master | lt_svsamp.m | .m | crisisnetwork-master/lt_svsamp.m | 5,381 | utf_8 | 5d66518898a41fad324f52ad87c24262 | %% "svsamp" implements multi-move sampler for SV model
%% by Shephard & Pitt (1997) and Omori & Watanabe (2004)
%%
%% [model]
%% y_t = exp(h_t/2)*eps_t, eps_t ~ N(0, 1)
%% h_{t+1} = phi*h_t + ets_t, eta_t ~ N(0, sig^2)
%% h_0 = h00, eta_0 ~ N(0, sig0^2)
%%
%% [input]
%% vy: response (n... |
github | kkamb/crisisnetwork-master | fGeweke.m | .m | crisisnetwork-master/fGeweke.m | 608 | utf_8 | a8f47f0579a75b033fb1ab802c8d37db | %% dv = fGeweke(vx, iBm)
%%
%% "fGeweke" computes Geweke statistics
%% for convergence check of MCMC iteration
%% based on Ox Code by Nakajima
%% [input]
%% vx: data series (ns*1 vector)
%% iBm: bandwidth (scalar)
%%
%% [output]
%% dpv: P-value for convergence
%%
function dpv = fGeweke(... |
github | zmichels/CVA-master | gridCVApar.m | .m | CVA-master/gridCVApar.m | 5,457 | utf_8 | cd5f397e3591329f3526f133bb3b8f92 | % This function will perform principal geodesic analysis (PGA) of [3 x 3]
% kernels for a single phase. This analysis is similar to the grain-scale
% crystallographic vorticity axis (CVA) analysis, except that instead of
% using sets of orientations in whole grains, it uses a [3 x 3] window, and
% it is only applied to... |
github | zmichels/CVA-master | grainsCVApar.m | .m | CVA-master/grainsCVApar.m | 2,930 | utf_8 | 191a7c461c75cc057abbe62f385575ac | % This function will calculate CVA for grains. CVA is based ona principal
% geodesic analysis (PGA) which identifies the best-fit rotation to
% describe the dispersion of orientations in a set of orientations.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% References:
% Zachary D. Miche... |
github | zmichels/CVA-master | removeGrainBoundaryPixels.m | .m | CVA-master/removeGrainBoundaryPixels.m | 492 | utf_8 | f8db63747ad0419d1c1ecb3f5a851ae0 | %% remove pixels at grain boundaries for intragranular analyses
function [eIntra] = removeBoundaryPixels(ebsd,grains)
%%
% check if grainID exists
if isempty(ebsd.grainId)
error('There is no ebsd.grainId. Run calcGrains first.')
end
% get ebsd IDs at grain on either side of grain boundaries
eId = grains.b... |
github | zmichels/CVA-master | gridCVA.m | .m | CVA-master/gridCVA.m | 5,265 | utf_8 | 7333bd041d95a10764fc9904805bf6dc | % This function will perform principal geodesic analysis (PGA) of [3 x 3]
% kernels for a single phase. This analysis is similar to the grain-scale
% crystallographic vorticity axis (CVA) analysis, except that instead of
% using sets of orientations in whole grains, it uses a [3 x 3] window, and
% it is only applied to... |
github | zmichels/CVA-master | grainsCVA.m | .m | CVA-master/grainsCVA.m | 3,017 | utf_8 | 2b303f1ca9e7f4693e7ae455c3f4ca86 | % This function will calculate CVA for grains. CVA is based ona principal
% geodesic analysis (PGA) which identifies the best-fit rotation to
% describe the dispersion of orientations in a set of orientations.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% References:
% Zachary D. Miche... |
github | emileb/OpenGames-master | echo_diagnostic.m | .m | OpenGames-master/opengames/src/main/jni/ioq3/code/libspeex/echo_diagnostic.m | 2,076 | utf_8 | 8d5e7563976fbd9bd2eda26711f7d8dc | % Attempts to diagnose AEC problems from recorded samples
%
% out = echo_diagnostic(rec_file, play_file, out_file, tail_length)
%
% Computes the full matrix inversion to cancel echo from the
% recording 'rec_file' using the far end signal 'play_file' using
% a filter length of 'tail_length'. The output is saved to 'o... |
github | semihyagcioglu/image-geolocalization-master | pdftops.m | .m | image-geolocalization-master/lib/export_fig/pdftops.m | 3,188 | utf_8 | eb7ee38e8e5d4b47aab7a7aa9d2208c4 | function varargout = pdftops(cmd)
%PDFTOPS Calls a local pdftops executable with the input command
%
% Example:
% [status result] = pdftops(cmd)
%
% Attempts to locate a pdftops executable, finally asking the user to
% specify the directory pdftops was installed into. The resulting path is
% stored for futur... |
github | semihyagcioglu/image-geolocalization-master | isolate_axes.m | .m | image-geolocalization-master/lib/export_fig/isolate_axes.m | 3,794 | utf_8 | b104d66dd4d36f35d275c4ef3d2f41cd | %ISOLATE_AXES Isolate the specified axes in a figure on their own
%
% Examples:
% fh = isolate_axes(ah)
% fh = isolate_axes(ah, vis)
%
% This function will create a new figure containing the axes/uipanels
% specified, and also their associated legends and colorbars. The objects
% specified must all be in th... |
github | semihyagcioglu/image-geolocalization-master | pdf2eps.m | .m | image-geolocalization-master/lib/export_fig/pdf2eps.m | 1,525 | utf_8 | 9b46432b206f5e1d2f60051a8fb16247 | %PDF2EPS Convert a pdf file to eps format using pdftops
%
% Examples:
% pdf2eps source dest
%
% This function converts a pdf file to eps format.
%
% This function requires that you have pdftops, from the Xpdf suite of
% functions, installed on your system. This can be downloaded from:
% http://www.foolabs.c... |
github | semihyagcioglu/image-geolocalization-master | print2array.m | .m | image-geolocalization-master/lib/export_fig/print2array.m | 6,474 | utf_8 | 4ead930267fe61c9b2a87139ee559dc8 | %PRINT2ARRAY Exports a figure to an image array
%
% Examples:
% A = print2array
% A = print2array(figure_handle)
% A = print2array(figure_handle, resolution)
% A = print2array(figure_handle, resolution, renderer)
% [A bcol] = print2array(...)
%
% This function outputs a bitmap image of the given fig... |
github | semihyagcioglu/image-geolocalization-master | eps2pdf.m | .m | image-geolocalization-master/lib/export_fig/eps2pdf.m | 5,149 | utf_8 | a76c49a222381133a3c337333bf6a983 | %EPS2PDF Convert an eps file to pdf format using ghostscript
%
% Examples:
% eps2pdf source dest
% eps2pdf(source, dest, crop)
% eps2pdf(source, dest, crop, append)
% eps2pdf(source, dest, crop, append, gray)
% eps2pdf(source, dest, crop, append, gray, quality)
%
% This function converts an eps file... |
github | semihyagcioglu/image-geolocalization-master | copyfig.m | .m | image-geolocalization-master/lib/export_fig/copyfig.m | 846 | utf_8 | 8f479727f76b878a077b76ca7afed48e | %COPYFIG Create a copy of a figure, without changing the figure
%
% Examples:
% fh_new = copyfig(fh_old)
%
% This function will create a copy of a figure, but not change the figure,
% as copyobj sometimes does, e.g. by changing legends.
%
% IN:
% fh_old - The handle of the figure to be copied. Default: gc... |
github | semihyagcioglu/image-geolocalization-master | user_string.m | .m | image-geolocalization-master/lib/export_fig/user_string.m | 2,462 | utf_8 | dd1a7fa5b4f2be6320fc2538737a2f3e | %USER_STRING Get/set a user specific string
%
% Examples:
% string = user_string(string_name)
% saved = user_string(string_name, new_string)
%
% Function to get and set a string in a system or user specific file. This
% enables, for example, system specific paths to binaries to be saved.
%
% IN:
% string_name - ... |
github | semihyagcioglu/image-geolocalization-master | export_fig.m | .m | image-geolocalization-master/lib/export_fig/export_fig.m | 30,730 | utf_8 | 376baa9aac77137ddab15546dd1d11b6 | %EXPORT_FIG Exports figures suitable for publication
%
% Examples:
% im = export_fig
% [im alpha] = export_fig
% export_fig filename
% export_fig filename -format1 -format2
% export_fig ... -nocrop
% export_fig ... -transparent
% export_fig ... -native
% export_fig ... -m<val>
% export_fig... |
github | semihyagcioglu/image-geolocalization-master | ghostscript.m | .m | image-geolocalization-master/lib/export_fig/ghostscript.m | 5,169 | utf_8 | 6c4ddcf9e83cbc0d50d5ecd1921a1350 | %GHOSTSCRIPT Calls a local GhostScript executable with the input command
%
% Example:
% [status result] = ghostscript(cmd)
%
% Attempts to locate a ghostscript executable, finally asking the user to
% specify the directory ghostcript was installed into. The resulting path
% is stored for future reference.
% ... |
github | semihyagcioglu/image-geolocalization-master | slmetric_pw.m | .m | image-geolocalization-master/lib/pwmetric/slmetric_pw.m | 11,906 | utf_8 | e3864f6e2643ac4e2c007a18ef7febc6 | function M = slmetric_pw(X1, X2, mtype, varargin)
%SLMETRIC_PW Compute the metric between column vectors pairwisely
%
% [ Syntax ]
% - M = slmetric_pw(X1, X2, mtype);
% - M = slmetric_pw(X1, X2, mtype, ...);
%
% [ Arguments ]
% - X1, X2: the sample matrices
% - mtype: the string indicating... |
github | semihyagcioglu/image-geolocalization-master | showGist.m | .m | image-geolocalization-master/lib/gist/showGist.m | 1,954 | utf_8 | 926839f0ab3e7182c10a1b52d06e5e31 | function showGist(gist, param)
%
% Visualization of the gist descriptor
% showGist(gist, param)
%
% The plot is color coded, with one color per scale
%
% Example:
% img = zeros(256,256);
% img(64:128,64:128) = 255;
% gist = LMgist(img, '', param);
% showGist(gist, param)
[Nimages, Ndim] = size(gist);
nx = c... |
github | semihyagcioglu/image-geolocalization-master | gistGabor.m | .m | image-geolocalization-master/lib/gist/gistGabor.m | 1,557 | utf_8 | 22690e494fd363b7fa16c5b07932dc46 | function g = gistGabor(img, param)
%
% Input:
% img = input image (it can be a block: [nrows, ncols, c, Nimages])
% w = number of windows (w*w)
% G = precomputed transfer functions
%
% Output:
% g: are the global features = [Nfeatures Nimages],
% Nfeatures = w*w*Nfilters*c
img = single(img... |
github | hendri54/Borrowing-constraints-CPS-master | var_load_cpsbc_test.m | .m | Borrowing-constraints-CPS-master/progs/var_load_cpsbc_test.m | 390 | utf_8 | c05a1caa323bc33173ae980ea41f5f16 | function tests = var_load_cpsbc_test
tests = functiontests(localfunctions);
end
function oneTest(tS)
setName = 'test';
year1 = 1970;
cS = const_cpsbc(setName);
varName = 'test';
outV = 1 : 10;
var_save_cpsbc(outV, varName, year1, setName);
[out2V, success] = var_load_cpsbc(varName, year1, setNam... |
github | hendri54/Borrowing-constraints-CPS-master | const_cpsbc.m | .m | Borrowing-constraints-CPS-master/progs/const_cpsbc.m | 4,767 | utf_8 | f1eb054af90634482e7996d801d33306 | % Returns values of constants
classdef const_cpsbc < handle
properties
setName char
dbg uint16 = 111
end
properties (Constant)
% Variable codes
missVal = -9191;
male = 1;
female = 2;
both = 3;
sexStrV = {'men', 'women', 'both'};
iHSD = 1;
iHSG = 2;
iCD = ... |
github | hendri54/Borrowing-constraints-CPS-master | educ99_test.m | .m | Borrowing-constraints-CPS-master/progs/+vars_cpsbc/educ99_test.m | 446 | utf_8 | d8ae411bf51b808022a2c8a0df01d553 | function tests = educ99_test
tests = functiontests(localfunctions);
end
function oneTest(testCase)
eS = vars_cps.educ99;
vS = eS.var_info;
testCase.verifyTrue(vS.is_valid([0, 1, 9, 13, 18]));
inV = [6, 10];
tgV = [9, 12];
outV = eS.recode_to_yrschool(inV);
testCase.verifyEqual(outV, tgV);
... |
github | hendri54/Borrowing-constraints-CPS-master | higrade_test.m | .m | Borrowing-constraints-CPS-master/progs/+vars_cpsbc/higrade_test.m | 546 | utf_8 | 70121b1766c792017db831913f133082 | function tests = higrade_test
tests = functiontests(localfunctions);
end
function oneTest(testCase)
hS = vars_cpsbc.higrade;
vS = hS.var_info;
testCase.verifyTrue(vS.is_valid([10, 90]));
testCase.verifyFalse(vS.is_valid([20, 290]));
inV = [41, 150, 161, 200];
outV = hS.recode_to_degrees(inV);
... |
github | hendri54/Borrowing-constraints-CPS-master | DataMatrixTest.m | .m | Borrowing-constraints-CPS-master/progs/+import_cpsbc/DataMatrixTest.m | 182 | utf_8 | fc159fd600def42775d3ad298e4558d8 | function tests = DataMatrixTest
tests = functiontests(localfunctions);
end
function oneTest(tS)
setName = 'test';
dmS = import_cpsbc.DataMatrix(setName);
dmS.run_all;
end |
github | hendri54/Borrowing-constraints-CPS-master | wage_create_test.m | .m | Borrowing-constraints-CPS-master/progs/+import_cpsbc/wage_create_test.m | 425 | utf_8 | 75684e11fd066abeaf53a08a3110e71b | function tests = wage_create_test
tests = functiontests(localfunctions);
end
function oneTest(tS)
setName = 'test';
cS = const_cpsbc(setName);
m = table;
n = 17;
m.earnings = linspace(10, 20, n)';
m.incbus = linspace(10, 5, n)';
m.weeksWorked = linspace(20, 30, n)';
m.year = round(linspac... |
github | hendri54/Borrowing-constraints-CPS-master | preamble_cpsbc.m | .m | Borrowing-constraints-CPS-master/progs 2015/preamble_cpsbc.m | 1,602 | utf_8 | a21546e089457a99b33f122bc464faef | function preamble_cpsbc(setNo)
cS = const_cpsbc(setNo);
dataFn = var_fn_cpsbc(cS.vPreambleData, [], setNo);
preamble_lh.initialize(dataFn, fullfile(cS.outDir, 'preamble.tex'));
add_field('cpsAgeMin', sprintf('%i', cS.fltAgeMin), 'Earliest data age', cS);
add_field('cpsAgeMax', sprintf('%i', cS.fltAgeMax), 'Latest ... |
github | nno/matlab_GIfTI-master | save.m | .m | matlab_GIfTI-master/@gifti/save.m | 9,801 | utf_8 | d7999ec374bfbb32da9b38b849ef15ab | function save(this,filename,encoding)
% Save GIfTI object in a GIfTI format file
% FORMAT save(this,filename,encoding)
% this - GIfTI object
% filename - name of GIfTI file to be created [Default: 'untitled.gii']
% encoding - optional argument to specify encoding format, among
% ASCII, Base64Bi... |
github | nno/matlab_GIfTI-master | gifti.m | .m | matlab_GIfTI-master/@gifti/gifti.m | 3,918 | utf_8 | 59128f02da0486e8123d2abf2d645bf1 | function this = gifti(varargin)
% GIfTI Geometry file format class
% Geometry format under the Neuroimaging Informatics Technology Initiative
% (NIfTI):
% http://www.nitrc.org/projects/gifti/
% http://nifti.nimh.nih.gov/
%_______________________________________________________... |
github | nno/matlab_GIfTI-master | saveas.m | .m | matlab_GIfTI-master/@gifti/saveas.m | 13,365 | utf_8 | ad43d9c6742740632b05184412ca2a1c | function saveas(this,filename,format)
% Save GIfTI object in external file format
% FORMAT saveas(this,filename,format)
% this - GIfTI object
% filename - name of file to be created [Default: 'untitled.vtk']
% format - optional argument to specify encoding format, among
% VTK (.vtk,.vtp), Collada (... |
github | nno/matlab_GIfTI-master | xml_parser.m | .m | matlab_GIfTI-master/@gifti/private/xml_parser.m | 16,915 | utf_8 | de0a4766201059ea1860acc2a4a1a019 | function tree = xml_parser(xmlstr)
% XML (eXtensible Markup Language) Processor
% FORMAT tree = xml_parser(xmlstr)
%
% xmlstr - XML string to parse
% tree - tree structure corresponding to the XML file
%__________________________________________________________________________
%
% xml_parser.m is an XML 1.0... |
github | nno/matlab_GIfTI-master | read_gifti_file_standalone.m | .m | matlab_GIfTI-master/@gifti/private/read_gifti_file_standalone.m | 8,244 | utf_8 | 018a4c448f6eeab3ab67b1b95d3086ea | function this = read_gifti_file_standalone(filename, this)
% Low level reader of GIfTI 1.0 files
% FORMAT this = read_gifti_file(filename, this)
% filename - XML GIfTI filename
% this - structure with fields 'metaData', 'label' and 'data'.
%________________________________________________________________... |
github | nno/matlab_GIfTI-master | mvtk_write.m | .m | matlab_GIfTI-master/@gifti/private/mvtk_write.m | 18,318 | utf_8 | 9cfca8fcc271d3b52ec5948f152f3858 | function mvtk_write(M,filename,format)
% Write geometric data on disk using VTK file format (legacy/XML,ascii/binary)
% FORMAT mvtk_write(M,filename,format)
%
% M - data structure
% filename - output filename [Default: 'untitled']
% format - VTK file format: legacy, legacy-ascii, legacy-binary, xml,
% ... |
github | nno/matlab_GIfTI-master | isintent.m | .m | matlab_GIfTI-master/@gifti/private/isintent.m | 2,803 | utf_8 | 059679d968315674d5e6cccbbd6f128c | function [a, b] = isintent(this,intent)
% Correspondance between fieldnames and NIfTI intent codes
% FORMAT ind = isintent(this,intent)
% this - GIfTI object
% intent - fieldnames
% a - indices of found intent(s)
% b - indices of dataarrays of found intent(s)
%________________________________... |
github | ryankennedyio/deep-dream-generator-master | classification_demo.m | .m | deep-dream-generator-master/caffe-master/matlab/demo/classification_demo.m | 5,412 | utf_8 | 8f46deabe6cde287c4759f3bc8b7f819 | function [scores, maxlabel] = classification_demo(im, use_gpu)
% [scores, maxlabel] = classification_demo(im, use_gpu)
%
% Image classification demo using BVLC CaffeNet.
%
% IMPORTANT: before you run this demo, you should download BVLC CaffeNet
% from Model Zoo (http://caffe.berkeleyvision.org/model_zoo.html)
%
% *****... |
github | varung/larscpp-master | larspp.m | .m | larscpp-master/src/larspp.m | 6,054 | utf_8 | fa0de7a932848cd8f836fe9ea5fd8b5b | % There are three main ways to use this function:
%
% (1) ** beta = larspp(X, y) **
%
% Finds the BETA that minimize norm(X*BETA-y,2) + lambda*norm(BETA,1)
% for various lambda, and for the given vector y. The matrix X is N
% by p and the vector y is N by 1. This function returns a matrix
% BETA, where each column o... |
github | alejandro-isaza/caffe-master | classification_demo.m | .m | caffe-master/matlab/demo/classification_demo.m | 5,412 | utf_8 | 8f46deabe6cde287c4759f3bc8b7f819 | function [scores, maxlabel] = classification_demo(im, use_gpu)
% [scores, maxlabel] = classification_demo(im, use_gpu)
%
% Image classification demo using BVLC CaffeNet.
%
% IMPORTANT: before you run this demo, you should download BVLC CaffeNet
% from Model Zoo (http://caffe.berkeleyvision.org/model_zoo.html)
%
% *****... |
github | svn2github/pjsip-master | echo_diagnostic.m | .m | pjsip-master/third_party/speex/libspeex/echo_diagnostic.m | 2,076 | utf_8 | 8d5e7563976fbd9bd2eda26711f7d8dc | % Attempts to diagnose AEC problems from recorded samples
%
% out = echo_diagnostic(rec_file, play_file, out_file, tail_length)
%
% Computes the full matrix inversion to cancel echo from the
% recording 'rec_file' using the far end signal 'play_file' using
% a filter length of 'tail_length'. The output is saved to 'o... |
github | thisisneal/G-FOLD-master | GFOLD_fix_time.m | .m | G-FOLD-master/GFOLD_fix_time.m | 2,188 | utf_8 | 7bb00bf658e32de8a54fac93d2856d0d | % Neal Bhasin
% 2015-04-21
% G-FOLD inner fuel-optimization routine.
% See GFOLD.m for description of arguments.
function [m_used, r, v, u, m] = GFOLD_fix_time(tf, N, r0, v0, rf, vf, m_wet, theta, p)
dt = tf / (N - 1);
g0 = 9.80665; % Standard earth gravity [m/s^2]
alpha = 1 / (p.Isp * g0 * cosd(p.phi));
r1 = p.min_t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.