sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
18308d9d705f86fe25fab0c9b3a76ba3612dd6b5ddf40cf3d74085470881c77d
MATLAB
2,283
80
function [] = transformQuiver2(imgPair) %% Figure out axis convention % x = [10:10:50]; % y = [10:10:30]; % [x,y] = meshgrid(x,y); % figure; % quiver(x,y,2*ones(size(x)),ones(size(x)),0) % set(gca,'YDir','reverse'); %% real stuff %decimate transform field spacing = 20; mytform = imgPair.moving.F(256:512, 256:512,:);...
aca321172651ba5fd130a2a45d25de234796e92703d30a4cbaa24e6b7772aa94
MATLAB
2,283
68
function [dat] = read_brainstorm_data(filename, hdr, begsample, endsample, chanindx) % READ_BRAINSTORM_DATA reads .EEG files that have been generated by % the Nihon Kohden system. The function constitutes a wrapper around % BrainStorm3 functionalities % % Use as % [dat] = read_brainstorm_data(filename, hdr, begsampl...
50a5b82603890e6d01c432f673522830ca742279439a704f9123b9fe2c6cabf8
MATLAB
2,284
76
function [model, loglikHist] = gaussMissingFitEm(data, varargin) % Find MLE of MVN when X has missing values, using EM algorithm % data is an n*d design matrix with NaN values % See emAlgo() for EM related optional args %PMTKauthor Cody Severinski %PMTKmodified Kevin Murphy % This file is from pmtk3.googlecode.com %...
62573033ec65cb90b98e0096934c9be18590be29cbe833ed2c1bd05894955ea4
MATLAB
2,284
71
function trl = compoundTriggerTrialFun(cfg) %Defines a trial x from the prestim value (trigger - some specified value) %to the start of the subsequent trial plus some poststim value (trigger x+1 %+ poststim value) % Supports compound epoching of task related data. See epochingHelper.m for % additional information on us...
984e14b9b6ead06fc226aa569ca0def549bbcc811548d6646da95f5134712319
MATLAB
2,284
66
function h_loadRefScoringData3(handles) global jbm; global h_img3; %+/- color code LOST = [1 0.5 0.5];%red GAINED = [0.5 1 0.5];%green TRANSIENT = [1 1 0.5];%yellow PRESENT = [0.5 0.5 1];% blue [fname, pname] = uigetfile(); if fname~=0 fullFileName = [pname fname]; load(fullFileName,'-mat'); ...
3e2cb156ee7839ed9665b832a01e69393adb7ae0672b3eeb32918dfa538bdf42
MATLAB
2,285
50
%% Extract files locally using partial file name addpath 'C:\Code\wjn_toolbox'; % Define directory that will contain all the AvgR_Fz files % lh_AvgR_Fz_maps = 'D:\ECoG_Atlas\MRI\flipped_seeds\functional_maps\flipped_seeds_maps\left_hem_niis'; master_folder = 'C:\Users\ICN_guest\Charité - Universitätsmedizin Berlin\In...
642058b3a16cfb9d4787b9cdcc0aba31fe2331667992ad3889e2d58bea1d5b1f
MATLAB
2,285
70
function [codename, pg, datestr] = pmlCodeRefs(codeIndFile) % Return a list of all of the code files referenced in PML % along with the (hard cover) pages on which they are first referenced. % %% Input % codeIndFile - path to the code.ind file generated by the % latex "makeindex code" command. % (default = 'C:\kmurphy...
cc413215778daf3534a95f17f5084019c9072a58600d8147650b99bc13fc7fbc
MATLAB
2,285
47
for k = 1:length(X) clf; x = X(k); % Display NIFTI slice I = round(-x/d1d2d3(1) + N1N2N3(1)/2); % minus here! S = squeeze(VT1(I, :, :)); % choose the X cross-section S = S(end:-1:1, :); image([-DimensionY/2 +DimensionY/2], [-DimensionZ/2 +DimensionZ/2], S, 'CDataMapping', 'scaled...
64a644a0e67ba3d29ba2f07ac5a4d777786926817b674d97bc53c341c55e5dfd
MATLAB
2,286
74
function out=batch_folders(folders, option) rexposure_exception=[]; %if you have four tracks but they are not rexposures, make this not empty... rexposure=[]; %if not empty, assumes that there is rexposure to track %order of running batch analysis %EXTRACT_SPIKES_MARTA or EXTRACT_SPIKES_MARGOT %EXTRACT_VIDEO %PRE %...
f54475fc4bb3ca7224ca59eff783faa7fb98125d56f503aec5d3f62007f8cac8
MATLAB
2,286
49
function MultiInput1 = Import_CSV_File(filename, dataLines) %IMPORTFILE Import data from a text file % MULTIINPUT1 = IMPORTFILE(FILENAME) reads data from text file FILENAME % for the default selection. Returns the data as a table. % % MULTIINPUT1 = IMPORTFILE(FILE, DATALINES) reads data for the % specified r...
419df4a4d7ca30187c7f69e807461551f01559f6a47e6e15e675be411374b570
MATLAB
2,287
76
function m = mkImMasks(opts) % %----------------------------------------- % m = mkImMasks(opts) % % generates a family of window functions % for use with metamer analysis and synthesis % model (see metamerAnalysis.m and metamerSynthesis.m) % % opts: parameter vector (see initParams.m) % % m: structure containing windo...
bfa3afb0126e04eb45f1a0fbffbe5d5ea915ea9078738ef7f76186cf17f89d0b
MATLAB
2,287
58
function M = specialeuclideanfactory(n, k) % Returns a manifold structure to optimize over the special Euclidean group % % function M = specialeuclideanfactory(n) % function M = specialeuclideanfactory(n, k) % % The special Euclidean group (the manifold of rigid transformations): % This is a product manifold of...
080a0481e8e484c85294613802d079cbb51157f1fdc8d624b75ce00c89b1ca8b
MATLAB
2,288
92
function [hEllipse,X,Y] = ellipsedraw(a,b,x0,y0,phi,lineStyle,varargin) %ELLIPSEDRAW can draw an arbitrary ellipse with given parameters. % The properties of that ellipse plot can be customized % by setting the ellipse handle. % % hEllipse = ellipsedraw(a,b,x0,y0,phi,lineStyle) % % Input parameters: % ...
3331a1c72f07ebcfe863466f44d18f71760690c8f95b28d5c724f76bc3d153fb
MATLAB
2,288
44
%% shuffleSpikesInsideRange % Performs N_DRAWS double-random shuffling of interspike intervals of % provided spikes between range given by T_START and T_STOP. % Spike time, start time, and end time should be in the same units. % Copyright (C) 2023 Trevor S. Smith % Drexel University College of Medicine % % This pro...
0d3c7a5f09c0b8e6c3292b200b41181e73d87e460340107b7a49e1132848a08c
MATLAB
2,289
72
function err_list = spm_exec_mult_jobs(job_list) % _ % Execute Multiple Jobs using SPM % FORMAT err_list = spm_exec_mult_jobs(job_list) % % job_list - cell array of batch editor job filenames % err_list - cell array of jobs that didn't work out % % FORMAT spm_exec_mult_jobs(job_list) loads the batch editor jo...
16a2474d5a04ac12fc0450f3926da7229da504ff0ba31e27a36a01608beceffd
MATLAB
2,289
92
function main() standardize = false; %true; [xtrain, ytrain] = polyDataMake('sampling','thibaux'); if standardize [xtrain] = standardizeCols(xtrain); end N = length(xtrain); wBatch = [ones(N,1) xtrain] \ ytrain; ss = []; for i=1:N [w(:,i),ss] = linregUpdateSS(ss, xtrain(i), ytrain(i), xtrain, ytrain); end figure...
8433e5066b35d74733c30aef8c83a491f17b4ba15e875e3a6d415dafc9ebb128
MATLAB
2,289
85
set1 = load(data_set1); % part1\Calib_Results; set2 = load(data_set2); % part2\Calib_Results; shift = set1.n_ima; for kk = 1:set1.n_ima eval(['X_' num2str(kk) ' = set1.X_' num2str(kk) ';']); eval(['dX_' num2str(kk) ' = set1.dX_' num2str(kk) ';']); eval(['dY_' num2str(kk) ' = set1.dY_' num2str(kk) ';']); eval(['wi...
c6e70fc326b4ae8e8b43c33de4b79a57f7ef792600ecce61c7962cc6e7073a06
MATLAB
2,289
72
function [EEG, new_events_lat] = ch_insert_events (EEG, cfg ) %% About function/script % Name: ch_insert_events % Version: 1.01 % Christoffer Hatlestad-Hall % Date created: 19 Jan 2020 % Date last modified: 29 Jan 2020 % -------------------------------------------------------------------------------------------...
cf58509c3a09e6aa8c771928f95c875f5e5b6c990fb16885d76e903bfdc4b68c
MATLAB
2,289
60
function exportToGoogleCode(package, username, passwd, summary, exclusions, createEmpty) % Export package from svn, uploading the zip to the google code repository % % PACKAGE - name of svn directory % USERNAME - your google code username, e.g. mattbdunham % PASSWD - your autogenerated google code pas...
ef6307bdec3d37cc83a110474f744b43bb79f46e29941262282efde12d32f8cc
MATLAB
2,289
76
function [xgp,wt] = generalized_phase( x, Fs, lp ) % *SPONTANEOUS WAVE DEMO* % % GENERALIZED PHASE calculate the generalized phase representation for % each channel in a datacube % % INPUT: % x - datacube (rows, cols, timepts) % Fs - sampling rate [Hz] % lp - low-frequency data cutoff [Hz] % %...
a02f5af5df29080e31a7272f07d22665a4eeb8576c7d125089498437f04bbd7a
MATLAB
2,290
71
function [headmodel] = ft_read_vol(filename, varargin) % FT_READ_VOL reads a volume conduction model from various manufacturer % specific files. Currently supported are ASA, CTF, Neuromag, MBFYS % and Matlab. % % Use as % headmodel = ft_read_vol(filename, ...) % % Additional options should be specified in key-value ...
263e6eb04f7254f76f0c30bba56fc55ff14662f0bad19337a3a2c0e4409ff842
MATLAB
2,291
51
%Step 3 of CBIG Kong2019 Brain Parc Pipeline % %To run: 1. Open Matlab using salloc (ex: `salloc --mem-per-cpu 6G --time 2:00:00 --x11`) % 2. source your config file containing the $CBIG_CODE_DIR variable % 3. `cd` to the $CBIG_CODE_DIR/stable_projects/brain_parcellation/Kong2019_MSHBM/step3... folder % 4. `cp` thi...
c600987216246218c16379d146675d2560ad1245f88d39d28fe34a3e51d4e98d
MATLAB
2,292
42
function exp_log_likelihood = CBIG_AuthorTopicEM_ExpLogLikelihood(w, paradigm, params, q) % exp_log_likelihood = CBIG_AuthorTopicEM_ExpLogLikelihood(w, paradigm, params, q) % % Compute log likelihood of a given experiment given the auxiliary parameter of the EM algorithm % and current model's parameters. % % Input: %...
8bc53b42102b98b0072223b37aa0e8593918708d4f2e00beb4d065087e4b2766
MATLAB
2,294
87
function [x,gpd,nu]=gdpower(N,k,c) %GDPOWER Signal with power-law group delay. % [X,GPD,F]=GDPOWER(N,K,C) generates a signal with a % power-law group delay of the form tx(f) = T0 + C*f^(K-1). % The output signal is of unit energy. % % N : number of points in time (must be even) % K : degree of the power-law (defa...
a5b9110baefc6e32e0287495fc3d897c286d5644150f6367e62b99c84991c5c6
MATLAB
2,294
65
function outputImage = interpolateVolumeCUDA(inputImage,data_channel) %Assumes that there are 0s in the input image where the original image was %not able to warp into. To ensure this, a nominal f %Add a nominal amount to the tileM for the interpolation step at the end of %this function %It is rounded back to integer...
1007f35d574d6e4d658e25faea053cc890cfb61078c40c7bd14e058645a1fd1d
MATLAB
2,295
91
fnames = {'test_minentest' 'test_minentest2' 'test_minentest3'}; temp_pm0 = []; temp_pm1 = []; temp_pk0 = []; temp_pk1 = []; temp_reps = 0; for i = 1:length(fnames) load(fnames{i}); temp_pm0 = cat(3,temp_pm0,pm0); temp_pm1 = cat(3,temp_pm1,pm1); temp_pk0 = cat(3,temp_pk0,pk0); temp_pk1 = cat(3,temp...
42c1dca4777bae957217f753aa5ad405fc4da0c059d7b28f0854d3edb4fc33bc
MATLAB
2,296
53
function [ feedback, point ] = utils_ApplyModel( model, classVar, slice ) % (c) Coraline Rinn Iordan 10/2017, 04/2018, 06/2018 % % slice : numVoxels x 1 % KLE = LLR: log-likelihood ratio between classes positiveThreshold = 70; negativeThreshold = 1; point.valFull = slice' / model.PCA.coeff'; % 1 x numComponents point...
4f971797e2c49772f03d7d944ce6593b675c803740ee72b01414efc897f2d338
MATLAB
2,296
67
function [trl, event] = ft_trialfun_trial(cfg) % FT_TRIALFUN_TRIAL creates a trial definition that corresponds to the % events that are returned by FT_READ_EVENT with type='trial' % % You can use this function as follows % cfg = []; % cfg.dataset = string, containing filename or directory % cfg.tr...
26c97275c4f0ee6aca2fd334123f67c3cedf4854d6f467e826bd5414e865c0e4
MATLAB
2,298
99
function wlPlot_plotMultipleExtracted(cfg, ... wavelist, freqlist, phaselist, ... figtitle, filelabel); % function wlPlot_plotMultipleExtracted(cfg, ... % wavelist, freqlist, phaselist, ... % figtitle, filelabel); % % This function plots multiple time-series waveforms, multiple instantaneous % frequency series...
bef72ab25b13bae471b6b6598f897c8ddf7a85e32aef82b7cbf40bd30c78e280
MATLAB
2,298
75
datRoot = '/Volumes/LaCie/Farries recordings/'; rat = 'IM1153'; %implantSide = 'L'; sesList = dir([datRoot rat '/201*']); sesList = arrayfun(@(x) x.name, sesList, 'UniformOutput', false); sorted = cellfun(@(s) ~isempty(dir([datRoot rat '/' s '/*sorted-raw'])), sesList); sesList = sesList(sorted); for i = 1:length(sesLi...
edb440acdc1e7b5446fb220548ce190a7cdd9ffa1b6f7b1463b7ca3d7cdd2672
MATLAB
2,299
73
function d = L2_distance(a, b) % L2_DISTANCE - computes Euclidean distance matrix % % E = L2_distance(A,B) % % A - (DxM) matrix % B - (DxN) matrix % % Returns: % E - (MxN) Euclidean distances between vectors in A and B % % % Description : % This fully vectorized (VERY FAST!) m-file computes ...
1bde4ccae495bff6ae072d523c5f88b706b8f2b93a79d821fbeb4b80460e3893
MATLAB
2,300
68
classdef PulseTrainDetector < FeaturesDetector properties baseReporter pulseFeatureType maxIPI = 0.1 minPulses = 3 end methods(Static) function n = typeName() n = 'Pulse Trains'; end function ft = possib...
bb5580f1d6247afd133c3a0db30bab17ab5fce450b4899732d6f278a1d00f8d8
MATLAB
2,300
81
function [Image2,NbDots]=imextrac(Image,trace); % imextrac(Image) extract and isolate dots in a binary image % % example: % Image=[1 0 0 0 0 0 1 0 0 0 1 0 ;... % 1 1 0 0 0 1 1 0 0 0 1 1 ;... % 1 0 0 0 1 0 1 0 0 0 0 1 ;... % 0 0 0 0 1 1 1 0 0 0 0 0 ;... % 0 0 0 0 0 0 0 0 0 0 0 0 ]; % image2=i...
947d5433db0bf1d2071d417d25bf99a6398f9680d7616a17b6933f3604086900
MATLAB
2,301
48
function h_resetBLUEValues3(handles) global h_img3 [currentInd, handles, currentStruct, currentStructName] = h_getCurrendInd3(handles); imageModeValue = get(handles.imageMode, 'value'); if isfield(currentStruct.internal, 'imageModeValue') previousImgMode = currentStruct.internal.imageModeValue; else...
a4ea35958be75da613b5499ec21a95dd8c6b50aac62f0a9875483610bb5b39ad
MATLAB
2,302
70
datRoot = '/Volumes/LaCie/Farries recordings/'; rat = 'IM1130'; sesList = dir([datRoot rat '/201*']); sesList = arrayfun(@(x) x.name, sesList, 'UniformOutput', false); sorted = cellfun(@(s) ~isempty(dir([datRoot rat '/' s '/*sorted-raw'])), sesList); sesList = sesList(sorted) iSes = 1 % choose session sesDir = [datRoo...
e3799c8dc6a0b57baf3aa7bab61a72c9a29d2b612e1cd1ac4ab27cdb9807c0da
MATLAB
2,302
68
% manual_masking_loop.m % Sarah West % 8/23/21 % Modified from SCA_manual_masking.m, just the manual masking parts. Will % also put in code from create_bloodvessel_masks_withbackgroundmasks.m . % Let's you keep adding masks until you say you're done. You can return to % it. % Is run with RunAnalysis function [parame...
5ad2a78a74a1e37aaae71462382d725bd123d6b33354c084800d454c5d4966fe
MATLAB
2,303
69
function q = simpqual(p, t, type) %SIMPQUAL Simplex quality. % Q=SIMPQUAL(P,T,TYPE) % % TYPE can be % 'Radius_Ratio' or 'Min_Sin_Dihedral' % Copyright (C) 2004-2006 Per-Olof Persson. See COPYRIGHT.TXT for details. % % % Modified by Hamid Ghadyani, 2012, Dartmouth College % Add minimum sine of the dihedral ang...
cd6f2913cc8bcb3f90e5ba5e9b876a078df76ffea0fab0d5bf159c004c97a121
MATLAB
2,303
50
function PassiveNoise(MATPATH, FIGPATH, params) %% Parameter setting params.processFcn = @NoveltySU.preprocess.PassiveProcess_noise; NoveltySU.utils.parseStruct(params); temp = string(strsplit(MATPATH, "\")); % dateStr = temp(end - 1); protStr = temp(end - 2); DATAPATH = MATPATH; FIG...
b4df776e72727ea8b831b17c89568aa9359276388c031a0f90f8d8ddeea271df
MATLAB
2,304
91
function z = le(x,y) %LE Less than or equal for sptensors. % % See also SPTENSOR. % %MATLAB Tensor Toolbox. %Copyright 2015, Sandia Corporation. % This is the MATLAB Tensor Toolbox by T. Kolda, B. Bader, and others. % http://www.sandia.gov/~tgkolda/TensorToolbox. % Copyright (2015) Sandia Corporation. Under the term...
8d3ed2ff7b72085251e61156945e4530e48dde68f16b513c1a28eb034581504f
MATLAB
2,305
70
%INSTRUCTION: use cell array for possible integer answers and for a range use a 1d array with %the upper lower limits ex. [0:10] as one of the answers %[Answer]=InputWithVerification('Is this the correct way to use this: ',{[],[1:10]},0) function [Answer]=InputWithVerification(Question,PossibleAnswers,BeepOn) warn...
a88a29e9b6680d6738cb3c2d1751a0b12fd290cf48b1b56ae4ae9369347f1d73
MATLAB
2,305
62
function [bValue,bAmplitude,bOsc] = HistogramGenerate(opt,PathwaySignalFirstOrder,GwaveFirstOrder,PathwaySignalHigherOrder,GwaveHigherOrder,TransFirstOrder,TransHigherOrder) % %Convert bLim to s/mm2 opt.bLim=opt.bLim*1000; %Convert G to G/cm opt.G=opt.G/10; %% %Initialise b array bAmplitude=zeros([1,opt.bLim]); %% %Def...
adcc735dddd46515edb7662141e3a2a68e367f29fb83427d0fdcf804d2b44413
MATLAB
2,305
45
function [params, doc_log_likelihood, q] = CBIG_EM_doc_e_step_wc(w, paradigm, params) % [params, doc_log_likelihood, q] = CBIG_EM_doc_e_step_wc(w, paradigm, params) % % Perform E-step of the Author-Topic model on each experiment (document). Note that % compared to CBIG_EM_doc_e_step.m, this function takes in an argu...
b8c28798ecf9887fdbb1303df85863e07213502a0f71c08edf9682585c7b6423
MATLAB
2,305
69
% this code calculates the spearman rank correlation coefficient for the 3d glass and is window averaged. dia=1.6; path='D:/Rati/3d_glass/'; X=load(strcat(path,'STS_ASM385_70_2-12_6_T=0-24_PosX.dat'))/dia; Y=load(strcat(path,'STS_ASM385_70_2-12_6_T=0-24_PosY.dat'))/dia; Z=load(strcat(path,'STS_ASM385_70_2-12_6_T=0...
d9d427ec4dccb5c4f5780a329e5e927630c2b1e957752eef595be0947871e00c
MATLAB
2,305
45
% The feature viewer visualizes features for the currently selected % datapoints. It can also depict the local graph of the currently selected datapoint. % which is helpful when exploring embeddings such as those generated by t-SNE or UMAP or other % large scale visualizations. % % Below a...
2fac249bce022ee479798f7a71c54142bc5787b02a5d8e5d4f2f60b4859e68fe
MATLAB
2,308
85
function disp(X,name) %DISP Command window display of a sparse tensor. % % DISP(X) displays the tensor without printing its name. % % DISP(X,NAME) displays the tensor with the given name. % % See also SPTENSOR, SPTENSOR/DISPLAY. % %MATLAB Tensor Toolbox. %Copyright 2015, Sandia Corporation. % This is the MATLAB ...
d59d1867ac1c0760fd8a0c4a4b2b19015d5b19c300fa9735591827cf3c689179
MATLAB
2,308
54
subjlist=dir('*.COORD'); for i = 1:size(subjlist) subj=subjlist(i).name; fid = fopen(subj,'r'); fidw = fopen('coordinate.txt','w'); %´ò¿ªÐ½¨µÄ¿ÕÎı¾Îļþ£¬Ò²ÊǺóÐøÐ´ÈëÊý¾ÝµÄÎı¾Îļþ filename_b=[subj '_background.txt'] fid_b = fopen(filename_b,'w'); %´ò¿ªÐ½¨µÄ¿ÕÎı¾Îļþ£¬Ð´Èë±³¾°Êý¾ÝµÄÎ...
2eb453ad6c55bdb4ba6de72ca3ea766267b99797a6b26bae6b96d2827dd3504f
MATLAB
2,309
103
%% Gauss Imputation Demo % PMTKneedsStatsToolbox regstats %% % This file is from pmtk3.googlecode.com function gaussImputationDemo() requireStatsToolbox %% Make data setSeed(1); d = 20; n = 5; pcMissing = 0.5; mu = randn(d,1); Sigma = randpd(d); trueModel = struct('mu', mu, 'Sigma', Sigma); Xfull = gaussSample(trueMo...
358c0a91159b54d11c3599eab1465730053efa14975af30df8fc531338b9a67e
MATLAB
2,309
71
%% GENERATE CODE FOR VARIABLES % This document demonstrates the usage of GENCODE, GENCODE_RVALUE and % GENCODE_SUBSTRUCT to show and modify the contents of complicated MATLAB % variables. %% %% A TEST VARIABLE % The variable x is a struct with two fields: f1 and f2. f1 is a cell array % of arbitrary items. x.f1 ...
be63ab29fa6d59f9b039187cd376d7159c12a391f72b82fbfcb2351732e3656f
MATLAB
2,309
67
function F = get_factorization(center,area,normals,qcorr,contrast,weight,opts) % % This subroutine constructs a recursive skeletonization with strong % admissibility factorization for a laplace TE polarization problem % the integral equation being solved is % (1 + \kappa 2S')\sigma = f % where \kappa is the const...
cb5837c7dc12934e8e44f0f83ffcec0d877ac6c89f92a373774cd573b88f41b5
MATLAB
2,309
92
function M = unwrapCell(C) % Recursively remove superfluous cell nestings and eventually concatinate % using cell2mat. This is an idempotent operation; calling it on a cell % array that cannot be unwrapped any further returns the orginal cell % array, unaltered. Full unwrapping, (using cell2mat concatination) only %...
65990bcdd8fa6592ba083d87644721d8aab942f9c398b62a71cbfa9d79831bf3
MATLAB
2,310
76
function [posterior,out] = VBA_wrapup(posterior,options,dim,suffStat,u,y,it,fromPause) % wraps up the VB inversion % function [posterior,out] = VBA_wrapup(posterior,options,dim,suffStat,u,y,it) % IN: % - [VBA internal variables; see VBA_NLStateSpaceModel.m] % OUT: % - posterior: the final 'posterior' structure % ...
68b2e989b2f0aa5bd102d41a29ba1b2316403f4e360819f07b90882f99a79946
MATLAB
2,310
65
% The Dataview (also called PropertyList) provides several slots that can hold the names % of labels (of the datasource), graphs and the index of a currently selected % data point. The dataview window shows the values of all slots. Right clicking % on the blue text opens a context menu to change th...
eda1e9166f864ddd2285a6554107980fe71493331a3b3bfb9eea84daadce49ab
MATLAB
2,310
76
function cost = plotprofile(problem, x, d, t) % Plot the cost function along a geodesic or a retraction path. % % function plotprofile(problem) % function plotprofile(problem, x) % function plotprofile(problem, x, d) % function plotprofile(problem, x, d, t) % function plotprofile(problem, x, [], t) % function p...
ea065f0bd3992b298a900a09df5237ce58b6ea1436204dd4ebc7ddd484cc2a19
MATLAB
2,311
69
function hfig = createSplashScreenFigure() % Create the APT splash screen figure %hparent = handles.figure; hfig = nan; splashimfilename = fullfile(APT.Root,'gfx','SplashScreen.png'); if ~exist(splashimfilename,'file'), return end % oldunits = get(hparent,'Units'); % set(hparent,'Units','pixels'); % pos0 = get(hpar...
9760e80e0c52bd7ac0cf8407ff9e314a33be9edcf85e729946d28e4c8d30b83b
MATLAB
2,313
69
function [F, J] = funfitDoGModel(params, xvals, xorder) %UNTITLED Summary of this function goes here % Detailed explanation goes here %========================================================================== gamma = params.outparams(1); alpha = params.outparams(2); %=================================================...
99beabb1b04478e2bb0295eade2e037988542558508904d9bfb476d5c3a90a77
MATLAB
2,313
88
%% Demonstrate the effect of changing the hyper-parameters for an MLP % based on demprior from netlab, but without the GUI code %% % This file is from pmtk3.googlecode.com setSeed(1); if 0 % values from Bishop p260 - clearly not correct aw1s = [1 1 1000 1000]; ab1s = [1 1 100 1000]; aw2s = [1 10 1 1]; ab2s = [1 1 1 1...
7282eab5b71b94d558ea3c6ccd15143c0f8c3ae33c37d8639746fbd498c243cc
MATLAB
2,314
84
function meg_msFigs_ITPCbyITI_slopes_bar % function meg_manuscriptFigs_ITPCbyITI_slopes_bar % load groupITPC_ITI % and run kt_ITPCbyITI for the model fits by jitter load('figData/ITPC_byITI.mat') %% Settings plotSubjects = 1; saveFigs = 1; annotateStats = 1; figFormat = 'svg'; % Figure directory [figDir,dateSt...
9767b7ac9c78c363b9a06fc9a617c8011026d0d794b1c6d0199957a4ea31cb0e
MATLAB
2,314
71
function HMM = fit_HMM(datadir, hmmdir, HMM_name, only_cov, only_1st, k) % HMM = fit_HMM(datadir, hmmdir, HMM_name, only_cov, only_1st, k) % % fit a group-level HMM to the HCP resting state fMRI data. % This uses a Gaussian observation model, either using the mean or pinning % it to 0 (only_cov). % Wrapper for hmmmar. ...
ca8be8fb805d7aad8b53d8b3f3fa5850e1bfb0830a9e036c2a1018236565c9dc
MATLAB
2,315
59
Vapp(1:t_ar(1)) = V0; Vapp(t_ar(Nta-1)+1:t_ar(Nta)) = V0; time_up = t_ar(2)-t_ar(1); slope_up = (V1-V0)/time_up; t_up = 1:time_up; Vapp(t_ar(1)+1:t_ar(2)) = V0+t_up*slope_up; time_down = t_ar(3)-t_ar(2); slope_down = (V0-V1)/time_down; t_down = 1:time_down; Vapp(t_ar(2)+1:t_ar(3)) = V1+t_down*slope_down; %%%%%%%%%%%%%%...
094f33019af0975f1eb38be3de90cf5276a18ce2300f8b1398405ab647550612
MATLAB
2,316
126
function [Irec] = rect(I,R,f,c,k,alpha,KK_new); if nargin < 5, k = [0;0;0;0;0]; if nargin < 4, c = [0;0]; if nargin < 3, f = [1;1]; if nargin < 2, R = eye(3); if nargin < 1, error('ERROR: Need an image to rectify'); end; e...
0b04aa651129ee93993c02136fbbac06a9f2373ddd18b5755586fad37ef157b9
MATLAB
2,316
63
function [posterior, out] = VBA_multisession_factor(posterior,out) % [posterior, out] = VBA_multisession_factor(posterior,out) % take a multisession model, extract within session parameters and % trajectories (in posterior.perSession), and clean up the out structure % by undoing the multisession wrapping performed by ...
3f6495be083cef3849b2a1a33a0d452a604070420d6db6552d92c17f872a73ae
MATLAB
2,317
62
%% Example code for calculating z-scored log odds % Please make sure to add example_code folder into the path or cd to the % path % First, we will create simulated place cells and simulated linear replay % trajectories for two tracks number_of_place_cells = 50; no_of_events = 100; [place_fields,t,replay_time,replay_sp...
44eedbced8af47e498de33e1fe65fc3ab68e49a51000f3a1e843f45a514c30ae
MATLAB
2,317
64
function M = softMin( D, sigma ) % Calculates the softMin of a vector. % % Let D be a vector. Then the softMin of D is defined as: % s = exp(-D/sigma^2) / sum( exp(-D/sigma^2) ) % The softMin is a way of taking a dissimilarity (distance) vector D and % converting it to a similarity vector s, such that sum(s)==1. If ...
7d9fc1b5bd40a5f3c5b277e41dffeb258be6ce5d9ac4a0a82b676f3ecdd32c52
MATLAB
2,317
87
%% tsdata_to_autocov_debias (EXPERIMENTAL) % % Calculate sample autocovariance sequence from time series data with debias % % <matlab:open('tsdata_to_autocov_debias.m') code> % %% Syntax % % G = tsdata_to_autocov_debias(X,q) % %% Arguments % % See also <mvgchelp.html#4 Common variable names and data structures>. % ...
508d7131863aafcf8b21462c5aa69a9cbed86c77d442efecdc9bda94a964fd2d
MATLAB
2,318
38
function stimulusMatrix = utils_GenerateShape( nShapes, shapeInit, manipulateDim, shapeNum, warp, sizeShape, background, Lmin ) % (c) Coraline Rinn Iordan 06/2018 % nShapes: number of shapes to generate on continuum ; should be odd number! % shapeInit: baseline shape parameters % manipulateDim: whic...
92d163e3d9621a2487aa1452b3f54f8e5e1c8d73f032a7375d50d077cfb84849
MATLAB
2,318
61
function J = convMax( I, r, nomex ) % Extremely fast 2D image convolution with a max filter. % % For each location computes J(y,x) = max(max(I(y-r:y+r,x-r:x+r))). The % filtering is constant time per-window, independent of r. First, the % filtering is separable, which brings the complexity down to O(r) per % window fro...
d88a10e540c908562ec2fa3a57b60a799f9b1f1ea42eb10cec61a7297c47725c
MATLAB
2,318
38
function stimulusMatrix = utils_GenerateShape( nShapes, shapeInit, manipulateDim, shapeNum, warp, sizeShape, background, Lmin ) % (c) Coraline Rinn Iordan 10/2017 % nShapes: number of shapes to generate on continuum ; should be odd number! % shapeInit: baseline shape parameters % manipulateDim: whic...
f4066715246b3243896569d74f0732b677f35077600db02eb9889b14bf10a366
MATLAB
2,318
64
% TSRMFIELD Removes all instances of a field from the specified level % Takes two arguments, a string which is the name of the field to remove. % Will traverse entire Experiment and remove all instances. Useful for % removing statistics which are no longer necessary. function TSrmfieldRev(Level,field) if eva...
0d7457c894e599d15e4760b48ebebe4045f0ad9e6e01596fb8abf2955d5771b3
MATLAB
2,319
68
function [tfr2,OrderedSurfaces]=tfrsurf(tfr,threshold,keep,trace); % [tfr2,OrderedSurfaces]=tfrsurf(tfr,threshold,keep,trace); % extract from a time-frequency representation the biggest energy dots % TFR : time-frequency representation. % THRESHOLD : the energy threshold, in % % KEEP : ...
94a3231d71a2fb018b01a80edd3667b80a0646796d35e96a733d4a6663a31956
MATLAB
2,319
72
function boxplotScatter(data, Title, yaxe, withlines, sumstats) % this is a function to plot a box and a scatter plot of the data % data is a table with labels corresponding to the categories % title is the title of the plot % yaxe is the yaxis label % withlines is boolean to indicate if to plot with connecting lin...
9635a7b39f5901382f1cd0dcce393b6e1f686cce2852b8c081e4dcf27a8cb11d
MATLAB
2,319
59
function [qidx, q, d] = quantizPMTK (x, table, codes) % [qidx, q] = quantiz(x, tables, codevalues) % Quantize a 1d signal % table is a vector of K-1 thresholds % codes is a vector of K valeus (default 1:K) % See here for more info: % http://www.mathworks.com/help/toolbox/comm/ug/fp6386.html % Source: % http://lasp.col...
8d0b3d614d77d0cd5a9d8f931180f1e0a0e4a6744bc753ad4a99c23767b3e4db
MATLAB
2,320
81
function foci=AdjustFoci(foci,meshL,meshR,side,ctx) % % This function adjusts Foci locations to match the surface of the mesh % in case it is inflated or rotated or otherwise adjusted. % % New algorithm 8/16/17, to be fixed.... % 1. deal with std vs inf or vinf first % 2. determine home hemisphere for ROIs % 3. keep tr...
4e4364c22bd50be488453d7cdce31e2117c969a0fcb78ed08bd410635a74b6cc
MATLAB
2,321
94
function newevmatrix = wlFT_pruneEventsByTime(oldevmatrix, ... padbegin, padend) % function newevmatrix = wlFT_pruneEventsByTime(oldevmatrix, ... % padbegin, padend) % % This function processes an event matrix structure and removes events with % nominal starting or stopping times that are too close to the ends of ...
27eede5912085194516ad09bd3f9052a791f8457cca90290595386fefc0ebb8b
MATLAB
2,322
84
function [mag vect precomp_grads yy ix] = GetGradOri_vector(pix,r,c,s, fv, sift_params, precomp_grads) rows = sift_params.pix_size(1); cols = sift_params.pix_size(2); slices = sift_params.pix_size(3); % clamp r,c,s to the bounds of the img (pix) if r < 1 r = 1; end if c < 1 c = 1; end if s < 1 ...
362b782bf87b0c892d7b94cdf6a5b93ff2d50c454e829c1c2188589cc7473b8b
MATLAB
2,322
77
function [goodChannelList,badChannelList] = inputBADchannels(rawdata,subj_location, subj_match) % goodChannelList contain all MEG and reference channels except the MEG channels present in badChannelList hdr=ft_read_header(rawdata(subj_location)); sel=false(size(hdr.label)); labels = hdr.label(cell2mat(cellfun(@(x) con...
e5fe85343ebea546f207849edda182fb982fd1cf21b69ed45c3a9ac3f689801e
MATLAB
2,322
54
%boney_eval_printCrossCorrelation %% create figure 12 % new measures sorted by correlations fg=12; fgh = figure(fg); clf(fg); fgh.Position(3:4) = [800 350] + [15 5] * max(0,numel(measure)-10); fgh.Color = [1 1 1]; for mi = 1:numel(measure) for mj = 1:numel(measure) msk = ~isnan(out.(measure{mi}){1}) ...
0b36114a85dfe1aa61d2d788f2b54b538727e9fc1d8c4af63e7982c741e944de
MATLAB
2,323
82
function CBIG_RL2017_Figure4_toy_ex_HMM % CBIG_RL2017_Figure4_toy_ex_HMM % This code generates a 2-state HMM model and the corresponding autoregressive (AR) and phase % randomized (PR) surrogates. It was used to generate Figure 4 in Liegeois et al. (NeuroImage 2017). % % % Written by Raphael Liegeois and CBIG under M...
18411180376bf761caa11e0a8c62b62447f276da186d11259f47bfe537b7a0bf
MATLAB
2,323
81
%% Lung cancer network Example % Make DAG % S % / \ % v v % CB LC % \/ \ % v v % SOB X %% % % % % % This file is from pmtk3.googlecode.com nvars = 5; toporder = false; [dgm] = mkLungCancerDgm(toporder); S = dgm.nodeNum.S; CB = dgm.nodeNum.CB; LC = dgm.nodeNum.LC; SOB = dgm.nodeNum...
cfb68d5529f381b4083942bd2360a42cf4123c4d90c8fa5266c67dcf98a41b5f
MATLAB
2,323
72
% AUTHORSHIP % Primary Developer: Stephen Meehan <swmeehan@stanford.edu> % Math Lead & Secondary Developer: Connor Meehan <connor.gw.meehan@gmail.com> % Bioinformatics Lead: Wayne Moore <wmoore@stanford.edu> % Provided by the Herzenberg Lab at Stanford University % License: BSD 3 clause % function [jd, ...
3572313e591ffe6220d68e1e7e70e0ce3e93b4598b88082dc579c3886305e026
MATLAB
2,324
60
function B = imResample( A, scale, method, norm ) % Fast bilinear image downsampling/upsampling. % % Gives similar results to imresize with the bilinear option and % antialiasing turned off if scale is near 1, except sometimes the final % dims are off by 1 pixel. For very small values of the scale imresize is % faster ...
7678200fee2ead94d24670d0883340feb92fbaf72ad10f8d54eb0f8bcc06740a
MATLAB
2,324
83
function h_searchAndAddToGroup3(handles) global h_img3; UData = get(handles.h_searchForGroupGUI3, 'UserData'); structName = ['I', num2str(UData.instanceInd)]; pathname = get(handles.pathName,'String'); basename = get(handles.fileBasename,'String'); fileExtension = get(handles.fileExtensionOpt,'String'); if...
fd228306126e9f7542bff3971c52e10177b702db008a947cf31f08631d61ab10
MATLAB
2,324
72
function [gd,fnorm]=sgrpdlay(x,fnorm); %SGRPDLAY Group delay estimation of a signal. % [GD,FNORM]=SGRPDLAY(X,FNORM) estimates the group delay of % signal X at the normalized frequency(ies) FNORM. % % X : signal in the time-domain. % FNORM : normalized frequency. By default, FNORM is a % linearly spac...
a711346bb39528aa96decccf0bd80e1b044e2a42ecc527d4fbbb41665b3e5085
MATLAB
2,325
60
function [FRorig, FR] = getDataForDPCAAction(AllTrialData,timeWindow,Phase,varargin) [varargin,SmoothingKernel]=Utilities.ProcVarargin(varargin,'SmoothingKernel',.55); [varargin,meanThresh]=Utilities.ProcVarargin(varargin,'meanThresh',1.5); [varargin,TaskLabel]=Utilities.ProcVarargin(varargin,'TaskLabel','XActionT...
d00f2a5d54c208f83f744331ca2bc5a5039ade76e0e4bc692809b7bd1f9b5503
MATLAB
2,325
46
function Obj=SOFAconvertARI2SOFA(hM,meta,stimPar) % OBJ=SOFAconvertARI2SOFA(hM,meta,stimPar) converts the HRTFs described in hM, meta, and % stimPar (see ARI HRTF format) to a SOFA object. % % Copyright (C) 2012-2013 Acoustics Research Institute - Austrian Academy of Sciences; % Licensed under the EUPL, Version 1.1 or...
e57fe810ad6f8bcf2975994125845c39a26c2be69d2a3bdc495c43a2b87f0563
MATLAB
2,325
80
%% Get an interplated stack form an oriented membrane (Modified version for caulobacter) %% It take sample at booth sides and keep the side with greater total density % Author: Antonio Martinez-Sanchez % I: original intput tomogram % M: input binary tormogram with membranes segmented % Ni: input oriented normals coordi...
3e979bfed9b0c128aee79b67b426abe1bdc2099aa16059cf1dc84dbaf6069040
MATLAB
2,326
57
function [corr, avgCorr] = CBIG_ASDf_corrTwoRuns(inputDir_best, inputDir, K, r_best, r) % [corr, avgCorr] = CBIG_ASDf_corrTwoRuns(inputDir_best, inputDir, K, r_best, r) % % This function uses Hungarian matching algorithm to match factors between % two runs (random initializations), and computes the pairwise correlation...
460edb8e5f4bed6b1d2a170af601fbf0cd9d35b677d4d4f158ae8838e20f2dd2
MATLAB
2,326
96
% this function parses metadata and returns a structure % metadata is assumed to be in this format: % % 1234 32 % interpeted as temperature for this file % 1234 proctolin 1e-3 % interpreted as this conc of proctolin for all subsequent files % 1234 decentralized % interpreted as decentralized for all subsequent files...
7ef4bf1f0932b4695d875d439d33dc9b88a7c7d62e2c4b0dd51fec44c27a5137
MATLAB
2,326
75
function Iout=affine_transform_2d_double(Iin,M,mode,ImageSize) % Affine transformation function (Rotation, Translation, Resize) % This function transforms a volume with a 3x3 transformation matrix % % Iout=affine_transform_2d_double(Iin,Minv,mode,ImagSize) % % inputs, % Iin: The input image % Minv: The (in...
3fa35a598923126349b5bdb24f4ec5b6f895af543e58536aab3b8b0934e99e92
MATLAB
2,327
101
function [hf] = displaySimulations(y,x,eta,e) % plots simulated time series (including state-space SVD projections) if VBA_isWeird ({y, x, eta, e}) hf = []; return end dTime = [1:size(x,2)]; hf = figure; pos = get(hf,'position'); set(hf,... 'name','Simulated time series',... 'position',[pos(1),pos(2)...
dcf64e9c3f56871d6dfce8b89c2c6eb0fb966ddc0e6118e8047246eee265fb0e
MATLAB
2,327
86
function test_ShellToken() % Test ShellLiteral constructor and basic functionality lit1 = apt.ShellLiteral('hello'); if ~strcmp(lit1.char(), 'hello') error('ShellLiteral toString failed'); end lit2 = apt.ShellLiteral("world"); % Test string input if ~strcmp(lit2.char(), 'world') error('ShellLiteral string input ...
f522581dab9e887ed1b97161113e8839c2cef0bd0fc2d5e8c09cfc24b56bc6af
MATLAB
2,327
112
function [clindx,nvox] = iimg_cluster_index(dat,xyz,k) % Get voxel cluster indices and sizes % :Usage: % :: % % [clindx,nvox] = iimg_cluster_index(dat,xyz,[k]) % % :Inputs: % % **xyz:** % is 3 x n list of voxel coords, volInfo.xyzlist' % % **dat:** % is index vector of image values % % Returns: cl...
51b30c460302854085826d3d4be8bbf1124d08a119587df36cadd0834fc63de6
MATLAB
2,329
81
% This program is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation; either version 2 of the License, or % (at your option) any later version. % % This program is distributed in the hope that it will be useful,...
f895445ddbc9fe0ea4c51f3ac568bab8b8eec7bec64e6765bb6dd8698a9e4158
MATLAB
2,329
64
% create_spontaneous_period_table.m % Sarah West % 5/20/22 % Make a table listing the spontaneous behavior periods with all the same % fields as the motorized behavior periods table made in % create_conditions_names.m in the motorized_treadmill_behavior_pipeline % respository. % First make as a structure, then use str...
fc2f0925ea5153c46943961a46ec7470956a16024b6d0412e7d18daabd0ebf38
MATLAB
2,329
58
function MultiInput1 = Import_Excel_File(workbookFile, sheetName, dataLines) %IMPORTFILE Import data from a spreadsheet % MULTIINPUT1 = IMPORTFILE(FILE) reads data from the first worksheet in % the Microsoft Excel spreadsheet file named FILE. Returns the data as % a table. % % MULTIINPUT1 = IMPORTFILE(FILE, ...
25f59cf8530e296ff571a8300513fdeddffe006327b9a16c1d2d00a2fae5e665
MATLAB
2,330
86
% Relating peak to dprime % Hypothesis: relative difference of ITPC peaks is the key determinant of % behavioral effects %% Setup user = 'kantian'; p = meg_params('TANoise_ITPCsession8'); [sessionNames,subjectNames,ITPCsubject,ITPCsession] = meg_sessions('TANoise'); %% Load peak data filename = sprintf('/Users/...
3e3c2c691dcbac7035cddfdd87f86651493d40a49fd9796a509a07bdf06d12d2
MATLAB
2,330
57
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % This script corrects the obtained results for multiple comparisons using% % the Benjamin and Hochberg approach % % % % Author: ana.tr...
695718e1a7974a9e79b406b76c4b1800d6215ed580cdee51dcf913b96cf1729d
MATLAB
2,330
79
function tbl = kinematCompileSH(kineList) s = struct(... 'lblCat',cell(0,1),... % int enum for type of label file 'lblFile',cell(0,1),... % 3-level path 'iMov',[],... % movie index within lblFile 'movFile',[],... % [1xnview] movie fullpaths 'flyID',[],... 'frm',[],... 'pLbl',[],... % [1xnLabelPoints*2]=...
941ee5d26cf4a90f52ec27f91b38ce82ad8af1fa69fa2c751585304bb616edea
MATLAB
2,330
61
function [orthobasis, L] = orthogonalize(M, x, basis) % Orthonormalizes a basis of tangent vectors in the Manopt framework. % % function [orthobasis, L] = orthogonalize(M, x, basis) % % M is a Manopt manifold structure obtained from a factory. % x is a point on the manifold M. % basis is a cell containing n line...
572cc24c5632223359c73951de66f2d0aa98ac72766f4537d5df259b591d1be4
MATLAB
2,331
54
classdef CBIG_MFMem_rfMRI_unit_test < matlab.unittest.TestCase % In this script, we perform the step_1_estimation unit test of Wang2018_MFMem project % The content of this script is bacically the same as this file's: CBIG_MFMem_rfMRI_estimation_main_ut_test % Here we change the test scrip's name and pu...
7cd9b4d6eb1c3b608b02b2199e2bf5be1f66c9296c707f62370536d15e30997c
MATLAB
2,331
108
function freq_plot(LAN,cfg) % v.0.0.1 % % cfg. % bl = [s1 s2] ; baseline in seconds % nor = 'z' , 'm' or 'mdb'; Normalizacion por z-score or mean-subtraction % % Pablo Billeke % % 27.04.2010 if nargin == 0 edit freq_plot.m help freq_plot.m return end % if nargin == 1 cfg.bl = []; cfg.nor = '...