sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
2a9ee2aeaf615bdfab6b848f5ff58c328002653d6b26c0e6fbf205add89185b5
MATLAB
1,318
35
% This function creates a new file with one of each channel type and then fills each channel with random data. clear; % add path to CED code cedpath = 'C:\Users\james\Documents\MATLAB\CEDMATLAB'; addpath(cedpath); % load ceds64int.dll CEDS64LoadLib( cedpath ); fhand = CEDS64Create( 'C:\Spike7\PrevNTest.smrx', 32, 2 );...
ab795801ca50fa03201efab4c1c5bd03de600950e2cdf0add7cbd49bc8845dc8
MATLAB
1,318
43
function results = vl_test_sift(varargin) % VL_TEST_SIFT vl_test_init ; function s = setup() s.I = im2single(imread(fullfile(vl_root,'data','box.pgm'))) ; [s.ubc.f, s.ubc.d] = ... vl_ubcread(fullfile(vl_root,'data','box.sift')) ; function test_ubc_descriptor(s) err = [] ; [f, d] = vl_sift(s.I,... ...
64a307505109eae34f0318393bd6509d18d617b5d427a6eb5f3d7bf734beaf2f
MATLAB
1,319
44
% Author: Zachary Chiang, Buenrostro Lab, Harvard University % Uses cross correlation to register one stack to another in x and y function[stackBr] = simple_offset(stackA, stackB) stackBr = stackB; % calculate correlation prior to registration max_corr = corr(stackA(:),stackB(:)); pre_co...
e257c1392352ec7db15156eb64fc3258d6bbacd085c96f175f631a5345bd0dfc
MATLAB
1,320
45
function Evaluation_AxDKI_RBC_Paper path_of_script = fileparts(mfilename('fullpath')); addpath(genpath([path_of_script filesep 'Functions'])); number_of_noise_realizations = 2500; % simulated_SNRs = [1/sqrt(2):(1/sqrt(2)):200/sqrt(2)]; %SNR divided by sqrt(2), L=number of coils = 2 simulated_SNRs = [1:1:200]; AxTM =...
169727c64eef9272dab61590b9d6c41e27982b1231331739a7c87122c7f5991f
MATLAB
1,321
74
% % Compute the 'prefatt' statistic (preferential attachment exponent), % by reading the 'dat/pa.%.mat' files. % % We only compute this for temporal networks, even though % non-temporal networks also have a SPLIT, but since that split is % random, it wouldn't be interesting. % % PARAMETERS % $network % % INPUT FILES...
cda6cc815cb3d28b64dc6ac6a45c719721d3854ce681dad2bd66194155952417
MATLAB
1,321
46
function d = fastEuclideanDistance(a,b) % DISTANCE - computes Euclidean distance matrix % % E = 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 the % E...
0aa52fca56c2e264fd73206563d01f6980235029b53bef272f6522ac4c965b2f
MATLAB
1,323
49
% fig1_no_oscil_ex.m % generates figure 1 using stored values used for manuscript %% clear all; close all; clc; %% addpath if not added yet % assumes script run within local directory scriptdirs = {'../../plot';'../../helper_functions'}; addpath(scriptdirs{:}) datadir = pwd; datafile = 'fig1_no_oscil_ex_data.mat'; dat...
6660805af47766a8de0cf549fd2acc03c82f7b156d6cf223ae2a29c7c4fa0a65
MATLAB
1,324
28
function [TagUnitNames] = taggedUnits( Session ) %returnd the names of tagged units % Detailed explanation goes here switch Session, case 'POm36', TagUnitNames=[7,1;7,2;7,3;11,3;15,2]; case 'POm31', TagUnitNames =[6,2;14,2;16,1]; case 'VPM25', TagUnitNames =[1,1;1,2;2,3;3,2;4,2;5,1;6,3;7,1;7,2;7,3...
991df0aee99856b1fce4d50ce5654b024cda000ae3c504ee90a191cbcddcd5f0
MATLAB
1,324
40
[outcomes] = get_pop_sparseness_before(ds_events,2,30,0) %% [ds_unit_angles,ds_within_angles,unit_angles,within_angles] = get_vector_angles(outcomes,ds_events); %% figure(91) utils.set_figure(20) hold on bar([1,2,3],[mean(ds_unit_angles(1,:),'omitnan'),mean(ds_unit_angles(3,:),'omitnan'),mean(ds_unit_angles(2,:),...
e0b722da88925a0521ddd40839cc049d2dc41e043e85c1dc283a7d2bc71f09e8
MATLAB
1,324
47
function [bestMap, bestCombination, metricValue] = best_flip_combinations_correlation(maps) numTrials = size(maps,3); flipCombinations = flip_combinations(numTrials); numCombinations = size(flipCombinations,1); flipMetric = nan(numCombinations,1); flippedMap = nan(size(maps,1), size(maps,2), ...
5a5d95d682ae883adc7ec5577f31c19c26c2a2e2a1df1936c3ac6eb890a7dbfa
MATLAB
1,326
34
clear %load F1s.mat filenames = {'blood_vessel_10Hz_part11','blood_vessel_10Hz_part12','blood_vessel_10Hz_part21','blood_vessel_10Hz_part22'}; radii = [3:7]; SNRs = [7:4:23]; dataset = zeros(length(filenames),length(radii),length(SNRs)); parfor n = 1:(length(filenames)*length(radii)*length(SNRs)) [p,q,r] = ind2sub([l...
93e16fbf8f6bd18b5564dc16644248fed41dd2b822ac45e6c8afb8c1b98edd4f
MATLAB
1,327
38
%{ Copyright (C) Cambridge Electronic Design Limited 2014 Author: James Thompson Web: www.ced.co.uk email: james@ced.co.uk, softhelp@ced.co.uk This file is part of CEDS64ML, a MATLAB interface to the SON64 library. CEDS64ML is free software: you can redistribute it and/or modify it under the t...
b628bb707f6f1abb971af3bbf9f59ad2906f8682c1757b2d522e0d3078e52728
MATLAB
1,327
60
clear; close all; clc; initime = clock; addpath('funcs'); Delta_e = 0.4; % 0.3 Delta_i = 0.04; % 0.04 Iattn = 0.02; time = 4000; [r,v,~] = once(Delta_e, Delta_i, Iattn, time); sig = r(5,100001:end,1); sig = sig'; %% xt sigMean = mean(sig); xi_xMean = sig - sigMean; xt = zeros(length(sig),1); xt(1) = xi_xMean(1); f...
557e887fe49b63e632ca516328abcc02fe54b33cde081a4675c72badd31db6b4
MATLAB
1,329
36
function expt = addTrial(expt, trial, kTrial) expt.trial(kTrial).duration = trial.duration; varnames = fieldnames(expt.type); for kVar = 1:numel(varnames) vname = varnames{kVar}; if ~isfield(trial, vname) error('Variable [%s] is missing', vname); end switch expt.type.(vname) case ...
a1645c3081e3d02f2b39fab23d03bc0db6691340012dfee06b0a151ace087047
MATLAB
1,329
45
function handle = ternary_axes_titles( handle, varargin ) %ternary_axes_names plot axes titles % % % Check if handle is given if (nargin==0) error('Too few inputs') end % Create defaul settings if no extra arguments supplied if ( nargin < 2 || isempty( varargin ) ) varargin = { ...
a36dadc7773f2087d636cb23aa6a7d44c58a6916ba432565951720988507c79b
MATLAB
1,329
56
function output = relu(input, varargin) % Function to apply linear rectifier, which removes negative numbers and % can scale max height of response % % output = relu(input, varargin) % % INPUT: % input : (vector or matrix) pRF time series (time points by pRFs) % [slope] : slope of RELU function, if empty, ...
1171e73c219ca56a60143963602dce3a40e03cdc346e912c25d2efd49f7155d0
MATLAB
1,330
38
function handles = validate_path_wb_command(handles) local_wb_command_path_file=which('local_wb_command_path.mat'); if isfile(local_wb_command_path_file) load(local_wb_command_path_file) handles.paths.wb_command=local_wb_command_path; end try local_wb_command_exist=isfile(handles.paths.wb_command); catch ...
2764bd134900ce1edc30e2703d1a716a2a817c29234b7914bb541ff7624fc48b
MATLAB
1,331
48
% mglSetSound.m % % $Id:$ % usage: mglSetSound(s,'propertyName',propertyValue) % by: justin gardner % date: 08/10/15 % purpose: Set properties of a soundID that has been created with mglInstallSound % % t = 0:2*pi/8191:2*pi; % waveform = sin(440*t); % ...
ab6b55fb8b15771122a0905437b46f8be0273b9d1c7635fd55cd772a22570218
MATLAB
1,331
66
function [ax] = plotExpToISI(rpInfo,HLix,priColors,figprefs) %plotExpToISI.m 7/11/22 if isempty(priColors) priColors = containers.Map(); priColors('HL') = 'k'; priColors('bars') = [0.6 0.6 0.6]; end isiLags = rpInfo.isiLags; isiPDF = rpInfo.isiPDF; tickdir = 'out'; dobox = 'off'; dogrid = false; doleg = ...
1ba26be6407f66fc11b7566ba16e896f453671236b85d7ac60185b6095161376
MATLAB
1,332
46
function results = vl_test_gmm(varargin) % VL_TEST_GMM % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. % All rights reserved. % % This file is part of the VLFeat library and is made available under % the terms of the BSD license (see the COPYING file). vl_test_init ; end function s = setup() randn('st...
55232b526ee80ab6ab8030d309f483994e9ecebcf1bf8ec7bfc277333ec4673e
MATLAB
1,332
43
% this script create a 3-D scatter plot showing different pattern of the % dynamics, including ON-ON, OFF-ON, OFF-OFF and ON-OFF % 3 dimensions are: DeltaE (x), DeltaI (y), and Isens(z) rootFolder = "figure_40_diff/"; % ON-ON data = readFilename(rootFolder+"asAllCriteria/*_*_*_*.png",'%f_%f_%f_%f'); data( all(~data,2),...
64fa32059b71120d2a4ce27706fac52e4e07f377a9b90245283f053c91c49470
MATLAB
1,332
56
function res = voc_eval(path, comp_id, test_set, output_dir) VOCopts = get_voc_opts(path); VOCopts.testset = test_set; for i = 1:length(VOCopts.classes) cls = VOCopts.classes{i}; res(i) = voc_eval_cls(cls, VOCopts, comp_id, output_dir); end fprintf('\n~~~~~~~~~~~~~~~~~~~~\n'); fprintf('Results:\n'); aps = [res(:...
7f674b015c96bc99fe106cb994eb94696e6897ffaeb4baf15d4e1201b1c061de
MATLAB
1,332
37
%{ Copyright (C) Cambridge Electronic Design Limited 2014 Author: James Thompson Web: www.ced.co.uk email: james@ced.co.uk, softhelp@ced.co.uk This file is part of CEDS64ML, a MATLAB interface to the SON64 library. CEDS64ML is free software: you can redistribute it and/or modify it under the t...
d3245dc9bd33aaf7f1b95eced3bf2e9e719d60059dbcf622c7f7d47c50b1f9e3
MATLAB
1,332
37
%{ Copyright (C) Cambridge Electronic Design Limited 2014 Author: James Thompson Web: www.ced.co.uk email: james@ced.co.uk, softhelp@ced.co.uk This file is part of CEDS64ML, a MATLAB interface to the SON64 library. CEDS64ML is free software: you can redistribute it and/or modify it under the t...
11a3aaa3fa8caa714cce76923fcace8b9a6cade3b793716bbfbe6b6ecf6e3cdd
MATLAB
1,333
35
function [data] = ml_singleunits_load_nlx_mclust( nvtFilename, tfileFolder ) % This function loads all of the t-files in the given folder, and uses % the neuralynx nvt file in order to determine the bits of the tfiles % so that they are loaded correctly. [nlxNvtTimeStamps_mus, ~, ~, ~, ~, ~, ~] = ml_nlx...
83f6fcde18ee6431d5a134ee38c93d5065e3d9d9dcb7aca107f1792004af53a0
MATLAB
1,333
39
% VL_DEMO_MSER_CMD Demo: MSER: test command line utility pfx = fullfile(vl_root,'results') ; if ~ exist(pfx, 'dir') mkdir(pfx) ; end p_img = fullfile(vl_root,'data','spots.jpg') ; p_pgm = fullfile(pfx,'spots.pgm') ; p_sed = fullfile(pfx,'spots.mser') ; p_frm = fullfile(pfx,'spots.frame') ; p_tmp = fullfile(pfx,'spo...
c4feaec0600ca26017f6dc1ad7f630ae9c17505dbd87bc0515fd7dda41bf7333
MATLAB
1,333
32
function mltp_plot_best_match_rotations_rect_per_session(obj) bfo_dist = []; sessionNames = {}; for iSession = 1:obj.Experiment.getNumSessions() session = obj.Experiment.getSession(iSession); tmp = load(fullfile(session.getAnalysisDirectory(), 'best_match_rotations', 'best_match_rotations.m...
57f5858c49490ef2d9b1081e219e0f3325c25cb743677cfef1b71e5a5775b154
MATLAB
1,334
45
function [matrices, n_nodes, personList, filenames, uniqueStrings, numFiles] = load_matrices(directory,pattern,varargin) % Load the matrices given the pattern that represents the groups % Get a list of CSV files in the directory fileList = dir(fullfile(directory, "*-"+pattern+"*.csv")); % Initialize the 3D matrix and...
91fa0e02e6e26f90daecd19b467c728c9d2f1cda6254efcde2b325cbcdd820e0
MATLAB
1,334
41
function p = tp(t,v); %TCDF Student's T cumulative distribution function (cdf). % P = TCDF(X,V) computes the cdf for Student's T distribution % with V degrees of freedom, at the values in X. V must be a % scalar or have the same size as T. % % This is an alternative to the TCDF function that is implemented %...
3a5c3f89013565575d1fc9c5ad1b3a7dd31b61a48f0415dbece441de4f53f383
MATLAB
1,335
40
function J = getJaccard(A,B) % % call: % % J = getJaccard(A,B) % % Compute the Jaccard Index, a measure of similarity between two binary (0,1) vector-sets A, B. % E.g. to compute the Jaccard Index between two network community partitions, first assign each % link to the corresponding community (e.g. using ...
1702900374a95c464a227fc9ad6e508ce28a90a8986e1881c39a2736002219f7
MATLAB
1,336
48
function b0 = spm_load_priors(B) % Loads the tissue probability maps for segmentation % FORMAT b0 = spm_load_priors(B) % B - structures of image volume information (or filenames) % b0 - a cell array of tissue probabilities %____________________________________________________________________________ % Copyright (C) 20...
2a7091418fd1b9f9d2c87abd970016bae7f2c821b6c61f4dd5643429b69fb861
MATLAB
1,336
54
%% Open File clear;clc; dbstop if error smrFile = 'G:\My Drive\Expmt Data\2019_07 - Alex Bonsai+Spike2 Sync Test Files\08301\data08301.smr'; %% Step 1 Allign Data % Read Bonsai csv Files dataTable = readtable('G:\My Drive\Expmt Data\2019_07 - Alex Bonsai+Spike2 Sync Test Files\08301\data08301original.csv'); % Extrac...
6871dd20cf34213de13e12b4f7dc7bf550a564cb25049006db830969afed24fe
MATLAB
1,336
53
function [] = plotSingleChannel(probein, srcIDin, detIDin, linestylein, colorin) %PLOTSINGLECHANNEL Summary of this function goes here % Given a probe, srcID, and detID, this functions draws a line between % optodes. Used for MOBI visualization to update individual channels %'Color',[.6 0 0] %'LineStyle' switch n...
10d35220bbef1f9de6835fc551800f769d4fec4dae0f2d6f9af0eda1e1c70174
MATLAB
1,337
55
function [HDR]=fefopen(arg1) % FEFOPEN opens and reads FEF file % % HDR=fefopen(HDR) % % % see also: SOPEN % % References: % <A HREF="ftp://sigftp.cs.tut.fi/pub/eeg-data/standards/cenf060.zip ">About CEN/TC251</A> % $Id: fefopen.m 8776 2013-11-14 09:04:48Z roboos $ % Copyright (c) 1998,2004,2008 Alois Schlo...
a78287ae2aa13e3feb6b3f165293a15e4377895786b1070864e6a6afae146880
MATLAB
1,337
63
% script for quick plots of average leg steps, FicTrac, opto data datPath = '/Users/hyang/Dropbox (HMS)/OptoBehaviorAnalysis-Helen/AnalyzedData/220802_LegStepsFictracOpto_1Fly'; % unilateral datNames = {'220415_fly01','220417_fly01','220419_fly01','220428_fly01',... '220517_fly02'}; legInd = [4 5 6 1 2 3; 4 5 6 1...
016019aceda753f96ee0bdd3a90812374cbcf75fbb29276e98f70773d5b3fa50
MATLAB
1,338
25
function Ftavg = wdmSignalscale(wdm_params,psf_params, vol_params) % modified for 1p version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% nidx = double(wdm_params.nidx); % refractive index [] nac = double(wdm_params.nac); ...
2a578717b770da1322a9ac6d3cf0ac8dffa40a115bcc83ae228c53bdc3bd3b81
MATLAB
1,338
39
%% runme_simSeqPRF % Add toolboxes: tbUse({'Psychtoolbox-3', 'simseqPRF'}) % at the scanner: % set trigger box to these options (per JG): % change modes / manual configure / HHSC 1X5D / USB / HID NAR NO5 subject = 'test'; uniqueRuns = 2; totalRuns = 2; versionNr = 5; % each subject has its own ...
08e62cec54581804162e1752fc4a3ed0f4fee9c386c25297a5ddb14201434ca4
MATLAB
1,339
52
function trajfns = fix_GetTrajFields(trx) nflies = numel(trx); fns = fieldnames(trx); nottrajfns = {'timestamps','x_mm','y_mm','theta_mm','a_mm','b_mm','xpred','ypred','thetapred','dx','dy','v','wing_lengthl_mm','wing_lengthr_mm'}; istrajfn = false(1,numel(fns)); idxreal = false(1,nflies); for fly = 1:nflies, idxrea...
9f165451be80f2b572e409d25fc160d30b2965fbeb42dcd18753d070a66b7643
MATLAB
1,339
39
function results = vl_test_binsearch(varargin) % VL_TEST_BINSEARCH vl_test_init ; function test_inf_bins() x = [-inf -1 0 1 +inf] ; vl_assert_equal(vl_binsearch([], x), [0 0 0 0 0]) ; vl_assert_equal(vl_binsearch([-inf 0], x), [1 1 2 2 2]) ; vl_assert_equal(vl_binsearch([-inf], x), [1 1 1 1 1]) ; vl_a...
00ecf44bd99765d3954be79a6a2ae15bfec79a04869452c464a676eebe937574
MATLAB
1,340
33
clear %load F1s.mat filenames = {'c25_59_228','c25_123_348','c25_163_267','c27_12_326','c27_114_176','c27_122_121','c28_83_210','c28_161_149','c28_163_244'}; radii = [3:8]; SNRs = [7:4:23]; dataset = zeros(length(filenames),length(radii),length(SNRs)); parfor n = 1:(length(filenames)*length(radii)*length(SNRs)) [p,q,r...
1325dd6000f8c4b6eb10f3ee8ef03cf6959fd93f7c13250de87d321fad4cd487
MATLAB
1,341
31
%IM2COLSTEP Rearrange matrix blocks into columns. % B = IM2COLSTEP(A,[N1 N2]) converts each sliding N1-by-N2 block of the % 2-D matrix A into a column of B, with no zero padding. B has N1*N2 rows % and will contain as many columns as there are N1-by-N2 neighborhoods in % A. Each column of B contains a neighborhood ...
3c753ad0d0c72e3534e2048022920c9819b0a7d5446fbb7c01c209caf2b11ff5
MATLAB
1,342
43
function baseName=directoryBaseName(parameterFile) % Get directory base name (i.e. the common stem of each section directory) from the acquisition parameter file % % function baseName=directoryBaseName(parameterFile) % % % Purpose % Data from each section are stored in a different directory. We need to know the % name...
28dc1ed4069de39257f8c2e71884ed0825000ceafeaed7d3fefa855b6938c0e2
MATLAB
1,343
33
% This file is part of WAFO. % % WAFO 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 3 of the License, or % (at your option) any later version. % % WAFO is distributed in the hope that i...
5a1a65d1831365b4673e8132acd18d9ef18015772284c77326981c38883c43ac
MATLAB
1,343
41
function handles = UpdateFlyPathVisible(handles) % makes fly path visible or invisible % splintered from fixerrorsgui 6/21/12 JAB %%%% this code should probably be merged into fix_FixUpdateFly, since they're *almost* %%%% always called together and contain some duplicated logic % example glitch caused by this incomple...
7e402f89e1fdc3d8f222907756832634da40a6676734da970de35fdde8aff4ee
MATLAB
1,343
49
function [CIJ,K] = makefractalCIJ(mx_lvl,E,sz_cl) %MAKEFRACTALCIJ Synthetic hierarchical modular network % % [CIJ,K] = makefractalCIJ(mx_lvl,E,sz_cl); % % This function generates a directed network with a hierarchical modular % organization. All modules are fully connected and connection density % decays ...
4c4069978c661f6ef45c304b1217eb634ed60e49a0a6d9590df47a9fa815b009
MATLAB
1,344
41
function nii_deface_TRACE %dirs = dirVisible('/Users/chris/SOOP/bids/sub-*'); %dirs = dirVisible('/Volumes/SOOP/soup/sub-*'); dirs = dirVisible('/Users/chris/SOOP/sooper/sub-*'); for i = 1 : length(dirs) folder = fullfile(dirs(i).folder, dirs(i).name, 'anat'); traces = dirVisible(fullfile(folder, '*_TRACE.nii')...
b4162bb461105f4e57cd80fbda27b076b4cb4cde9f74db3597bab9fa6666da05
MATLAB
1,345
58
function qDemo % a demo how to rotate a point around an arbitrary axis by using % quaternions % REMARK: % 1) enless loop, hit CTRL+C to break % % VERSION: 05.03.2011 % point to be rotated P = [ 0.1, 0.4, 0.4 ]; % vector around which the rotation will be performed u = [ 0.5, 0.5, 0.5 ]; % for camera p...
07776f8d39282e052ed2b228260c9f9102ee82d15832c74027059dd275d60d6e
MATLAB
1,346
56
%% Find Correct files clear;clc;close all; currentDirectory = cd; allFiles = dir([currentDirectory, '\**\**']); %% relevantFiles = allFiles(~[allFiles.isdir]); relevantFiles = relevantFiles(contains({relevantFiles.name}, {'.'})); %relevantFiles = relevantFiles(contains({relevantFiles.name}, {'cs'})); %% for i = 1:l...
084d16b8fc318657743fd7beaa48de13e84a500a5a7e18edce79b9fae25de6f9
MATLAB
1,346
34
function ret=SONSetTextMarkChan(fh, chan, sPhyCh, bufsize,... comment, chantitle, rate, units, points) % SONSETTEXTMARKCHAN creates a TEXTMARK channel % FH = SON file handle % CHAN = the channel number for the new channel % SPHYCH = the physical channel ...
33e20aff3219f88416dd8f3aa54e4733d48859ae9b9a227853420a7106c77f00
MATLAB
1,346
56
function [mapMean, mapStd] = ml_bs_meanstd_xy(bs, x, y, v) if size(x,1) ~= 1 && size(x,2) ~= 1 error('Invalid size of x. Should be 1xN.'); end if size(y,1) ~= 1 && size(y,2) ~= 1 error('Invalid size of y. Should be 1xN'); end if size(v,1) ~= 1 && size(v,2) ~= 1 ...
ddb4560c563e8d66c6341ed30a873c9c33675482f87491eccd25c796665af121
MATLAB
1,346
47
function success = calculate_embeddings(folder_name) % Given the spectrogram, calculate the embedding for every time point addpath(genpath(pwd)) %set up parameters parameters = load_parameters(folder_name); if parameters.TrackOnly success = true; return end load('re...
5a439b6e27397a0007f2303fbd942aa805528773ec9d6f0f381810bff250123a
MATLAB
1,347
41
% This script loads mesh data into the MATLAB workspace. The data include % surface meshes and the potential integrals. It also computes useful % sparse matrices for GMRES speed up % % Copyright SNM/WAW 2017-2020 %% Add path (Windows/Linux commands are different) s = pwd; if(~isunix) slash = '\...
8144ba6b4b32f077ad6d5d7f29ff553d5fa426ec4abaa9282afe84203dfc0965
MATLAB
1,347
57
function [videoFrames] = ml_limelight_read_video(fn) % This function read a limelight video file ("llii" extension). if isempty(fn) error('Filename is empty'); end if ~isfile(fn) error('The file does not exist (%s)\n', fn); end fileId = fopen(fn); if fileId == -1 ...
af95565218d58ca8508742e60375460d92bba173d4b2f21e6a566c541ef0bd83
MATLAB
1,347
61
% % Plot a distribution in Beta style. % % PARAMETERS % values (n*1) Values; must all be larger than zero % color (optional) Color of the line % function beta_plot(values, color) if ~exist('color', 'var') color = [0 0 1]; end font_size = 24; [counts ids] = sort(values); maxcount = counts(end); freq = ...
2d099e336fe9bc4f4f94716434731b5ca78c8d0668f49c546ceb114955c494b7
MATLAB
1,348
27
function copy_result(path_of_script,fit_methods,inx_voxel,voxel_folder,index_snr,simulated_SNRs) folder_1 = 'AxDKI'; folder_2 = 'standardDKI'; folder_3 = 'standardDKI_RBC'; folder_4 = 'AxDKI_RBC'; directory_destination = [path_of_script filesep 'Results_And_Figures' filesep 'Fit_Results' filesep...
65ae51d58d3f21a4b88954586a4b36aad7342f9924cfa9cf16e2c6628734d67e
MATLAB
1,348
57
function [entropy, p_i] = presence_entropy(data, base) %Degree Structure (Presence) Entropy % Calculates entropy based on the network's strength distribution. Exact % formulation from Wen & Jiang (2019), refferencing Wang et al., 2006. % Input: % data: a Time X StateStrength matrix OR a vector of State Stre...
721833817c6d856e166653991b8a646cb49a5de05421f5062ea02cba174d992c
MATLAB
1,348
53
function[out,h]=SONADCToSingle(in,header) % SONADCTOSINGLE scales a SON ADC channel to single precision floating point % % [OUT {, HEADER}]=SONADCTODOUBLE(IN {, HEADER}) % % Applies the scale and offset supplied in HEADER to the data contained in % IN. These values are derived form the channel header on disc. % ...
021bc5b1515880fbd4598e9dbcc100ca162c7e19e8ff7d6268ddeee7cf4de161
MATLAB
1,350
52
% mglTestCoords: an automated and/or interactive test for rendering. % % usage: mglTestCoords(isInteractive) % by: Benjamin Heasly % date: 03/10/2022 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Test changing the coordinate transform within a frame. % ...
0c637aaffa4cbfb7bf483cde620ef230b440746eb275ca02f14d0567f55af7c9
MATLAB
1,350
54
function[combination_results]=try_combinations(combos,intensities) %% CREATE VARIABLES identities=cell(length(combos),1); all_centroids=cell(length(combos),1); sumds=cell(length(combos),1); all_silhouettes=cell(length(combos),1); mean_silhouettes=nan(length(combos),1); centroids= cell(length(combos),1); %% RUN...
3bfd404dfa4f1d00b100a86166c7753e45989615c236931c5844a666f38a5e73
MATLAB
1,351
48
function [] = ExtDataFig07_AveSong() % Code for plotting the population averaged ΔF/F for pulse and sine song around song-type in Extended Data Fig. 7c,e,h,j. %% parameters % GT = 'fruD'; % Extended Data Fig. 7c % GT = 'fru'; % Extended Data Fig. 7e GT = 'nsybDnonfru'; % Extended Data Fig. 7h % GT = 'nsybnonfru'; % Ex...
061c8408cc0e1673b0b95b9da678567ba9a353e8aafdcb279463f73c76be0170
MATLAB
1,352
50
function c = DynECNNInvProbV1Cons(x,Imat_t,dsr_t,tn,ni,nh,no,msteam_t,mfg_t,Tsteam_in_t,Tfg_in_t,cpfg_t,cpsteam_t,delta,data,t_steady) whd = reshape(x(1:ni*nh),[ni,nh]); wod = reshape(x(ni*nh+1:ni*nh+nh*no),[nh,no]); wfd = reshape(x(ni*nh+nh*no+1:ni*nh+nh*no+no*nh),[no,nh]); bhd = (x(ni*nh+nh*no+no*nh+1:ni*nh+nh*...
92f9512acd1a885d48d8d9adb9e2285e6b8dc1afa9d0952704df51d168daafd8
MATLAB
1,352
41
function [el, ibibin, ibiwin, ylim, fs, cancelFlag]= uigetIBIinfo(single,list) % % by Michela Chiappalone (26 Maggio 2006) % modified by Noriaki cancelFlag = 0; fs = []; ibibin = []; ibiwin = []; ylim = []; el = []; PopupTitle = 'Inter Burst Interval - IBI Histogram)'; PopupPrompt = {...
50f72283c43730943a5f424f79803dd341aa2c8775f44cb4095cae65c5ed0aa2
MATLAB
1,353
34
function [ns_RESULT, nsEventInfo] = ns_GetEventInfo(hFile, EntityID); %ns_GetEventInfo Retrieves information specific to event entities % % Usage: % [ns_RESULT, nsEventInfo] = ns_GetEventInfo(hFile, EntityID) % % Description: % Retrieves information from the file referenced by hFile about the % ...
6c2d0752ef5f97476724be60664361a5bb40af279ba1c2973a7a2513375cf345
MATLAB
1,354
38
% to make composite figure based on arp/formin IPI mixed data p2p_figure_Arp_or_formin(1)=p2p_by_arp(1); p2p_figure_Arp_or_formin(3)=p2p_by_formin(3); p2p_figure_Arp_or_formin(4)=p2p_by_arp(4); p2p_figure_Arp_or_formin(5)=p2p_by_formin(5); p2p_figure_Arp_or_formin(6)=p2p_by_arp(6); p2p_figure_Arp_or_formin(7)=p2p_by_fo...
ff32ffb2c4c75db8e23f09bad89a76f5775edafcc59f59fa7b2663617ad3e348
MATLAB
1,354
36
% VL_LIOP Local Intensity Order Pattern descriptor % D = VL_LIOP(I) computes the LIOP descriptor of an image I, as % described by [1]. I is a gray-scale square image with odd side % length of class SINGLE. D is a column vector containing the LIOP % descriptor of I. Note that LIOP is also integrated in the VL_CO...
cbbabf6d7a1f5208600ac5b7ada049bc3f92a46cc3374d1f2129fbf8a84528e5
MATLAB
1,355
45
% findLegVel.m % % Function that takes in shifted, rotated, and normalized leg position and % returns leg velocity. % Performs Gaussian process smoothing on leg position prior to calculating % velocity % % INPUTS: % srnLeg - shifted, rotated, normalized leg position matrix (output of % shiftRotateNormalizeLegPos...
cdb158ac3b59df7894a36be54ad35c8c19314c329da134437cad7ec3a4da0745
MATLAB
1,355
69
function [ax] = plotOptToISI(rpInfo,priColors,figprefs) %plotOptToISI.m if isempty(priColors) priColors = containers.Map(); priColors('HL') = 'k'; priColors('bars') = [0.6 0.6 0.6]; end isiLags = rpInfo.isiLags; isiPDF = rpInfo.isiPDF; tickdir = 'out'; dobox = 'off'; dogrid = false; %9/1/22 doleg = opt...
1aa1c4aecce1bcae7e6e46905405be75f71d11434a19340a6cf326640b6ab58a
MATLAB
1,356
31
%% plot the individual traces and their means subplotfigure = figure(); %% 1) Mean of GCaMP %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% meanGCaMP = subplot(3, 1, 1); plot(segMat_405_Control', 'color', lightGreen); hold on; plot(nanmean(segMat_405_Control), 'k', 'linewidth', 2) title([direction ' Segment -...
8a73c0f520d543d77e5d166e884452e1f8b34fab3693cccea87946663be13669
MATLAB
1,356
36
%Return the full paths of the .jar files of the Apache POI library % %EXAMPLE USAGE % >> get_poi_paths % %OUTPUT % poi_files - Full paths for all .jar files in the Apache POI % library % missing_poi_files - Full paths for .jar files in the Apache POI library % ...
94f30c60a05b7c47e93f1445bee3a42c43b118e2610bd652a01a2b6b7a24d9b1
MATLAB
1,356
42
function fitStr = simseq_LMMwrapper(dependentVar,varargin) % Parse inputs p = inputParser; p.addRequired('dependentVar',@ischar); p.addParameter('predictorVar',[], @iscell); p.addParameter('randomInterceptVar',[], @iscell); p.addParameter('randomSlopeVar',[], @iscell); p.parse(dependentVar,varargin{:}); % rename varia...
ce32d42bc4e2670d4fb63be59c98a0b82bba78ced28680df3dde2708bbc7eab2
MATLAB
1,356
43
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [T,E] = get_prob_stats_for_table(R, probNames) T = []; E = []; for iField = 1:length(probNames) fn = probNames{iField}; % We have to treat the excluded data differently so check ...
240f0fa9db0737cb1575ed1ec322038d326c1a44b8627a837841650e15fae3dd
MATLAB
1,357
42
% This script loads mesh data into the MATLAB workspace. The data include % surface meshes and the potential integrals. It also computes useful % sparse matrices for GMRES speed up % % Copyright SNM/WAW 2017-2020 %% Add path (Windows/Linux commands are different) s = pwd; if(~isunix) slash = '\...
4da7dd4697efb6328b22085e3e3da0e477bb4545fea95dad120dcb219802fc95
MATLAB
1,358
43
% mglTextDraw.m % % $Id$ % usage: mglTextDraw(str,pos,hAlignment,vAlignment) % by: justin gardner % date: 05/13/06 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: wrapper around mglText and mglBltTexture to % draw some text on the string. If...
249d4f942bfbe3d0a9b88894e6901193a58f9e97706a6396f83db438cc17a383
MATLAB
1,359
44
function [DATA,INFO] = LCdataload() %Loads data into a structure format from a lab chart .mat export % Written by Mitchell Prostebby, 2023 disp('Please choose a labchart file') [file,path] = uigetfile; load([path file]) if sum(firstsampleoffset,'all','omitnan')>0 disp('Error: First sample of lab chart fil...
a61425ff1270eaff3e1066678d3f0f1be4c2ea195c129c83060f37feeff16482
MATLAB
1,359
38
function [ns_RESULT, hFile] = ns_OpenFile(filename); %ns_OpenFile Opens a neural data file % % Usage: % [ns_RESULT, hFile] = ns_OpenFile('filename.ext') % % Description: % Opens the file specified by filename and returns a file handle, % hFile, that is used to access the opened file. % % Par...
749a44a2f574f6669033878fd14e6d53feedc1cf2e1d6b695647bf3e00bffe32
MATLAB
1,361
49
% Function File: [dydx, y, x] = ndiff (y, x) % % Calculates the first derivative (dy/dx) at each point (p) by % numerical differentiation using the following equation: % % y(p+1)-y(p-1) / x(p+1)-x(p-1) % % % ndiff v1.5 (last updated: 16/09/2011) % Author: Andrew Charles Penn % http...
1f816c081ea77a59d608e574fc0ddc4b4e986ab97305efa13139c4160378d230
MATLAB
1,362
39
function [r] = ml_core_all_pixel_rotated_pixel_cross_correlation_90deg(T1, T2, varargin) p = inputParser; p.CaseSensitive = false; checkmatrix = @(x) isnumeric(x) && size(x,1) == size(x,2); addRequired(p, 'T1', checkmatrix); addRequired(p, 'T2', checkmatrix); % By default use all of the ma...
8c3988ee2c3ce95c5760e5fef5dfd61e7ff440695e2ebd29145345cd31309253
MATLAB
1,362
40
% This function is how to use mouse click callbacks on a figure % figure % To use this function, register the two callbacks by executing the two % lines below % obj.imhandle.Parent.WindowButtonUpFcn = @(object, eventdata)mouseClicked(false); % obj.imhandle.Parent.WindowButtonDownFcn = @(object, eventdata)mouseClicked(t...
2067241c4df14f471435e9a1c8f257577e536a71e6fe2377f77ff2a58000aea9
MATLAB
1,363
39
function [isValid] = ml_nlx_mclust_spiketimes_are_valid(nlxNvtTimeStamps_mus, mclustTimeStamps_mus, verbose) isValid = true; % Check that the neuralynx timestamps are valid if any(diff(nlxNvtTimeStamps_mus) < 0) if verbose fprintf('The Neuralynx timestamps are not montonically increasi...
384866df1f5a8ba9bd8b46fd2880655ded71322e209be9bb30bb9b1b08e9a140
MATLAB
1,363
43
% findBouts.m % % Function that returns start and end of bouts given indicies of all % elements that belong to the bouts. Also returns duration in samples of % all bouts % % INPUTS: % inBoutInd - vector listing all indicies that are part of the bout % % OUTPUTS: % boutStartInd - vector of start indicies of all th...
11ba84d45ee6e43d4d5539554f45f50b035c1c4360c24d1e2e29352033c761f4
MATLAB
1,364
56
function t = randWatsonMeanDir(N, k, p) % This function generate random samples from the tangent direction of % Watson distribution using rejection sampling. The density of is % described in WatsonMeanDirDensity function. See the % SphereDistributionsRand.pdf file for detail description and formulas. % % Usage: % [t...
f7ee19739830cbc8c56a2ea09f0ffdda628acc40dd61f5861f93094263820cda
MATLAB
1,364
40
function b = fcn_get_geographic_null(sc) %FCN_GET_GEOGRAPHIC_NULL returns modularity matrix for geographic null % % b = fcn_get_geographic_null(sc) takes an sc matrix and uses the % geographic null model (see Bassett et al 2015, Soft Matter or Giusti et % al 2016, PRE). This matrix can then serve as input into ...
1c76cc040c8a45120cdf20338c04a24f1f393e8f59e84d65586af584fc1e52e9
MATLAB
1,365
46
function[out,timeunits]=SONTicksToSeconds(fid, in, varargin) % SONTICKSTOSECONDS scales timestamp vector IN % % [OUT,{ TIMEUNITS}]= SONTICKSTOSECONDS(FID, IN{, OPTIONS}) % FID is the matlab file handle, IN is a vector of timestamps from the file. % % OPTIONS if present, may contain: % 'Ticks' : Returns the time in b...
7c35e3aea979f8254c5c56ed6b159cfac527e1dc9ccdfada199c35d57aba05e5
MATLAB
1,365
37
function [probe] = getChannelData(probe) %GETCHANNELDATA Determine channel distribution of the probe % Calculates the SD separations for (1) channels limited by sdrange and % (2) without sdrange limits. For when output is limited to sdrange, % three additional sub-fields (sschannels, lschannels, exchannels) are %...
07197a4413757b9f44dfd7759e98b43787069b1c2b80d4b2834bd17546870d18
MATLAB
1,366
56
function om_write_geom(geomfile,bndfile,names) % OM_WRITE_COND % [] = OM_WRITE_GEOM(GEOMFILE,BNDFILE) % [] = OM_WRITE_GEOM(GEOMFILE,BNDFILE,NAMES) % % Write geometry file for OpenMEEG % % Authors: Alexandre Gramfort alexandre.gramfort@inria.fr % Paul Czienskowski numbnd = length(bndfile); ...
0855d3cb5c03b4965ff105f2d1c81515f7ef8ca1e3359e90c1b8dac71ed8aadc
MATLAB
1,366
39
function [ns_RESULT] = ns_SetLibrary(filename); %ns_SetDLL Opens a Neuroshare Shared Library (.DLL or .so) in prepearation for other work % % Usage: % [ns_RESULT] = ns_SetLibrary('filename.dll') % % Description: % Opens the dynamic linked library specified by filename % % Parameters: % filena...
88f6eb4bae133f6f8fc72efed5ed7ac11751b5cac2e60e23cbaed491bbf87f35
MATLAB
1,366
35
clear file=dir('ACC*reverse*.mat'); k=1; for jj=1:length(file) load(file(jj).name) n=length(outcome); n1=fix(n*0.15); early_fa=find(outcome(1:n1,1)==4);%early phase late_fa=find(outcome(n1+1:n,1)==4)+n1;%late phase for j=1:Info.Cellnumber early_fadf=eachDF{j}(:,early_fa); ...
ec9c1adf05bd22af14789f3bbe19d61cd9f3461e76e60f0f0c716aafa001fc14
MATLAB
1,367
35
clear file=dir('ACC*uncertain*.mat'); k=1; for jj=1:length(file) load(file(jj).name) n=length(outcome); n1=fix(n*0.33);n2=fix(n*0.67); trialnum_hit(1)=length(find(outcome(1:n1,1)==1));%count trial number trialnum_hit(2)=length(find(outcome(n1+1:n2,1)==1)); trialnum_hit(3)=length(find(o...
2bf00f3e06c477bc2dd40b9c847f3574eb7044094fea0c632d8cea47de8b37e0
MATLAB
1,368
41
% discrete divergence using central difference % c = cdiv(Gx, voxel_size) % % output % c is the divergence % % input % Gx is a vector field (4D matrix, with Gx, Gy, Gz) % voxel_size is the size of the voxel % % transpose operator of cgrad % % Created by Ludovic de Rochefort in 2009 % Changed by Sh...
76146bb2eae3083c3ab741000b4469df32844ff0514c777191e57bd61ddd58c0
MATLAB
1,368
43
function [dat, lab] = read_bham(filename) % READ_BHAM reads the EEG data files as recorded by Praamstra in Birmingham % the datafiles are in a particular ascii format % % [dat, lab] = read_bham(filename) % Copyright (C) 2000, Robert Oostenveld % % This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fie...
9a5dbb395ac6ef51fa7be155c2312e7c4e4353ab98b98acfb812530af67c30b4
MATLAB
1,368
69
% % Compute spectral predictions. Predictions correspond to elements of % the matrix UDV', or UDV' - VDU' for the skew decomposition. % % RESULT % prediction (e*1) Prediction values % % PARAMETERS % U (m*r) Left eigenvectors % D (r*r) Central matrix % V (n*r) Right eigenvectors, may be [] in which case U is us...
8e0f8ea7bff32f9753bb8fc5a8c3719a5a7898f8bbb14e5da3b5730af7d34d23
MATLAB
1,369
45
function [phi,S] = vl_tps(x1,x2,Y) % VL_TPS Compute the thin-plate spline basis % PHI=VL_TPS(X1,X2,Y) returns the basis PHI of a thin-plate spline % (TPS) defined on the domain X1,X2 with control points Y. % % X1 and X2 are MxN matrices specifying the grid vertices. When % warping images, these usually corres...
8fd0c5c9509cb1d1cb71d5bb3fc08f9e1bc99a6586f955c928752bf2cf3d5a30
MATLAB
1,371
42
% This script loads mesh data into the MATLAB workspace. The data include % surface meshes and the potential integrals. It also computes useful % sparse matrices for GMRES speed up % % Copyright SNM/WAW 2017-2020 %% Add path (Windows/Linux commands are different) s = pwd; if(~isunix) slash = '\...
09fdd6c948ef463e0d355b7e3f328ae681605e5ccac76c47e519f3b4cd607e3c
MATLAB
1,373
32
function ret=SONWriteExtMarkBlock(fh, chan, timestamps, markers, extra, count) % SONWRITEEXTMARKBLOCK writes data to a marker channel % % Calls gatewaySONWriteMarkBlock.dll after transposing EXTRA % % RET=SONWRITEEXTMARKBLOCK(FH, CHAN, TIMESTAMPS, MARKERS, EXTRA, COUNT) % INPUTS: FH the SON file handle % CHAN ...
3c65366eef7b6a300eba94ab87e62513fd89551dbc438d72bf3741a1efc7e79b
MATLAB
1,373
33
function [out] = balance_table(tbl,TypeVar,BirthageVar,TestageVar) %UNTITLED Summary of this function goes here % Detailed explanation goes here epochtypes = unique(tbl.(TypeVar)); epochtypes = [epochtypes; {'Total'}]; if ~isa(epochtypes,'cell') epochtypes = cellstr(epochtypes); end agetypes = {'Prem<2w','Prem>2w...
ad068fccc8bfbd68563c72e6e8534fcb9a36393da29956a8e9eb3f54c58bdf92
MATLAB
1,373
52
% % Decompose the source and training matrices. % % PARAMETERS % $NETWORK % $DECOMPOSITION % $TYPE "source" or "training" % % INPUT % dat/split.$NETWORK.mat % dat/means.$NETWORK.mat (source only) % dat/meanst.$NETWORK.mat (training only) % dat/info.$NETWORK % % OUTPUT % dat/decomposition_split.$TYPE.$DECOMPOSITIO...
d7a34917e08a70f8557ca1a7c20accda0f03440a9def06690da0ce58fd560fa7
MATLAB
1,373
42
% mglSimulateRun.m % % $Id: mglOpen.m 385 2009-01-03 20:34:37Z justin $ % usage: mglSimulateRun(framePeriod,numFrames,<startDelay>,<char>) % by: justin gardner % date: 01/10/09 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: This function simulates a ru...
7038c690680b48219371dece1a7ae862a838a1a71815daab61366dfc7853aed1
MATLAB
1,374
45
function err=SONSetEventChan(fh, chan, PhyCh, bufsize, comment, title, rate, kind) % SONSETEVENTCHAN sets up a new event or marker channel % % ERR=SONSETEVENTCHAN(FH, CHAN, PHYCH, BUFSZ, COMMENT, TITLE, RATE, KIND) % INPUTS: FH the SON file handle % CHAN the channel number % PHYCH the physical channel ...
cc9692ae8a1078d69d9f17010e58ccc3168b3c8a892f378a84be9858a36cdf20
MATLAB
1,374
37
function [motionData] = ml_motion_load_h5( filename ) % This code read in the motion data from an HDF5 file. if ~isfile(filename) error('Unable to load the motion data. The file (%s) does not exist.', filename); end header = ml_cai_core_h5_read_header( filename ); recording.hour = ...
e1c11a3613e38a6d0d20a2d3fdb98a2c0e4add83d953bba142f59691eeb8a591
MATLAB
1,374
47
function y = wmean(x,w,dim) %WMEAN Weighted Average or mean value. % For vectors, WMEAN(X,W) is the weighted mean value of the elements in X % using non-negative weights W. For matrices, WMEAN(X,W) is a row vector % containing the weighted mean value of each column. For N-D arrays, % WMEAN(X,W) is the...