sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
8b55ef21725f7d3f7911d427ef39b28ed77baca0da78e6050a2d99be35bdd0f4
MATLAB
2,982
97
function [L1,L2,L3,V1,V2,V3] = eig3dkmex( Ixx, Iyy, Izz, Ixy, Ixz, Iyz, mode ) % EIG3DKMEX Multicore eigenvalues and eigenvectors computation in 3x3 symmetric real tensors % of tomograms % INPUT: % Iij - Tomograms with the i, j discrete diferentials, input data must be single and double % m...
38fbdbc0a0d19c16be58b6c05b93ce3ef184739f22920a58e7668220029f9ad5
MATLAB
2,983
109
function hhh=vline0(x,in1,in2) % VLINE add vertical line on current axes % % function h=vline(x, linetype, label) % % Draws a vertical line on the current axes at the location specified by 'x'. Optional arguments are % 'linetype' (default is 'r:') and 'label', which applies a text label to the graph near the line. ...
f38bf21439e4708cbdf9c5d6066463d7ba55ddf6d90cabc40df2de3a164c7f5b
MATLAB
2,983
86
function plotMetricStrain(SOI, chartName, gridSize, strainScale) % plot the metric strain for a chart over the pullback in the first % channel to visualize map distortion % % plotMetricStrain(SOI, chartName, gridSize, strainScale) % % SOI: SurfaceOfInterest object % chartName: na...
c264eab48b945a9c493e11d2a8501263498b41707ed947a0f09732ea50472146
MATLAB
2,984
104
function [M,IND] = combn(V,N) % COMBN - all combinations of elements % M = COMBN(V,N) returns all combinations of N elements of the elements in % vector V. M has the size (length(V).^N)-by-N. % % [M,I] = COMBN(V,N) also returns the index matrix I so that M = V(I). % % V can be an array of numbers, cells or strin...
846d42df9045e6f6b30e25dcb366187f91a0ddc0d0a9e416d7d27951a2a8a908
MATLAB
2,986
97
% makeMIPimages % make MIP movies from 3D images % % ex) % inputFile=dir('4_registration/*_round*_summedNorm_registered.tif') % makeMIPimages(inputFile, 'registration-mip.avi') function makeMIPimages(inputFiles, outputFile) num_input = length(inputFiles); a_z = {}; a_c = {}; a_r = {}; for i =...
cb159297896df2d9a9f8c943e73b6204b3217f113fa10e27fc5fb28bafa75525
MATLAB
2,986
105
function [varargout] = pad(varargin) % PAD adds leading or trailing characters, such as spaces, to the left or % right of an existing string. % % This is a compatibility function that should only be added to the path on % MATLAB versions prior to R2016b. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
a4706811a1f90ae862806c1c59e471b76a49628e3026302dc7058b9176c0e604
MATLAB
2,987
97
% 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 % classdef Sorte...
885057d96cdc16b242687657a3fbbaf8415be8518f34b894476a293b3f4e20dd
MATLAB
2,988
110
function Aout = esoin_dataMunge(experimenter,rig) TIF_LENGTH = 17; raw_dir = uigetdir('','Please select raw data directory'); munge_dir = uigetdir('','Please select target munged directory'); init_string = 'Initializing Munge ... '; munge_string = 'Munging ... '; commence_string = 'Munge Complete '; disp(i...
98a03c0e2889dae5ed50f04edd3f64ddbf3e39e3a02dffd9a696ea395273bdf8
MATLAB
2,989
131
ans = 0.0559 prop prop = 0.0558 0.0653 0.0599 0.0531 0.0563 0.0552 0.0535 0.0486 hist(max(CellR)) max(CellR) ans = 0.9583 0.8293 0.8438 0.7843 0.8333 0.7241 0.8636 0.7368 cell = find(CellR==0.9583) cell = 0×1 empty double column vector CellR2= maxCell...
d9d72669ba4d414ccef9796c0b62110786fc703bd53e07e639273b80e9788732
MATLAB
2,989
98
%% Linear Regression with Polynomial Basis of different degrees % based on code code by Romain Thibaux % (Lecture 2 from http://www.cs.berkeley.edu/~asimma/294-fall06/) %% % This file is from pmtk3.googlecode.com N = 21; %N = 25; [xtrain, ytrain, xtest, ytestNoisefree, ytest] = ... polyDataMake('sampling','th...
90b7b917acd44905b3b9b06350eae91b7db397a8eb4ac40dabb304bfd8a0fdf6
MATLAB
2,994
82
function [x,iflaw]=fmpower(N,k,p1,p2) %FMPOWER Signal with power-law frequency modulation. % [X,IFLAW]=FMPOWER(N,K,P1,P2) generates a signal with a % power-law frequency modulation. % X(t) = exp(j*2*pi(F0*t + C/(1-K)*abs(t).^(1-K))) % % N : number of points in time % K : degree of the power-law (K~=1) % P1 : if the ...
ac6aa4d1f351809f18e86975ea6a9e441e7cb98deadd8d5742e4bdc9c94445af
MATLAB
2,994
77
function Obj=SOFAconvertMIT2SOFA(root,pinna) % OBJ=SOFAconvertMIT2SOFA(root,pinna) loads the MIT HRTFs saved in a % directory ROOT for the PINNA and converts to a SOFA object. % PINNA must be 'normal' or 'large'. % Copyright (C) 2012-2013 Acoustics Research Institute - Austrian Academy of Sciences; % Licensed under t...
41b1137e13b373cf9b6f3cbd0483f69208417aa3e1269c01d5408fe62eff96dc
MATLAB
2,995
123
function [pos, mom, ampl, time] = read_asa_dip(fn) % READ_ASA_DIP reads the dipole position, moment and amplitude % This importer is designed for fixed-dipole models and only supports % a limited number of the options that ASA has. % % Use as % [pos, mom, ampl, time] = read_asa_dip(filename) % % See also READ_ASA_V...
64a6c3e5338e24ea9f5713919166886862f161f7d83a3dacaf52410d872f8034
MATLAB
2,997
127
addpath('../generic/'); addpath(genpath('../az_matlab_files/')); %% ndatasets = 8; names = {'all'}; vlambda = [0.0001,0.001,0.005,0.01,0.02,0.05,0.1]; nlambda = length(vlambda); AUC = nan(ndatasets, length(names),nlambda); PROP_zeros = AUC; clear vB for idataset = 1:ndatasets dt_ms = 25; % 100 % dt_ms ...
dbb857e6ba409a5b7f20963f0c39261fc9f52d5375575cf724a0fc239d96eb7f
MATLAB
2,997
105
function publishDemos(wikiFile) % Publish all of the PMTK3 demos and create the wiki TOC page. % See publishFolder, pmlCodeRefs, pmlChapterPages for settings that might % affect this function. % PMTKneedsMatlab %% % This file is from pmtk3.googlecode.com wikiOnly = true; % set true if you only want to regenerat...
02aa326ad8b26afb4a335b213f3e7378ffc0c8b4bcd92d99072f8b82dc8d97cd
MATLAB
2,998
96
%% function [behplane,data] = axon_prep(data, behplane, plane, track_length, nov_environment, pupil, dark, goodbeh, blebs) %day2 %plane 3 by hand like Losonczy analysis load(data); load(behplane); load('C:\Users\Sheffield_lab\Documents\analysis\NETcre\spline_basis30_int.mat') %determine if any ROIs should be combin...
b46c4c273fab4d71706c2d07dc1f7d16cc78c0ff792c72ad052a5dff1e0d2cca
MATLAB
2,998
75
function [Uout, UoutAll] = fresnel_propagation_multi(Uin, lambda, dx, z, phi, nidx, crop) % [Uout, UoutAll] = fresnel_propagation_multi(Uin, lambda, dx, z, phi, nidx) % % Simulates optical propagation through a medium with phase masks applied % at specified points. The inputs are % % - Uin - incident ...
da264f88118fb544fee2376c5fad0b3dc32eaab89e916617f0170899cc45a23f
MATLAB
2,998
78
function y = medfilt1m( x, r, z ) % One-dimensional adaptive median filtering with missing values. % % Applies a width s=2*r+1 one-dimensional median filter to vector x, which % may contain missing values (elements equal to z). If x contains no % missing values, y(j) is set to the median of x(j-r:j+r). If x contains % ...
8c6bc70ee38e4520cdabc3a018b637c2e9be935f329fb1b0b3b206f522ac57eb
MATLAB
2,999
87
function [ti,fi]=midpoint(t1,f1,t2,f2,k) %MIDPOINT Mid-point construction used in the interference diagram. % [TI,FI]=MIDPOINT(T1,F1,T2,F2,K) gives the coordinates in the % time-frequency plane of the interference-term corresponding to % the points (T1,F1) and (T2,F2), for a distribution in the % affine class perfectl...
3708fe45c784d3ff42c197fc766ed02668c0c004b86c092e93bd4c624b75b08b
MATLAB
3,000
96
function mesh = make_slab(sizevar,surf) % mesh = make_slab(sizevar) % % Creates a 3D slab mesh % % sizevar.width - width % sizevar.height - height % sizevar.depth - depth % sizevar.xc - x center % sizevar.yc - y center % sizevar.zc - z center % sizevar.dist - distance between nodes % surf - optional, if 1 surface me...
540ec79b90cee90b6c0540dfae82e80ff18ec4a58fa493503f91bafe87cbbe84
MATLAB
3,001
85
function [f,nf,fid,hifo] = bag_get_readframe_fcn(bagfname,varargin) topicpat = myparse(varargin,... 'topicpat',[] ... % topic pattern to match in Bag ); % if ~isStringScalar(cam_num) || ~ischar(cam_num) % try % cam_num = num2str(cam_num); % catch % error('Invalid camera number input.') % end % end ...
d89650058094bdea2198ffac7cb8e8bd0d0cf76e6f8eb4ed6d46b5c8810fc12e
MATLAB
3,001
78
function [P, t, normals, cinterp] = meshrefiner(P, t, normals, c, alpha) % This script performs mesh refinement using % barycentric triangle subdivision (1:4) % INPUTS % P - contains nodes of facets to be refined % t - set of facets to be refined % normals - normal vectors of facets to be refine...
67842b147c4a5c80389023130cb042a8d0cd8f74e81b7b6defff6f54e3d9cf27
MATLAB
3,002
147
% 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,...
07b5e168a607ef07f593220fcd41e8a4bc36ce711deafbdd3caa5b7ef6c8da18
MATLAB
3,003
99
% return_m1087_bloodvessel_masks.m % Sarah West % 5/5/22 % Compare artifact removed overlay numbers from: % Y:\Sarah\Analysis\Experiments\... % Random Motorized Treadmill\spatial segmentation\500 SVD components\ % artifacts_removed\1087\sources.mat % to: % Y:\Sarah\Analysis\Experiments\Random Motorized Treadmill\sp...
43ae2d2577bd6fae63d4d23ac09241c88b9b25a4ee932344d52f0151e56d1cd2
MATLAB
3,005
118
% Asia example from %http://sujitpal.blogspot.com/2013/07/bayesian-network-inference-with-r-and.html % This file is from pmtk3.googlecode.com nodeNames = {'A','S','T','L','E','B','X','D'}; N = length(nodeNames); G = zeros(N,N); nodeNums = cell(1,N); for i=1:N nodeNums{nodeNames{i}} = i; end G(nodeNums{'A'}, nod...
5d0f4fbd3ab8d3dc33be91e1a95eaba7209b0375404acf4808a06b84973117c8
MATLAB
3,005
87
% loadParameters; %set a yamlfile variable then run this script. bigparams = bigExpParams(yamlfile); %% Define all relevant parameters and known number of tiles per round % This is the CA1 complete hippocampus acquired on July 9th-July 14th % Numbers are from metadata and examining the raw data folders imgSizeXY = ...
7098d8487bab247105958fb9ed39efde81d730b4ce439fbd814a621110b0727f
MATLAB
3,005
112
function spkDat = SplitAllTmp(spkDat, varargin) Fs = spkDat.Fs; wvFs = Fs * spkDat.upsample; clustList = setdiff(unique(spkDat.id), 0); [wL, nChan, ~] = size(spkDat.waves); pk = spkDat.peakLoc; wP = spkDat.wavePad; wL = wL - 2*wP; win = 1000 * [1 - pk wL - pk] / wvFs; chanList = 1:nChan; subtractMean = true; method = ...
a66dd24ac4335e983f3db3a7d4204076d0aa1c7219d2043fe15402dec8e30a37
MATLAB
3,006
110
function param = roughness_parameters_surface(surf, z) % Gadelmawla et al., 2002 % https://doi.org/10.1016/S0924-0136(02)00060-2 % preparation % finds peaks and valleys based on values only pks_locs = z > prctile(z,95); vls_locs = z < prctile(z,5); % intersection of mean line edg = SurfStatEdg(surf); n0_list = [0 0];...
d673b247cfabbd61d6944487231a17a59723df99929624ee6465eff81ec6fddf
MATLAB
3,007
84
function [R,out,deni] = RTpca(X,nPCA,nit,T) %% Inputs : % X : Input Matrix, each variable is fed into one row and each single % column denotes a single datapoint % nPCA : Number of required PCs to estimate % nit : number of iterations %% Outputs : % R : EigenVectors of each PC, each row is a complete eigenvector. % ou...
ba442d1550927077b17102d4c2798bd2d3c7627ef025bd8a35d028c4be7355f4
MATLAB
3,008
102
function meg_Fig6c_TE_byPrecue_mdlFit_2Hz_pies % function meg_Fig6c_TE_byPrecue_mdlFit_2Hz_pies.m % 2 Hz phase by attention, in fittedP structure %% Load data % Model fit data filename = 'ModelFit_SeparatePrecueT1T2_2Hz_session.mat'; load(filename) % Figure directory [figDir,dateStr,style,colors,p] = meg_manuscript...
a8d442292efb98d04eb0e7c789b88c2f27f89b127a7efb23fa56cde654153cf9
MATLAB
3,009
101
function negloglik = neglogLikBTDR_IncompObs_uneqvar_S_nllonly(pars,Ai,Xzetai,zzi,r,ni,g) % Negative marginal log-likelihood for basis of population regression % model % %[negloglik, grad] = neglogLikBTDR_IncompObs_uneqvar_S_fast(pars,Ai,Ri,zzi,r,ni,g) % %Computes negative log-likelihood under linear Gaussian regressi...
a241104cf5fbb44f3f85e8d59f6154940f876af824808c306f2a6028ae9aad65
MATLAB
3,011
103
%% |rgb2hex| and |hex2rgb| % These functions convert RGB color triplets to hexadecimal format, or % hexadecimal format to RGB color triplets. %% Syntax % % rgb2hex(rgb) % hex2rgb(hex) % hex2rgb(hex,range) %% Description % % |rgb2hex(rgb)| converts RGB color triplets to hexadecimal format. If no % value in the ...
a2fbade7a6899fe913acb120b1ffb03f5c1d84c9acebf735f635188f8df278be
MATLAB
3,011
96
%% 2D Logistic Regression Demo % Based on code by Mark Girolami %% % This file is from pmtk3.googlecode.com setSeed(0); D = loadData('rip'); X = D.rip_dat_tr; Xt = D.rip_dat_te; Ntrain = size(X,1); Ntest = size(Xt,1); ytrain = X(:,3); X(:,3)=[]; ytest = Xt(:,3); Xt(:,3)=[]; Xtrain = X; Xtest = Xt; clear X Xt polyOr...
ae08750c97a84e336cc3d5353eb8ff8ec4b7fa5b1ce86ead0f376fecaf8802e7
MATLAB
3,011
72
function [theta_pvalue,phi_pvalue,reg_id_pvalue,cut_id_pvalue,PPvalue] = ... pvalue_selection_constrained_gene(X,phi,theta,ori_reg_id,extra_reg_num,threshold) % p-value selection by p-value < threshold % theta=pinv(phi'*phi)*phi'*X; % cons=[zeros(1,size(phi,2)-extra_reg_num),0,-1]; options=optimset('LargeSca...
db38df0dacaeed8fcf1915255811e20eb69f0d8f75f12fd17645770ee35e35b1
MATLAB
3,011
32
subjs={ '/m/cs/scratch/networks-pm/pm_denoise/sub-01/sub-01_task-movie_SGdetrend_24HMP-8Phys-Spike_HPF.nii' '/m/cs/scratch/networks-pm/pm_denoise/sub-02/sub-02_task-movie_SGdetrend_24HMP-8Phys-Spike_HPF.nii' '/m/cs/scratch/networks-pm/pm_denoise/sub-03/sub-03_task-movie_SGdetrend_24HMP-8Phys-Spike_HPF.nii' '/m/cs/scrat...
24996e26cfe7ee105bc61c956d2e2a06b733fc1fc641322b01294ddeabe0278b
MATLAB
3,012
100
function [hdr, dat] = read_neurosim_signals(filename) % READ_NEUROSIM_SIGNALS reads the "signals" file that is written by Jan % van der Eerden's NeuroSim software. % % See also FT_READ_HEADER, FT_READ_DATA % Copyright (C) 2012 Robert Oostenveld % % This file is part of FieldTrip, see http://www.fieldtriptoolbox.org %...
522f9a839799ba20ee93ae788523b0a207a69ba424cbe35911d375c327e3537c
MATLAB
3,013
107
clc;clear all;close all; [file path]=uigetfile('*'); [X X1 X2]=xlsread([path file]); inc=0; for i=1:size(X,2) if(length(find(isnan(X(:,i))))<(size(X,1))/2) inc=inc+1; inn(inc)=i; end end data=X(:,inn); tic data1=knnimpute(data); dd= find(strcmp(X1(1,:),'feature_delta_mean_ic50')); nd=find(inn==dd); ic...
cb981a1f058ba1c180f9f6dbfc00b36ac2de486cdc19258201348922d3fbbc81
MATLAB
3,013
86
%{ Copyright (c) 2025 Axion BioSystems, Inc. Contact: support@axion-biosystems.com All Rights Reserved %} classdef Note < Entry %Note Container class for Axis File notes % % Investigator: Text data taken from 'Investigator' field of the Axis % GUI % % Experime...
9e05c8eb76f8f996598ea0c12b1419dae6f9a01d6dd27a2c4e5ed1816adcd16c
MATLAB
3,014
89
%% Reproduce figure 18.4 from "Elements of statistical learning" 2nd ed. % %% % This file is from pmtk3.googlecode.com loadData('srbct'); % Xtrain is 63*2308, Xtest is 25*2308, C=4 Xtest = Xtest(~isnan(ytest), :); ytest = ytest(~isnan(ytest)); fitFn = @(X,y,lam) discrimAnalysisFit(X, y, 'shrunkenCentroids', 'lamb...
59149c748fe27a780c9a9fe8769028fd968ff5755f07a9a43105a9b59c57d8b3
MATLAB
3,015
100
function [hdr, dat] = read_neurosim_signals(filename) % READ_NEUROSIM_SIGNALS reads the "signals" file that is written by Jan % van der Eerden's NeuroSim software. % % See also FT_READ_HEADER, FT_READ_DATA % Copyright (C) 2012 Robert Oostenveld % % This file is part of FieldTrip, see http://www.fieldtriptoolbox.org %...
2cdf374e4f91e63111e45b49f8c22542e719b1e3bf210f878073379b2a45cd83
MATLAB
3,016
87
function result = ft_test_report(varargin) % FT_TEST_REPORT % Copyright (C) 2017, Robert Oostenveld % % This file is part of FieldTrip, see http://www.fieldtriptoolbox.org % for the documentation and details. % % FieldTrip is free software: you can redistribute it and/or modify % it under the terms of the GNU G...
f061eeecf037cab4d665bc8b32823d349035f444ffb411537fd222a850834f0f
MATLAB
3,016
84
%% Comparison of methods for imputing missing values in a gene microarray % PMTKslow % PMTKauthor Kevin Murphy % PMTKneedsStatsToolbox boxplot %% % This file is from pmtk3.googlecode.com function [] = imputationGeneMicroarrayDemo() requireStatsToolbox % yeastStress 6152x174, 5338 fully observed rows (on 15 chosen co...
3f69efe981432ae3a161233da2cf53289a8edbeb0b99a144bf9270c079958896
MATLAB
3,017
105
function arsDemo() %PMTKauthor Daniel Eaton fprintf('running ARS demo\n'); %% example 1 % sample from a 1D gaussian func = inline('log(exp(-x.^2/sigma))','x','sigma'); a = -2; b = 2; % any other a,b st a<0 and b<0 would work too domain = [-inf inf]; nSamples = 20000; sigma = 1; fprintf(sprintf('drawing ...
7aeaa0552a43e0b5f6ce04797117b261aafd05a39128b1bfe208966065e6fdca
MATLAB
3,017
92
function [spec,freqs,A]=parafrep(Rx,N,method,q); % [spec,freqs]=parafrep(Rx,N,method,q) parametric frequency representation % of a signal. % % Rx : correlation matrix of size (p+1)x(p+1) % N : number of frequency bins between 0 and 0.5 % method : can be either 'ar', 'periodogram', 'capon', 'capnorm', 'lagunas'...
3d9eb0738bfb2df6682ca238273c00ea8c1161c96b87557429bb79017307ddc3
MATLAB
3,018
107
function figure_distributionPlot(condition, ... srmr_nr, target_chan, selected_subjects) %% set variables loadpath_ga = getenv('GADIR'); % get condition info [cond_info] = get_conditionInfo(condition, srmr_nr); cond_name = cond_info.cond_name; % load data fname = ['stats_ind_snr_' cond_name '.mat']; load([loadpa...
4cc3e1bc1160a62467875f9448bd612ef3552450c6ebe8b5d67560c2315971e6
MATLAB
3,020
89
% Pairwise interactions on the unit line, Laplace kernel. % % This example computes the interactions between random points on the unit line % via the Laplace kernel. The associated matrix is square, real, and symmetric. % % This demo does the following in order: % % - compress the matrix % - check multiply error/ti...
e6aa6421241d4d0c67e04105d84fa081c52ccea6ab0f2192df884c2e2cd924b4
MATLAB
3,020
98
function [l1,l2,baseval,rotation,width] = estimate_2d_grid(grid_image,grid_size,baseval,rotation,spot_size,prom_sc,base_sc,max_filt_sz) %% input processing if(nargin<8) max_filt_sz = NaN; % parameter for baseline image edge estimate end if(nargin<7 || isnan(base_sc)) base_sc = 0.1; % parameter for b...
ce203b7415f47ba42ff599a1300b967f74619b69e5543b410d71f217a7c0e2f2
MATLAB
3,021
85
function varargout = ft_wizard(wizard_filename) % FT_WIZARD is a graphical user interface to evaluate a FieldTrip analysis % script one step at a time, allowing you to go to the next step if you are % content with the data so far, or to the previous step if you want to repeat it % with different configuration settings...
f16c00101382728318fc37c0c6e1aab32e097e2eb3e73ac8229e9ed0b3167afa
MATLAB
3,021
108
function [slope,intercept,stats]=demingRegression(x,y,intercept0,lambda,null_slope,tail,nfold) % [slope,intercept,stats]=demingRegression(x,y,intercept0,lambda,null_slope,tail,nfold) % Perform deming regression % % [input] % x: input variable 1 % y: input variable 2 % intercept0: if 1 the intercept is to be constrai...
032db6743503db71a0b2ad0576044b77b8d2e39ea9f12475d7d9be93a9cefc02
MATLAB
3,023
101
function createChannelMapFile_Local(basepath) % create a channel map file based on the .xml file. Original script from % kilosort 1 wrapper. Modified to not use channels that user set as 'skip' % in the .xml file. % % Modified by Eliezyer de Oliveira, 02/03/2020 if ~exist('basepath','var') basepath = cd; end d...
617032df7408ce3a25ef626daa2062a6d52c6dade22ea036036e0d0cc80031ba
MATLAB
3,023
97
%% Hierarchical Bayesian Estimation of Some Binomial Proportions % Johnson and Albert p67 %% % This file is from pmtk3.googlecode.com function cancerRatesMh() %% Data % p24 data.y = [0 0 2 0 1 1 0 2 1 3 0 1 1 1 54 0 0 1 3 0]; data.n = [1083 855 3461 657 1208 1025 527 1668 583 582 917 857 ... 680 917 53637...
7db04304e336859b49452b7bcad4250105ab60e1428fe5c0535fb072b257f006
MATLAB
3,024
76
% create_mice_all_no_missing_eyedata.m % Sarah West % 6/22/22 % Load list of missing data load('Y:\Sarah\Analysis\Experiments\Random Motorized Treadmill\behavior\eye\missing_data.mat'); % Load mice_all load('Y:\Sarah\Analysis\Experiments\Random Motorized Treadmill\mice_all.mat'); % Make the list to search through p...
043de02d1692a0c1c38949ec4d0b1b3e33e434d693ce3cbec4e24e4cdf21bd38
MATLAB
3,026
92
function srmr2_data4stats(subjects, conditions, has_allsubj) %% set variables savepath_ga = getenv('GADIR'); srmr_nr = 2; % setup saved variable wide.columns = {'id' 'nerve' 'stimType' 'stimLoc' 'eeg-cca' 'brainstem' 'esg-cca' ... 'plexus-eng' 'eng'}; wide.coding.id = {'subject-id'}; wide.coding.nerve = {'median'...
dbff65d13a12fb2f9b286cf5c81e1e50dbf1c9337148ccb78be9415a1adec00d
MATLAB
3,026
106
function [X, Y, Z, pnt1, tri1, pnt2, tri2] = intersect_plane(pnt, tri, v1, v2, v3) % INTERSECT_PLANE intersection between a triangulated surface and a plane % it returns the coordinates of the vertices which form a contour % % Use as % [X, Y, Z] = intersect_plane(pnt, tri, v1, v2, v3) % % where the intersecting pla...
18b9f14a86b7677c1a0cd092a97eec0f81bfe9609215639def4a4a3b9102bcdc
MATLAB
3,028
81
function [H] = quaternion(q) % QUATERNION returns the homogenous coordinate transformation matrix corresponding to % a coordinate transformation described by 7 quaternion parameters. % % Use as % [H] = quaternion(Q) % where % Q [q0, q1, q2, q3, q4, q5, q6] vector with parameters % H corresponding hom...
437dc7064ccbbdd9d38a015e51096b644e7e354e5b076c2e45f7d7a043eca645
MATLAB
3,029
70
% Check Hotelling test against known data temp = load('Testing/swiss.txt'); x = temp(1:100,:); y = temp(101:200,:); hotell2(x,y) % This will not match exactly, since we use the T2-statistic defined by % Mardia et al. % From http://sites.stat.psu.edu/~ajw13/stat505/fa06/11_2sampHotel/01_2sampHotel.html % ...
bccb07bfef1abe47a62f78fb5cc18cdc3534283c708e117e77c350eee64edc71
MATLAB
3,029
75
function [PartialCorrBrain, Header] = y_PartialCorr_Image(AllVolume, SeedSeries, OutputName, MaskData) % [PartialCorrBrain, Header] = y_PartialCorr_Image(AllVolume, SeedSeries, OutputName, MaskData) % Calculate partial correlation: the partial correlation between a voxel time series and a given column of SeedSeries, wh...
340006400954a4aad1d2e24395ff18fbb203cd340f4c8b8ef260939e75cad50e
MATLAB
3,030
85
function X = fevalMats( fHandle, matCont, prm, srcDir, prefix ) % Used to apply the same operation to all .mat files in given directory. % % For each mat in srcDir, loads the mat file, extracts the variables % denoted by matCont, applies the function fHandle and stores the % result. matCont must be a cell array of str...
91a14993414aea48f9e82ce0b405608092092af185970ff7c0307c0226e5094a
MATLAB
3,031
65
function shuffledCellidxm = shuffleCellidxm(cellidxm, modelParam, network) % shuffledCellidxm = decode.shuffleCellidxm(cellidxm modelParam, network); % % Shuffles rows of the cellidxm matrix following different methods % switch modelParam.decodeCellShuffle case "clusterIndependent" % Shuffle independently...
572ad16ece039177eb5a9284dcdbcbba3d82b6e54241d4917e65cb69f502e108
MATLAB
3,032
102
function M = centeredmatrixfactory(m, n, rows_or_cols) % Linear manifold struct. for optimization over matrices with centered cols % % function M = centeredmatrixfactory(m, n) % function M = centeredmatrixfactory(m, n, 'cols') % function M = centeredmatrixfactory(m, n, 'rows') % % Returns M, a structure for Mano...
8a69fc09828953c649a497e9dec90a86d3d20e1340c1c1cec5c20ae2b78056b5
MATLAB
3,032
130
% Re-select te corners after calibration if ~exist('n_ima')|~exist('fc'), fprintf(1,'No calibration data available.\n'); return; end; check_active_images; flag = 0; for kk = ind_active, if ~exist(['y_' num2str(kk)]), flag = 1; else eval(['ykk = y_' num2str(kk) ';']); if isnan(ykk(1,1)),...
c1d62fdc50a0e7a06c0f5d2d2d5de7783c0edfd8834811b6b01f9367a5f55f08
MATLAB
3,032
85
%% This file should exist in the same folder with 'createCirclesMask.m' and 'fluorescentimagefile.jpg' files close all; clear all; clc; I=imread('fluorescentimagefile.jpg'); I_red=I(:,:,1);I_green_origin=I(:,:,2);I_blue_origin=I(:,:,3); figure(1); imshow(I_blue_origin); %% Defining ROI witht the distance fr...
7d12bda3461915ac56b9e80da9de594bc16698f94858f74988e7ac9bd1306e84
MATLAB
3,034
73
function h_makeBGRoi3(handles) [currentInd, handles, currentStruct, currentStructName] = h_getCurrendInd3(handles); obj = get(handles.imageAxes, 'Children');%unselectAll. set(obj, 'Selected', 'off');%unselectAll. Roi_size = h_getROISize3(currentStruct.state.ROISizeOpt.string); switch currentStruct.state.roiS...
20dc756b3bbfef68ae69a3134d6a37cbba6a35602868d4e0ab2e03dac7f35cf8
MATLAB
3,035
73
function ApparentPositionVector = SOFAcalculateAPV(Obj) %SOFAcalculateAPV % APV = SOFAcalculateAPV(Obj) calculates the apparent position vector % (APV) which represents the position of the source relative to the % listener's position and view. APV is in the format [azi ele radius] % with units [deg deg m]. % ...
4da3308624d29d75fd2716bc0df975da1b2979c6e6b01a7ee774f6fc9ad10fa8
MATLAB
3,035
71
function [EEG , PARAM] = DS_rms(EEG,PARAM) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Envelope of root mean square EEG % % Part of detect_spindles toolbox: % % Authors: Stephane Sockeel, PhD, University of Montreal % Stuart Fogel, PhD, University of Ottawa % Th...
7d069f6bb08317850fe35832cb401a408c0d028141fe2ed89623e11a0e0599f9
MATLAB
3,035
95
% This is a demo script to run EMATA on OPENNEURO dataset: % Gabriel Castrillon and Samira Epp and Antonia Bose and Laura Fraticelli % and André Hechler and Roman Belenya and Andreas Ranft and Igor Yakushev % and Lukas Utz and Lalith Sundar and Josef P Rauschecker % and Christine Preibisch and Katarzyna Kurcyus and...
c4fa8ebb3845f3ad12c4bdc6c76cdeb320ef66519edd958e734e801aa70299e2
MATLAB
3,035
100
function [val] = filetype_check_header(filename, head, offset) % FILETYPE_CHECK_HEADER helper function to determine the file type % by reading the first number of bytes of a file and comparing them % to a known string (c.f. magic number). % Copyright (C) 2003-2006 Robert Oostenveld % % This file is part of FieldTrip,...
642799aaefb4e39c5633217987f7756f23ed309d2f874511033b7ae4ecf50881
MATLAB
3,036
82
classdef dpabi_Gradient_AddImage_Template < matlab.apps.AppBase % This file is a paste-ready template for the Add image logic in App Designer. % Copy the relevant properties and methods into dpabi_Gradient.mlapp. properties (Access = public) UIFigure matlab.ui.Figure AddimageButton matlab.u...
015dec92a4ee72e4bab733bac67a9614b4c5b800ffa5b0d3ed9dd55c3fd5a9b5
MATLAB
3,037
90
% Author: Birgit Nierula (Feb, 2020) % nierula@cbs.mpg.de %% SRMR1: Import data from BIDS folder % This script % 1) imports the median and tibial stimulation blocks from the bids folder % 2) removes the stimulus artifact iv: -1.5 to 1.5 ms % 3) downsamples the signal to 5000 Hz %% Prep srmr_nr = 1; ana_dir = '/data/...
07423d0570b0c23a4ed88d84af7566910d7723b78ef6124c8386ca3cc977d0de
MATLAB
3,037
81
function [H] = quaternion(q) % QUATERNION returns the homogenous coordinate transformation matrix corresponding to % a coordinate transformation described by 7 quaternion parameters. % % Use as % [H] = quaternion(Q) % where % Q [q0, q1, q2, q3, q4, q5, q6] vector with parameters % H corresponding hom...
828adde68caaf73a64197ee2231ff62a5637a16d5e49501f794a115a20b4615b
MATLAB
3,037
61
function parallel_estimate_GLM(stat_path,sots_path,exp_folder,N,TR,model) % ======================================================================== % Ruslan Masharipov, October, 2023 % email: ruslan.s.masharipov@gmail.com % ======================================================================== % Number of *.nii im...
235f9947092658b2ca00e08f3ade95abd809f1b60ede523532502bdeb30b5310
MATLAB
3,040
159
function bar = bar_wait(i,n,ops,texto) % v.0.0.5 % bar = bar_wait(i,n,ops,texto) % ops : ' xxx ' string with the comand % M(100) : modo de 100 % m(f) : tipo flecha % m(c) : tipo centro (default) % pre(tt) : texto previo a la barra % pos(xx) : texto posterior...
d345fc29c3eaceb25959dec40d9eaed5fdafa36225cb081e7e2c2c0db842a050
MATLAB
3,040
102
function [v, f, n, c, stltitle] = stlread(filename, verbose) % This function reads an STL file in binary format into vertex and face % matrices v and f. % % USAGE: [v, f, n, c, stltitle] = stlread(filename, verbose); % % verbose is an optional logical argument for displaying some loading % information (default is fal...
b51dd0aef5eab6853401e91b1843713d987c1ef6a3224865f555a49b3505720a
MATLAB
3,041
73
function [model, loglikHist] = mixModelFit(data, nmix, type, varargin) %% Fit a mixture model via MLE/MAP (using EM) % % By default we lightly regularize the parameters, so we are doing map % estimation. To turn this off, set 'prior' and 'mixPrior to 'none'. See % Inputs below. % %% Inputs % % data - data(i, :) is ...
cfba05dcddc219ccc5bf8cefa59bc454425feaff16cea0369da38ee6c80f14de
MATLAB
3,041
105
function original = mergeconfig(original, default, emptymeaningful) % MERGECONFIG merges the fields of a structure with defaults into an original % configuration structure. The default is only copied in case the field is absent in % the original. % % Use as % output = mergeconfig(original, default) % Copyright (C) ...
d0ae19ad3e1546b36ab41364ee87f5d7df70f4739cf8b25e11b3d640575de71c
MATLAB
3,042
77
%----------------------------------------------------------------------------------------- % Correlation of firing rate of odor-modulated amygdala neurons with reference valence ratings % % Kehl et al. 2024 (DOI:XX) % Single-Neuron Representations of Odors in the Human Brain % Figure 4g % Author: Marcel Kehl % Licen...
f3682f5c47f34aba2e02417ca02ed872e6f21aff9f94d297ad25f90d363edc1d
MATLAB
3,042
69
function PlotGridSegments(grid_locations, grid_tags, segmenter, text_size, axis_handle, rotation) if nargin < 6 rotation = 0; end x_offset = size(grid_locations,2)/2 + 1; y_offset = size(grid_locations,1)/2 + 1; tag_list = {segmenter.Tag}; for i = 1:numel(grid_locations) [gy,gx] ...
63d8dfb0a177262059627995db250bd8c5bbc03cf2d21421c1810e1044c3e89d
MATLAB
3,043
93
%% Dirichlet Distribution Visualization % %% % This file is from pmtk3.googlecode.com function visDirichletGui(arg1) % % % to run, just type visDirichletGui. % %PMTKauthor Jonathan Huang %PMTKurl http://www.cs.cmu.edu/~jch1/research/dirichlet/visDirichletGui.m global MYFIG SIMPLEXHANDLE alpha0 alpha1 alpha2 res ma...
b14351f9e3aa3959262fe951f4bef96b2fd4bf202c08bbdb87bbe9f9ce4d7c7a
MATLAB
3,043
86
function [data, event, blinksmp, saccsmp] = asc2dat(asc) % takes asc data from EyeLink file and converts this into events and % fieldtrip data structure % create event structure for messages evcell = cell(length(asc.msg),1); event = struct('type', evcell, 'sample', evcell, 'value', evcell, 'offset', evcell, 'duration'...
43f3b96d13c6fbba2310b354029c60c51da10fd67b1c3913f94082e3a8396bd9
MATLAB
3,044
92
% FADE-SAME: Figure S5 % clear % close all %%% Step 1: load data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % set results files FADE_file = '../FADE_scores/FADE_SAME_scores_2021_01_11_FADE_only.xls'; % load results files [num, txt, raw] = xlsread(FADE_file); FADE_data = raw(2:end,:); clear num txt % ext...
45339118645ac14584b533aa76ee778842e51be56fe192106bb983c38e7bc154
MATLAB
3,044
83
% Please note that these script consider the parcellation from Joliot and colleagues (2015) and the % network stucture from Di Plinio & Ebisch, 2018 % Joliot, M., Jobard, G., Naveau, M., Delcroix, N., Petit, L., Zago, L., et al. (2015). AICHA: an atlas of intrinsic connectivity of homotopic areas. J. Neurosci. Me...
fdec4fa0e4d30d7a301f29e4ee5d927131eaf52113d9083fc8be7ced2deeaf1c
MATLAB
3,044
115
function mesh = minband_opt(mesh) % mesh = minband_opt(mesh) % % takes an element list and node list and % sorts nodes to give mimimum BW. % % mesh is the mesh variable or filename disp('Optimizing mesh node order...'); if ~(strcmp(mesh.type,'stnd_bem') || strcmp(mesh.type,'fluor_bem') || strcmp(mesh.type,'spec_bem'...
216d1ead7f73875517f3f660a105a259b5dc65c6c10c36a6e4ad0374eba86f06
MATLAB
3,046
86
% Written by Einat Peled % einatspeled@gmail.com % % Input: ImageArray_CorrAmp_norm: array with response images % ImageArray_Labels: array with each image split to response labels. % Output: An image array that shows only the top NumMaxPixels of each % response % For each input image: go over individ...
745e992503c8a2ea9992b1a8b76b3a45e800f03e91c02b2f954209cfbc2d7f6a
MATLAB
3,046
76
projectFileName = ... '/groups/branson/bransonlab/apt/unittest/multitarget_bubble_training_20210523_allGT_AR_MAAPT_grone2_UT_resaved.lbl' ; [labeler, controller] = StartAPT('projfile', projectFileName, 'isInDebugMode', true, 'isInAwsDebugMode', true, 'isInYodaMode', true) ; %% pathFromRegularMovieIndex = labeler.m...
467350ba8bb870631d4af6b61a165d960e3dd6d3102acaf9b100b01a92ee8f09
MATLAB
3,048
77
function [ events, waves ] = wlProc_getEvSegmentsUsingMagDual( ... data, samprate, bpfband, maxglitch, maxdrop, taudc, peakdb, enddb) % function [ events, waves ] = wlProc_getEvSegmentsUsingMagDual( ... % data, samprate, bpfband, maxglitch, maxdrop, taudc, peakdb, enddb) % % This function identifies the locations ...
527f753e98f17d908a72389fba1bf2664b48bd2fee900b40fe82f9c5a8b0cd29
MATLAB
3,048
71
function shuffled_track = parallel_shuffles(shuffle_choice,analysis_type,num_shuffles,decoded_replay_events) %runs run_shuffles on multiple cores in parallel % shuffle_choice- determines what type of shuffles will be performed, entered as a string % % analysis type- vector of 0's and 1's for which replaying % scoring m...
6f3962c06fd12c635130e7bb8458affed077d6f3f5350a6bcb216d6ff474a598
MATLAB
3,048
115
function filter_raw_dat_from_dat(basepath,varargin) % filter_raw_dat: high pass filters raw neuralynx CSC files and writes them % to 'filtered.dat' % % Ryan Harvey 2019 % Modified for probes Laura Berkowitz 2020 % addpath(genpath('D:\Users\BClarkLab\ephys_tools\external_packages\analysis-tools')) % parse input p = inp...
9f7b6007a545f3ce1440f7f2a5406882b61961fadc70081303e07930c56b468d
MATLAB
3,048
87
function plotifl(t,iflaws,signal); %PLOTIFL Plot normalized instantaneous frequency laws. % PLOTIFL(T,IFLAWS,SIGNAL) plot the normalized instantaneous frequency % laws of each signal component. % % T : time instants, % IFLAWS : (M,P)-matrix where each column corresponds to % the instantaneous f...
67dd0e8f47e46d9eeaeb703aacbd36a535012c58c741e06ed9226decd2714365
MATLAB
3,049
107
function [P,W,m,nmax] = ggmLassoHtf(S, lambda, varargin) % Estimate structure of GGM precision matrix using the "GLASSO" method % See Hastie, Tibshirani & Friedman ("Elements" book, 2nd Ed, 2008, p637) % % Solves: P = argmax log(det(P)) - Trace(S*P) - lambda * ||P||_1 % % [P, W, Nouter, MaxInner] = glasso(S, lambda,...
cf5cb51a4f07386a547f8760978016432e169cd5adbd0f9b9cb8535f8d0fe444
MATLAB
3,049
107
%% CENTROID DISTANCES: compute all distances between centroids, look at histogram clear euc_dist all_dist = []; for i=1:length(cent_re) clear euc_dist_small z=1; for j=1:length(cent_re) if(j~=i) euc_dist_small(z) = sqrt((cent_re(i,1)-cent_re(j,1))^2 + (cent_re(i,2)-cent_re(j,2))^2); ...
d6dcbcfb9bd220e2ec63d514f22a4b0386498fa148ba6fa814c58886bb1bac94
MATLAB
3,049
92
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% ft0_create_model.m %%% %%% This script creates a volume conduction model for the selected %%% %%% conductivity set. %%% %%%%%%%%%%%%%%%%...
4b431bf52975da9d4ddfb8728bd7e5715589465847e3146d8907143721bba704
MATLAB
3,050
38
function [decoded_replay_events2, bayesian_bias]=renormalize_decoded_replay(decoded_replay_events,tracks_to_compare) if ~isempty(tracks_to_compare) for track_pair = 1:length(tracks_to_compare) for i=1:length(decoded_replay_events(1).replay_events) rescaling_matrix=sum(decoded_replay_ev...
6a1444f70b2e98bda8abe193bd31c6dc5bc52b22c6596be3af668977e3adfa3d
MATLAB
3,050
84
% Noam Saadon-Grosman % August 2020 % This code creates selectivity surface map from the output of "Selectivity_computation" %%% input: some files are in BrainVoyager format, for matrices extracted from %%% other formats exclude the xff command. Fill in names and directories % Template BrainVoyager map % Somatose...
fd44d3bedd0462f63a9c1b2f1bc63d72fb0c1ff6d801f5fa7ebf4e24df656e62
MATLAB
3,050
108
function hhh=vline(x,in1,in2) % function h=vline(x, linetype, label) % % Draws a vertical line on the current axes at the location specified by 'x'. Optional arguments are % 'linetype' (default is 'r:') and 'label', which applies a text label to the graph near the line. The % label appears in the same color as ...
5a2bf4b90211912dd8de82f896ab42a75322b3d10cc70cbf86067c02ec0402df
MATLAB
3,053
107
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...
25349fee67c74c36e7d345987c0454b7c66ea21fc81d7698f7a62bc83b59015d
MATLAB
3,054
98
function prepare_roidata(rootPath) % % This script was written for preparing preprocessed MRI data for cowen & % keltner movie clip presentation data, which were pre-processed by the fmriprep. % The data was devided into individual ROIs. % % % call prepare_roidata_individual.m % called from emotion2020_analysis_BA...
4f8e4557a0173827fbe8662254000dd65f723a019d8ebc0890295f31083610c7
MATLAB
3,054
81
function [options,dim] = getOptions4dcm(A,B,C,D,TR,microDT,n_t,homogeneous,reduced_f,lin) % builds the options structure from basic DCM info % % function [options,dim] = getOptions4dcm(A,B,C,D,TR,microDT,n_t,homogeneous) % IN: % - A: binary matrix indicating where the connections are % - B: cell-array of binary mat...
0e88ddc9d15b0c7810ba6fde94ea03040ed63bdb4a306b20e906982171228706
MATLAB
3,055
117
function A = import_data(fname) %IMPORT_DATA Import tensor-related data to a file. % % A = IMPORT_DATA(FNAME) imports an object A from the file named FNAME. % The supported data types and formatting of the file are explained in % EXPORT_DATA. % % See also TENSOR, EXPORT_DATA % %MATLAB Tensor Toolbox. %Copyrigh...
a5e3ba82c75d07102b2723ebb483b5a6065bf64989ae97317c71713197ce9909
MATLAB
3,055
129
%% Interpolate some data using a joint Gaussian % Based on p140 of "Introduction to Bayesian scientific computation" % by Calvetti and Somersalo % See also https://users.oden.utexas.edu/~tanbui/PublishedPapers/BayesianTutorial.pdf setSeed(1); D = 150; Nobs = 10; xs = linspace(0, 1, D); perm = randperm(D); obsNdx = p...
b3966db44cb7346d32febb9ae071691cff705163d0e5dde71accf80e1f2eec31
MATLAB
3,056
99
clear all close all clc %% Setup % Set parameters num_nodes = 214; % number of time series, also, number of ROIs` wkDir = '/home/mri/MDD_kangning_projects/MDD_symptom_specific/inputs/timeseries_Power_typical/'; signal_file = '_timeseries_power264.csv'; % input the postfix of the file name outdir ...