sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
a78a7532e579b919193d7401c0fc2fe3c66583927ba0614f6677509112dc369e
MATLAB
2,748
76
function out = LK_CueObjAnalysis_prefObjTest_20230923(cfg) % % LK_CueObjAnalysis_prefObjTest_20230923 computes a cell's strength of % object tuning. % % Steps: % - Estimate the firing rate per object; % - Identify the preferred object; % - Test whether the firing rates associated with the preferred object are % highe...
3f1667224cec86a6655ae370663755003ba9f9417938a57b48a4eab2f3ab4c26
MATLAB
2,750
112
% BCT_TREE Creates a tree from a BCT string. % (trees package) % % tree = BCT_tree (BCT, options) % ------------------------------ % % Finds the directed adjacency matrix from a BCT vector (0: terminal, 1: % continuation, 2: branch), uses a stack. % Creates a fake tree (see "xdend_tree"). % % Input % ----- % - BCT ...
cde6ba135567957831475068e48dd99f5d72bdc032d6c07eb2b193f817f0ac4a
MATLAB
2,750
68
% util unit test % % mv_select_train_and_test_data tol = 10e-10; % Random data N = 100; ntime = 30; X = randn(N,40,ntime); clabel = randi(3, N, 1); train_indices = [1:N/4, 80:N]; test_indices = setdiff(1:N, train_indices); n_tr = numel(train_indices); n_te = numel(test_indices); is_kernel_matrix = 0; [Xtrain, train...
ccc070520e1618f78062ba07657cee59e62cd8aad11e50849832c31c77400623
MATLAB
2,752
81
%decc_plotFig1 % Related to Viswanathan, Stein, Nieder, PLOS Biol, 2024 % PV 2024 load('DECCdataFig1.mat') % Figure parameters lcolor = [0 0.3 0; 0 0.5 0; 0 0.7 0]; dcolor = [0.0 0.0 0.6; 0.6 0.0 0.0]; ls = ['-.';'--']; % Figure 1 for m = 1:2 %for monkey %Tuning curve plot (Figure 1B top) figure1 = figure('Co...
95849655d8145f820d199ebdee540943e7d1b9e2aa7d9590b612ac687f5eaf64
MATLAB
2,755
109
function [h2, se, p_wald, p_perm,v_w] = get_heritability(Y, X, K, se_flag, n_perm) % Heritability analysis of multidimensional traits % Reference: https://www.nature.com/articles/ncomms13291 % % Input: % Y: an Nsubj x Ndim matrix of multidimensional traits % X: an Nsubj x Ncov matrix of covariates % K: an Nsubj x Nsubj...
22f9b26054086d88a9d1ea44931fe9d003a39fca11676750f1cc9cfaaa6e14c9
MATLAB
2,756
82
classdef Test_Calc < matlab.unittest.TestCase %TEST_CALC Summary of this class goes here % Detailed explanation goes here % ================================================================== % properties end % ================================================================== % ...
76cc449075514bcf5fa1d439de05e53365167b004bc7be9c8a81422e638c353f
MATLAB
2,759
83
%sim_steam.m %Jamie Near, McGill University 2014; Dana Goerzen, McGill University 2021 % % USAGE: % out = sim_steam(n,sw,Bfield,linewidth,sys,te,tm) % % DESCRIPTION: % Simulate the STEAM sequence using ideal (instantaneous) RF pulses. To % remove unwanted coherences, coherence order filtering is employed %...
2a9257a6a0dfee38c8e9837637c60c3b7e6def3837e369175388d93f6450338d
MATLAB
2,764
90
function aperiodic_sensitivity(arrayID) baseFolder = '/lustre04/scratch/nbrake/data/simulations/trend_peak_interaction2'; funPath = '/lustre04/scratch/nbrake/code/simulation_code'; addpath(funPath); fid = fopen(fullfile(funPath,'mod_files','default_parameters.json')); str = char(fread(fid,inf)'); fclose(fid); pars = ...
0b749dce35c72f1fe35ca75b5a233d083486b073dba479692ccced198f7238aa
MATLAB
2,767
80
clear; clc; %% Add paths now.. loadpath; %% Dataset details now.. datasetname = ['27072018_SponSleep']; %'', '27072018_SponSleep','14092018_SponSleep', %'17092018_SponSleep','30102018_SponSleep', %'01112018_SponSleep'...
f914398930b94f47843f90dfe4b82dfed7526b947e4bb66dc9052591f03279e4
MATLAB
2,770
86
function sftptomatlab(userName,hostName,password,remotefilename,localfilename) %sftptomatlab connects Matlab to a remote computer and uploads %a file using the SFTP protocol % % STATUS = SFTTOMATLAB(USERNAME,HOSTNAME,PASSWORD,LOCALFILENAME,REMOTEFILENAME) % % Inputs: % USERNAME is the user name required for the rem...
6f03f89c07878e7142dfd35fbf33d813f9ad3966c0959dd9546757e6cc642a3d
MATLAB
2,772
93
function rgb = hcl2rgb(h, c, l) %HCL2RGB Convert a HCL (i.e., CIELUV) color space value to one % in sRGB space. % RGB = HCL2RGB(H, C, L) will convert the color (H, C, L) in % HCL color space to RGB = [R, G, B] in sRGB color space. % Values that lie outside sRGB space will be silently corrected. % Code...
49f62a431cfaf6c2cd4c60d0919744165e1b989a0242d3caa20ba8bf17452062
MATLAB
2,776
71
function [errMat, subCoords] = fillErrMat( iFrame, ... chSeq, refImg, maxDy, maxDx, Ny, Nx, numLines) %fillErrMat - helper function conforming to parfor % This function calculates absolute error of all possible considered ... %vertical and horizontal shifts totLines = (numLines - 2*maxDy); subCoords = zeros(totL...
8893742056965338ec7a5f6046fa9be7c900e4dd8942fc4c78523a55dabdd523
MATLAB
2,781
139
clear close all force imSize = [733, 977]; pix2deg = 34.910; load('a7_2_createAvergedNOTMorphedHeatMapsLoad.mat', 'hmAll') load a0_0_bhv2trialStrct.mat %% %hmAll = zeros(733, 977,nMuscimol, nMonkey, numel(NIm), 'double') from a7_2; % UMuscimol = [0, 12 (r),9(l) ,4,1]; %iMuscimol = %1: base %2: rig...
d0f778a29b46009c2a3b6e054a746da5f271a55cc0f36bf4777fbe2c3aaf1df9
MATLAB
2,784
68
function ch_calc_ratio(self, chNums, varargin) %ch_calc_ratio - Calculate the ratio of two image channels % % ch_calc_ratio(OBJ, CH_NUMS) calculates a new channel based on the ratio % of two existing image channels, and merges it into the existing image % data. CH_NUMS must be a length 2 vector specifying the ima...
f77f5186b2b3e3321c1fdf8f43a196ecf2fa1c3b2b5c09958992307d9b7a5db8
MATLAB
2,786
115
clear; clc; close all %% Figure12 subs=30; frequency=1:1:60; condition=2; load([pwd,'\temporary data\fbtrca.mat']) ac=fbtrca_ac.*100; % ------------------------------------------------------------------- colors={[51 103 161],[150 68 71]}; name1=['Stimulus Frequency (Hz)'];name2=['Accuracy (%)'];name3=['ITR...
ccc3a9a0b22c870e310f1ccede004fcfbd3fbafa4b624f6dfbe671a6a64c1c52
MATLAB
2,789
68
%% Export Continuous Data To Binary File % % <html> % Import continuous data into Matlab using TDTbin2mat <br> % Export the to a binary file (f32 floating point or 16-bit integer) <br> % Channels are interlaced in the final output file <br> % Good for exporting to other data analysis applications <br> % </html> ...
c95d72080efbd378383e4b945a8c467d3441e749ca53174e5a332cf4a3ef8288
MATLAB
2,791
85
function varargout = plot(self, objPI, varargin) %plot - Plot a figure % % plot(OBJ, OBJ_PI) plots the default figure for the CalcDiameterLong % object OBJ using the ProcessedImg object OBJ_PI. % % plot(OBJ, OBJ_PI, AX, FIG_NAME) plots the figure on the specified axes % handles AX, and the particular figure spe...
a43d10ab2e6be10825b3f67ca908d4764a3544480ec5a800288fde29a360cd93
MATLAB
2,795
89
function roiImg = plot_3D_masks(varargin) %plot_3D_masks - Helper function to plot 3D masks % % This function is not intended to be called directly. % Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al. % % This program is free software: you can redistribute it and/or modify % it under the terms...
33aeb5bd074a7becfa6acdd8b55ecd5df79e08d70f8889c0cc6c274ceeeba5a1
MATLAB
2,796
102
% PLOTSECT_TREE Plots a selected path along a tree. % (trees package) % % [HP, indy] = plotsect_tree (intree, sect, color, DD, options, ipar) % ------------------------------------------------------------------- % % Draws a line through a section out of a tree. The section must be a % directed path away from the root...
f85995de49aaab371594627065d47891bb2cfbd872cb4b8276fc2b77710869ad
MATLAB
2,800
80
%% 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 numTiles = 170; numRows= 10; imgSizeXY = [2048, 2048]; imgResXY = .1625; % in um, Taken from the .ims properties re...
8b53a05b17478096b799c10c9171ffaef9e4979ac989b1372801ee79141fb742
MATLAB
2,804
157
function [All,outVars] = ExpressionTypeIdentifier(All,outVars) numExps = numel(All); mouseNameList = { 'I127_1' 'HB40_1' 'HB47' 'I132_2' 'I135_1' 'I136_1' 'W4_3' 'I137_3' 'I138_1' 'W20_1' 'mora_tre' 'w14_1' 'w21_1' 'i139_2' 'HB95' 'i140_...
31e1679fb0cb7b659c616aa05dc8e7e19e080906bcaf867b86a456962ace22b4
MATLAB
2,808
60
%%========================================================================== % This is the function part of codes for the reciprocity model proposed by Gao, X., Jolly, E., Yu, H., Liu, H., Zhou, X., & Chang, L. J. (2020). The hidden cost of receiving favors: A theory of indebtedness. BioRxiv, 2020-02. doi: https://doi....
bf0a20ef80f731250699e3bfb0db89014a1127695a97bdfd556f789442dc3076
MATLAB
2,808
110
%========================================================================== % This script extracts behavioral information from the logfiles. %========================================================================== % start clear; clc; close all; % paths behPath = 'E:\OpenField\Beh_20201215\'; dataPath = 'E:\...
7754cdba494b159c04d8d3f0758d05b40b03088803c6a780ca087fc6cdf45a45
MATLAB
2,810
103
% CVOL_TREE Continuous volume of segments in a tree. % (trees package) % % cvol = cvol_tree (intree, options) % ---------------------------------- % % Returns the continuous volume of all compartments [in 1/um]. This is % used by electrotonic calculations in relation to the specific axial % resistance [ohm cm], see ...
c175bc2af47fb7b36ea26f71689e942ddf8fd846c03dcd4dbe4b4031d4194841
MATLAB
2,812
76
% SHOW_STACK Show maximum intensity projection of an image stack. % (trees package) % % HP = show_stack (stack, options) % -------------------------------- % % Show the maximum intensity projections of a stack on a 3D patch (see % "load_stack" for a description of a stack structure and see "cgui_tree" % stk_ panel). ...
cf3f9f5f7c6907613c2d6199b5f92dd91e77b2acf7964e1ae2b01c007ffb77fb
MATLAB
2,816
133
close all force clear load('a0_0_bhv2trialStrct.mat'); %% % non faces NImage{2} = [... 2 4 5 6 8 10 12 13 17 18 19 20 26 29 35 ]; NImage{1} = [... 7 11 25 27 38 39 40 47 49 53 56 60 9 22 28 ...
5d6d3560a205fd834505018d48338b648c6f136de082d5719297ad23877d7def
MATLAB
2,817
83
%io_CSIwritelcm.m %Brenden Kadota, Sunnybrook Research Institute 2022. % % USAGE: % RF=io_CSIwritelcm(in,outfile); % % DESCRIPTION: % Takes MRSI data in matlab structure format and writes it to a text file % that can be read by LCModel (LCModel RAW format). Namely, "One voxel's % data is immediately concatenated to t...
afc8b47e06442686abe65aaadfeedaa76cc31f3358b0c0443dd4d24ace404187
MATLAB
2,817
73
%%========================================================================== % This is the function part of codes for help rejection model proposed by Gao et al., 2021, The hidden cost of receiving favors: A theory of indebtedness % This script should be used in combination with the main file: % Help_rejection_model_ma...
a1955d709ff6b5de2fa834b5091abcddc57159d7fd242bf02a3e6cf2c35684cc
MATLAB
2,818
84
%% Code for orientation decoding analysis clear; addpath './Tools'; protoDir = ''; %% Ground truth analysis load('Saved_maps_groundtruth.mat') Cond90 = TS.Header.Index.iValidBLKCond{6}; Cond0 = TS.Header.Index.iValidBLKCond{3}; map0_gt = DataTrialBand(:,:,Cond0); map90_gt = DataTrialBand(:,:,Cond90); [DP_...
27800a0bebd150c8813b8e552f3e8d406419c6cd51d433d72793aedbcc2f0f8a
MATLAB
2,822
70
function ch_calc_sum2(self, chNums, varargin) %ch_calc_sum2 - Calculate the sum of two image channels % % ch_calc_sum2(OBJ, CH_NUMS) calculates a new channel based on the sum % of two existing image channels, and merges it into the existing image % data. CH_NUMS must be a length 2 vector specifying the image chan...
4ccc594a8d197631093f497cfe42d54872b556d95bc8915ffcc45ede85513592
MATLAB
2,824
72
classdef test_qc < matlab.unittest.TestCase methods (Test) function motionQcComputesSelectedSvdR2(testCase) outDir = tempname; mkdir(outDir); cleanup = onCleanup(@() rmdir(outDir, 's')); motionFile = fullfile(outDir, 'motion.txt'); motion = [(1:8)...
d10f1c8f39c7b1304624902544150e56a347640c9434ec03964a3459b8ece5a8
MATLAB
2,824
87
function varargout = plot(self, varargin) %plot - Plot a figure % % plot(OBJ) plots the default figure for each element of OBJ. % % plot(OBJ, H_FIG, FIG_NAME) plots the figure on the specified figure % handle(s) H_FIG, and the particular figure specified by FIG_NAME. % FIG_NAME must be one of the following: % %...
7c461a4e8017ef1b10003a7050ac63a6320525d2a5ba47c851159c78dee375cb
MATLAB
2,829
95
function varargout = plot_PCspectrum(self, objPI, hAx, varargin) % CellsortPlotPCspectrum(fn, CovEvals, PCuse) % % Plot the principal component (PC) spectrum and compare with the % corresponding random-matrix noise floor % % Inputs: % imgSeq - input image sequence % CovEvals - eigenvalues of the covariance matrix %...
c29fe4eae56a65151f4d064726bdb855a0a5462a156b9380ab7ed8c6b8f3f9a9
MATLAB
2,834
71
function x = readSBX(path, info, firstScan, Nscan, pmt, z) % if nargin < 2 [pathDir, pathName, ~] = fileparts(path); % pathExt [~,infoPath] = FileFinder(pathDir, 'type','mat', 'criteria',@(x)(strcmp(x,pathName))); % fprintf('\nNo info structure was provided. Loading %s', infoPath{1}) info = MakeI...
24ebaf231910d76625abdde0f35db71ab0a85c46658ad12e5cd371a20facfdfd
MATLAB
2,840
101
function drawROI_Callback(obj,~,~) % Draw a ROI to image a sub-set of the full FOV % % Purpose % This callback allows for imaging a sub-set of the full FOV % Disable button until ROI has been drawn obj.ROIButton.Enable='off'; obj.ResetROIButton.Enable='off'; %There is a callback on ROI size...
d7f1e0e1e2df2e9a6498c9d8180bf8797e8fb0acc4825094af31b04e55127d35
MATLAB
2,845
67
%Written for the first splintr barcode dataset from Oz % FOLDER_NAME = 'ExSeqAutoSlice'; FILEROOT_NAME = 'PrimerNPCCCframe7'; DIRECTORY = '/mp/nas0/ExSeq'; offsets3D = [6,6,5]; %X,Y,Z offsets for calcuating the difference roundnum = 1; BEAD_ZSTART = 120; %Load all channels, normalize them, calculate the cross corr o...
d4a6ef81edeb1e723ebae6ddca672aa954307226e4ec21329ec0d483079bc994
MATLAB
2,846
123
% io_readlcmraw_dotraw.m % Jamie Near, McGill University 2014. % % USAGE: % out=io_readlcmraw_dotraw(filename); % % DESCRIPTION: % Reads LCModel .RAW model spectrum file into the FID-A data structure format in MATLAB. % % INPUTS: % filename = filename of LCModel raw file. % % OUTPUTS: % out = Input metaboli...
0d4a127820ea0d9a716082176c599b32c57b4b51e85314c6884d9a5a8e0fd67d
MATLAB
2,847
109
% EUCL_TREE Euclidean distances of all nodes of a tree to a point. % (trees package) % % eucl = eucl_tree (intree, point, options) % ----------------------------------------- % % Returns the Euclidean (as the bird flies) distance between all points on % the tree and the root or any other point. % % Input % ----- % -...
29ffae7ab6ff3fb28ee8a88ddc370a54e9a54e9c63c093777ec7e7b65fc8510d
MATLAB
2,851
90
function result = mergeimports(data, verb) import zapit.yaml.*; if ~exist('verb','var') verb = 0; end result = recurse(data, 0, [], verb); end function result = recurse(data, level, addit, verb) import zapit.yaml.*; indent = repmat(' | ',1,level); % for debugging if iscell(data) result = i...
48d1c89862e0f7968d12b06d8826bfad430687cfdaf1a2c37fed35ced466fbab
MATLAB
2,851
55
function [EMG_Channel1MovementTimeInSec,EMG_Channel2MovementTimeInSec,EMG_Channel3MovementTimeInSec,... EMG1DataIn2000HzNormalized,EMG2DataIn2000HzNormalized,EMG3DataIn2000HzNormalized]... =AnalyzeEMGSensorsData_01_01_2020(EMG1Data2000Hz,EMG2Data2000Hz,EMG3Data2000Hz,StartTriggerTimeInSec,EMGThresh...
47b39679d532122d835d74a9187fddc5f54fb410837ce941cd203b2cbbd86f56
MATLAB
2,852
79
function initialize_network(masterFolder) addpath('/lustre04/scratch/nbrake/code/simulation_code'); [sa,X] = network_simulation_beluga.getHeadModel; locations = sa.cortex2K.in_from_cortex75K; % dp = zeros(2001,3,100); % for arrayID = 1:10 % for j = 1:10 % i = 10*(arrayID-1)+j; % folder = fullfile...
0279c5765fd72407a901c3248b3fc772e6d624b760023df9a64a52c83b8eb573
MATLAB
2,855
82
function chName = choose_channel(varargin) %choose_channel - Choose an image channel % % CH_NAME = choose_channel() prompts the user to specify what is shown on % a given image channel from a list of all the known channel types. % % CH_NAME = choose_channel(CH_OPTS) provides the user only those options % listed...
59d8fad8c90b25af8249088d671fa101d3bbd1a1cb44bf3db8858dc0d3564f14
MATLAB
2,856
93
function roiNames = create_ROI_names(maskROIs, varargin) %create_ROI_names - Helper function to create ROI names % % This function is not intended to be called directly. % Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al. % % This program is free software: you can redistribute it and/or modify %...
95d0932ccfd9970df34737c871193f838d63de9c90b98a6ea8fa4252ec9c3de7
MATLAB
2,856
100
% SSE_TREE steady-state electrotonic signature of a tree. % (trees package) % % sse = sse_tree (intree, I, options) % ----------------------------------- % % Calculates the steady state matrix containing the current transfer from % every node to every other node in the tree, i.e. each column i is the % potential dist...
8e81d8241151437b186d8ba26df4ec8c2ad470b62c0e5eac4660e394ac4a4f46
MATLAB
2,859
96
function shf_sig = shuffle_esc(sig, Fs) % function shf_sig = shuffle_esc(sig, Fs) % % This function shuffles a signal using random insertion type shuffling. % The signal 'sig' is divided into a number of sections, equal to the % number of seconds of data or 1000, which ever is smaller. These sections % are of random ...
f37faff41cc4493ac0762e571e90fcf37dc26ef4799c818ed65a96786ab77478
MATLAB
2,860
125
% this code will read all the gaze files from the trials and covernt them % to the image coordinate. clear close all force warning on hWB = waitbar(0,'checking the trials ...'); %load tirals info load('a0_0_bhv2trialStrct.mat'); load('a0_11_insideFace.mat', 'inFaceTimeSumAll') timeOnEyeAll = inFaceTimeSumAll; ...
8a7e193b1617d87996415eb81d7eb74594f025dcc5b985d407e932d8b8179748
MATLAB
2,861
142
close all force clear load a15_0_SacOnEye.mat load('a0_0_bhv2trialStrct.mat'); NIImage_Individual = [7 9 11 22 25 27 28 38 39 40 41 42 43 44 47 49 52 53 55 56 57 59 60 ]'; %group % NIImage_Group = [ 36 37 45 ...
cb31bd420b751337aac8aea1a4424796378ec8de21493a88f356beb1ca600c31
MATLAB
2,861
77
function [C,pp,pe] = pcfit_v5(data,lambda,peak_guess,ran,span) % pcfit_v5: Fits peak's centroid position (version 5). The function also finds peak (max) position and peak extinction. % algorithm details: Article below % - Improving the instrumental resolution of sensors based on localized surface plasmon resonance % ...
a6862ad8ec9e4561472cc415cc480bdef7877039f5da8407b592133891dfe93b
MATLAB
2,862
108
% TRAN_TREE translate the coordinates of a tree. % (trees package) % % tree = tran_tree (intree, DD, options) % -------------------------------------- % % Translates the coordinates of a tree, per default sets tree root to % origin (0, 0, 0). % % Input % ----- % - intree ::integer:index of tree in trees or structur...
88b3682c5ff7581044271c2dfc2a3e2879398fd1fce613a11ad61512364ad204
MATLAB
2,864
131
close all force %{ clear load('a0_0_bhv2trialStrct.mat'); load('a19_2_distWithinAndBetweenEachTrial.mat', 'distToMeanSameCondition', 'distToGrandMean') load('a19_0_downSizeAverageHeatMaps.mat', 'hmAll105x140') %} %% % non faces NImage{2} = [... 2 4 5 6 8 10 12 13 17 18 1...
316a28f0d31348dd157afb2b113b2e78f529bce632ed1b7937df4048f2c07c35
MATLAB
2,871
86
classdef Test_CalcFindROIs_params < matlab.unittest.TestCase %Test_CalcFindROIs Summary of this class goes here % Detailed explanation goes here % ================================================================== % properties (TestParameter) classCFR = utils.find_subclasses('CalcFin...
d1c7b1eedd682eaf2191c96e8f45a74e60a81910e721501d63844272d099ca77
MATLAB
2,871
112
% this code will read all the gaze files from the trials and covernt them % to the image coordinate. clear close all force warning on hWB = waitbar(0,'checking the trials ...'); %load tirals info load('a0_0_bhv2trialStrct.mat'); load('a0_8_timingLeftVsRight.mat') load('a0_3_2_findFaceAndEyeLocatoins.mat') %% IFa...
d3e437ee06bfaef19b17624a7973110dc3e08b1ec74ed2b43d408a2b3048d385
MATLAB
2,871
79
function [varargout] = t2n_getPP(neuron,tree,pp) % This function plots the locations of a given NEURON point process onto each % morphology and optionally returns these values, too; % INPUTS % neuron t2n neuron structure or cell array of structure (see % documentation) % tree TREES toolbox morphologie...
7e5351bb653bacd5790401b69d5504822c87f37eadd2381378d157cb4a7631e4
MATLAB
2,875
105
function[P, S, X, E] = fit1DGabor( tag, dat, P, S, X, E, n, N ) % number of iterations for fitting niters = 200; % load symbolic equations for Gabor and first derivate define_Gabor_tuning_curve; % convert disparity and mean responses to row vectors x_orig = dat(:,1)'; resp_orig = dat(:,2)'; % interpolate dispariti...
e8568768e7f8f9fdd41415bf834ac4d829b857fa2623110bba6eadc1f1354504
MATLAB
2,876
75
function [ListOfAnalyzedChannels,PSD_OfAllAnalyzedChannels,LFP_PSD_TimeBins,LFP_PSD_FrequencyBins,NoiseTimePointsAllChannel]... =Analyze_LFP_data_20_8_2017(filenameLFPMEAData,NonActiveElectroChannels,StartTriggerTimeInSec,NoisePeakDetectionThreshold) ActiveElectroChannels=[]; %%%% Output from Intan RHA onl...
083a5b8a5fd9c8ea5d71e3ce631e141c1013f79ef5f1e5fc0b0cf1fc22e0c1d9
MATLAB
2,880
76
function [plotROIs, nROIs] = get_plotROIs(self, plotROIs) %get_plotROIs - Check and/or return the ROI numbers to plot % % ROIS = get_plotROIs(OBJ) returns a vector containing the ROIS that can % be used for plotting. In most cases, this will be all the ROIs that % were detected. % % ROIS = get_plotROIs(OBJ, RO...
baea3875b96717b845fdbce26fd6e99a8cec39462d04771766ef7fec5adc2ab9
MATLAB
2,881
113
% IDCHILD_TREE Index to direct child nodes in a tree. % (trees package) % % idchild = idchild_tree (intree, ipart, options) % ----------------------------------------------- % % Returns the indices to the direct child nodes for each individual node in % the tree. % % Input % ----- % - intree ::integer: index of tr...
f9d3dcf9d871f9b486e7a85e449e44a1d6e78198746abedb173203020f9e3e1f
MATLAB
2,885
104
clear close all; clc; subs=2; freq_band=3; stime=0.1:0.1:5; condition=2; load([pwd,'\temporary data\fbcca_stime.mat']); ac_stime;itr_stime; % 30 subject *2 condition *3 frequency_band *50 data_length %% Figure 10a----------------------------------------------------------------- %ACC name1=['Accuracy (%)...
5a6cd8bcfdd603f055197103dc491eb1711fa7e350a1c940510eb307c3013ae7
MATLAB
2,888
107
function varargout = prfsi(val, varargin) %prfsi - Check that the value is a positive, real, finite, scalar integer % % prfsi(val) checks that val is a positive, real, finite, scalar integer. % If it is, nothing else happens; if it is not, the function throws an % exception from the calling function. % % prfsi(...
ed3c3d075952347366e2d43e7244c5924983982e9691fe25cf745052ef6a662f
MATLAB
2,888
88
%% Pipeline for getting breathing belt regressor for fMRI processing % % Use: Run the script, a dialog box will open and you can choose the % physlog file you want to process. It will process and plot, and save the regressor matrix. then you % can load the breathing reg matrix into conn % 15 May 2024 % Editors (alpha...
496514a5194820052562fc16e6162a18a1445ea1fc8bf5a568dbb891d6cd46b0
MATLAB
2,892
121
function pasteBrainThenScale(atlas_data) % First click places bregma of border brain at clicked location % Mouse motion: brain scales and rotates to follow cursor % Second click places second ref point and brain stops moving uF = uifigure; uA = uiaxes('Parent',uF); b = atlas_data.whole_brain.b...
ecddc3908378abe9265f14f87e78cd8a4ec5c0c6c336e865680d170e1d6bbc40
MATLAB
2,894
86
function varargout = numel(val, num, varargin) %numel - Check that a value has an exact number of elements % % numel(val) checks that val has exactly two elements. If so, nothing % else happens; if not, the function throws an exception from the calling % function. val must be a vector or an array. % % numel(va...
26013383ebf30ef16884f92ddef6911c5d764fc6c37c525a888d641ccb55de1c
MATLAB
2,896
86
clear close all force warning on hWB = waitbar(0,'checking the trials ...'); hWB1 = waitbar(0,'checking the trials ...'); %load tirals info load('a0_0_bhv2trialStrct.mat'); I = arrayfun(@(x) isfield(x.analyze,mfilename), dataTrl); if any(I) I(I) = arrayfun(@(x) x.analyze.(mfilename) , dataTrl(I)); end NTrial =...
4be1b57be11272e14a6bef401b4df24d3298af4da392163846314531376f511c
MATLAB
2,900
136
%% This script plot histology bar graphs % goodF condition clear;clc; % load('raw_data.mat') load('raw_data_individual.mat') goodF.Reelin = mean(goodF_R); goodN.Reelin = mean(goodN_R); badF.Reelin = mean(badF_R); badN.Reelin = mean(badN_R); goodF.Cal = mean(goodF_C); goodN.Cal = mean(goodN_C); badF.Cal =...
277047afc4a241c59360ae1fbb34745605de26c6e6d642d44a714ddd44ce4d31
MATLAB
2,906
115
load(fullfile(dataFolder,'simulations','trend_peak_interactions','parameter_changes.mat')); f = 0.1:0.1:500; rhythms = load(fullfile(dataFolder,'simulations','trend_peak_interactions','rhythm_spectra.mat')); rhythms.psd = rhythms.psd([1,5,3,4,2]); P3 = zeros(length(f),5,5); P3(:,:,1) = mean(P2(:,:,1:5),2); P3(:,:,2...
cc4f9eef980ade0742e2a6d9bd7d9e8ae6615ef30a93311f9f48eab737540ac9
MATLAB
2,907
71
function prop = t2n_pnode(neuron,tree,node) % This function returns all properties (mechanisms and point processes) % that have been set at a specific node. This is similar to psection() in % NEURON and useful for validation of set parameters. % % INPUTS % neuron t2n neuron structure (see documentation) % tree ...
f6c52a514be08353ef4d75a401131325d880307dd1a52f7138b3f22c5a36729b
MATLAB
2,909
1
function [time0]=countDown(display,cdStartSecs,cdStartScan, triggerType) % function [time0]=countDown(display,cdStartSecs,cdStartScan, [triggerType]) % % time0 is the time (GetSecs) at which the scanner started. % cdStartSecs is the (integer) number of seconds for the entire countdown sequence % cdStartScan is the (rea...
f59ab3f2134d327c7cdc8abb0ae0f877164d198c5f437e05a1ad53d2ffeb2027
MATLAB
2,910
80
% Preprocessing unit test % % average_samples tol = 10e-10; N = 256; X = randn(N,1); % Get default parameters pparam = mv_get_preprocess_param('average_samples'); %% if a class has less than group_size samples, it should disappear from the averaged sample pparam.group_size = 5; clabel = ones(N,1); clabel(N-30:end)...
be823ba2b5da2379715a980849066666cac762eaabde6f25d405c70b2a79dcc6
MATLAB
2,911
67
function f = LK_PlotRippleCorrelationsWithBeh_20231030(dt) % % LK_PlotRippleCorrelationsWithBeh_20231030 plots the correlations between % ripple rates and different behavioral properties including memory % performance and trial index. % % Lukas Kunz, 2023 % create figure f = figure('units', 'centimeters', 'position', ...
1602369a6c50fbb75c7d466289bb84c0fffaec80eadd7b947b4cfe79607307d2
MATLAB
2,912
91
function [unlabeled] = extractUnlabeled(data,options) nDomains = size(data,2); switch options.un case 0 % Unlabeled 'labels' vector for i = 1:nDomains L = zeros(size(data{1,i}.X,1),1); eval(sprintf('[Xtr%iu Ytr%iu] = ppc(data{1,%i}.X,L,options.puT,options.real);',i,i,i...
4f509581ef05579de0448c1336278c2df330fd93cb9e0aad9331949b4f308977
MATLAB
2,912
122
function [DPrime, DMean, STD, dpSignal, dpNoise] = CalculateDPrimes(Signal,Noise,Dim) %% function DPrime = CalculateDPrimes(A,B,Dim) % Calculate d' between A and B in the dimention of DIM % % A and B must have same sizes in all dimentions but DIM % DIM refers to the dimention of repetation, default = 3 % DPrime is the...
47429f0b209f566504f0852137d35bc821e643186325bde898716dca0ef43019
MATLAB
2,913
75
% op_CSIrose_shiftKcoords.m % Jamie Near, Sunnybrook Research Institute 2024. % % USAGE: % [shiftedKTable, ind]=op_CSIrose_shiftKcoords(kFile, in); % % DESCRIPTION: %This function adjusts the k-space coordinates in a rosette MRSI %acquisition to account for any offsets due to gradient imperfections. %Each petal has ...
040360000e87954a4a748131454a0a37f3fc08cd83731f9fb6da533957a635f4
MATLAB
2,914
74
% Converts MATLAB format SC files into a txt file format that can be read % by the hybrid brain network model implementation % % USAGE: % generate_input_SC(SC, output_filestem) % % INPUTS: % SC - [N,N] array that contains connection weights for all % NxN region pairs % output_files...
3a74d0b98fd636ea988b81123441500cf982515a19a3d038b9e4243b9f558d4b
MATLAB
2,917
59
function P_value = permutation_test_ttest(ctrl_mtx, case_mtx, Wp, CID, Clist, M, threshold_GT, Method) % Conducts a permutation test using the t-test to assess the statistical significance % of a test statistic derived from control and case matrices compared to a permuted dataset. % Inputs: % ...
e9849538713f3ccf9ebd65dc56a57c47482d7c26a568407016252e36b34c688b
MATLAB
2,918
96
% the pattern separation toolbox: analyse spike train ensembles % Copyright (C) 2022 Alexander D Bird function [dist_obj] = distance(input,output,num_params) %DISTANCE Records Wasserstein distance between spike trains if nargin<3 || isempty(num_params) num_params=struct; end if ~isfield(num_params,'n_tri...
75324d4abbd0ae0f640c6b366fcda629e2eae85716bb71b333ad7c60aaabcba8
MATLAB
2,920
98
% sim_onepulse_shaped.m % Jamie Near, McGill University 2014. % % USAGE: % out = sim_onepulse_shaped(n,sw,Bfield,linewidth,sys,RF,tp,phCyc,dfdx,G) % % DESCRIPTION: % %This function simulates the effect of a frequency selective or slice % selective excitation, followed immediately by the acquisition window. % This ...
c9c3d35f145e10bfd42b74d959a0673bc1d6a4b59f13f6e2ef58e16f34f2b7ac
MATLAB
2,921
86
function b = datatypesize(c) % B=DATATYPESIZE(C) % return number of bytes B based on string C. % extended with cpx types for complex, see also freadbk. % -1 is returned for unknown type % % help fread % MATLAB C or Fortran Description % 'uchar' 'unsigned char' unsigned character, 8 bits. % ...
34160f32a392d05913edae5b1232d24b107d4c021ddaec7b443f26874aaf258b
MATLAB
2,923
68
function MakeSbxPartial(expt, sbxInfo, varargin) % Apply only the some components of the affine transform IP = inputParser; addRequired( IP, 'expt', @isstruct ) addRequired( IP, 'sbxInfo', @isstruct ) addParameter( IP, 'outPath', '', @ischar ) addParameter( IP, 'sbx', true, @islogical ) addParameter( IP, 'overw...
8d5c04fdaa59bc810e942c6f7d0843ebcf6e9c5f91a8564e8c0c47a9bbbf7565
MATLAB
2,926
74
classdef listenerExample < handle %The class "listenerExample" inherits the built-in class "handle" % This file defines a simple example class called "listenerExample" % % Prerequisites % If you aren't familiar with OO, first look at simpleOOexample. % Also, you should look at anonymousFunctionExa...
1e5df4885919460c5d7ddcd6a25dcbb61e6326836c0418f96bd9a3f25db4a44e
MATLAB
2,929
72
function loadConfig(obj,fname) % Load a YAML config file % % zaptit.stimConfig.loadConfig(fname) if ~exist(fname) fprintf('No config file found at "%s"\n', fname) return end data = zapit.yaml.ReadYaml(fname); ind = 1; obj.stimLocations = struct(... ...
721c5c2f6ca32cf7fc4949c72849172cba0d18fe7d4f24ce38c56dfc1c400642
MATLAB
2,930
94
clear close all force warning on imSize = [733, 977]; imSizeCent = fix([733, 977]/2); y1 = imSizeCent(1)+(-130:70); x1 = imSizeCent(2)+(-120:0); y2 = imSizeCent(1)+(-130:70); x2 = imSizeCent(2)+(0:120); hWB = waitbar(0,'checking the trials ...'); %load tirals info load('a0_0_bhv2trialStrct.mat'); load('a0_3_0_extr...
dd815f3ea17016f7907b575be054628a1ee841eeea01836090de7c21bb337bd5
MATLAB
2,930
80
%% Stream Plot Example % % <html> % Import continuous data into Matlab using TDTbin2mat <br> % Plot a single channel of data with various filtering schemes <br> % Good for first-pass visualization of streamed data <br> % </html> %% Housekeeping % Clear workspace and close existing figures. Add SDK directories...
a4527c0b50690823ca0edb8cff6fd00adde6cbd54abbbc40587c674de2a51830
MATLAB
2,931
60
function f = LK_PlotRipplePSTHPerPhaseStart_20231030(dt) % % LK_PlotRipplePSTHPerPhaseStart_20231030 plots the ripple PSTH and % time-resolved average ripple rate per trial phase. Good and bad trials % are separated. Data is locked to the start of the trial phases. % % Lukas Kunz, 2023 % create figure f = figure('unit...
bc90c200750326789c0ae3cadc645a0148d947f95b65817b570f7b73ded56443
MATLAB
2,931
80
%% Stream Plot Example % % <html> % Import continuous data into Matlab using TDTbin2mat <br> % Plot a single channel of data with various filtering schemes <br> % Good for first-pass visualization of streamed data <br> % </html> %% Housekeeping % Clear workspace and close existing figures. Add SDK directories...
5f6748fdce5b02640b7305c74d65d14d182e9be1271237d74bff6bb9089b1637
MATLAB
2,932
60
function f = LK_PlotRipplePSTHPerPhaseEnd_20231030(dt) % % LK_PlotRipplePSTHPerPhaseEnd_20231030 plots the ripple PSTH and % time-resolved average ripple rate per trial phase. Good and bad trials % are separated. Data is locked to the end of the trial phases. % % Lukas Kunz, 2023 % create figure f = figure('units', 'c...
76020ba4caf4f066c6b173c4e0d3f083ad44ee2162b7f40ff39e85bba367dc34
MATLAB
2,934
65
function unpresentable = returnUnpresentableConditions(obj) % Return indices of conditions that can not be physically presented % % unpresentable = zapit.stimConfig.returnUnpresentableConditions() % % Purpose % A stimulus condition can not be presented if the beam-blanking at each point % tr...
208fb890371260e38d6506061bf836c287f778e359f8a3643caae0a6391c74ea
MATLAB
2,936
105
function [out] = EEGfMRIPav_cbm_mod06_osap(parameters,subj) % Standard Q-learning model with delta learning rule and Go bias and % Pavlovian response bias and separate learning rate for salient Go % responses (action priming model). % ----------------------------------------------------------------------- % %% Retrie...
81f294b85c680632353fc5cc9f34d789291f2460062af59e5e0a58ff8dbf0861
MATLAB
2,937
98
function LK_SigLine(x, y, p, varargin) % % LK_SigLine plots a significance line. % % Input: % x: all x values % y: two y values that indicate the position of the horizontal lines % p: p-values (if float, then the significance level is indicated via % different shades of gray; if logical, all significant tim...
90f73e20dd0bd5298846c0c4d25c849842c2de8956ef3bd13ce5f2c359a703ea
MATLAB
2,940
84
function hAx = plot_windows(self, ~, hAx, varargin) % Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al. % % 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...
a13c230f2c4863dcbd45d47683c177bec7619839f26d2083596f9cef50801767
MATLAB
2,942
83
function cfrdObj = from_mask(varargin) %from_mask - Load ROIs from a mask or binary image % % OBJ = from_mask() prompts the user to select a file containing % the mask and will create a ConfigFindROIsDummy object using the % provided information. Supported file types are as follows: % % - MAT-files containing...
03a19761ed720568ca2a6323cf23b8c2d1bd8451b42281d3fb66a498d64afa27
MATLAB
2,944
98
%% Comparison of SVD components between subjects % Michelle Medina % August 8, 2022 %% Load saved data close all; clear all; sub_M03 = load('sub_M03_fl_var.mat'); sub_M08 = load('sub_M08_fl_var.mat'); sub_M29 = load('sub_M29_fl_var.mat'); %% Plot histograms by plotting the time-course of the 2nd SVD coefficient and...
f25890efeb4fdad8ee26a06c121b65d59f2e8ee0d4b1d921e24b81d5bd60f6c1
MATLAB
2,944
70
function tree = add_axon(tree,type) % Adds an axon to the morphology. Soma region needs to be already defined. if (nargin < 2) || isempty (type) % if the number of function input arguments is less than 2, or the input 'type' is empty % {DEFAULT: case 'MainenSejnowski'} type = 'MainenSejnowski'; ...
6914581bc7c1489a6ab24a6eb6e2c283a4be7e66ed78cad0a811059745d6e931
MATLAB
2,949
130
function plotSphericalHarmonics(shmat,time, filename) PS = PLOT_STANDARDS(); C = distinguishable_colors(16,'w'); % Plot Each Coefficient of Varying Order figure() tl = tiledlayout(4,1,'TileSpacing','compact'); % Order 0 nexttile yyaxis left ylabel({'Field Fluctuation'; '[ppm]'}); yyaxis right h1 = plot(time,shma...
4b4626981dfdce02c3d67d03f5bea8bd83eca43c583027c0bc4d49ab62b5080c
MATLAB
2,961
74
function [lambda_out, cut_out] = param_tuning(Wp, method, prctile_vec) % parameter tuning function % Input: % Wp: Original shuffled (observed) adjacency matrix (-log(p-values)) % lb: lower bound for lambda_0 % ub: upper bound for lambda_0 % By default, lb and ub are set to be lb = 0.5, ub...
b5854f1307788d99fe8a7130912bbea6aff445fec65f936e84aa0ce0753a80be
MATLAB
2,961
86
% op_CSIZeroFill.m % Brenden Kadota, SunnyBrook Hosptial 2021. % % USAGE: % [out]=io_loadspec_rda(rda_filename); % % DESCRIPTION: % Zero fills in the spatial domain % % op_CSIZeroFill pads zeros to the spectral domain. If the padded zeros % result in an odd number of points, it will always pad onto the left side. % ...
d0cd1cc4b516fff91b263adb7fcf549de8f35f8f35fbabdce83b8b6ef33a8420
MATLAB
2,962
88
%% Import data index = importdata(['..' filesep '..' filesep 'Results' filesep 'NEURON' filesep 'locs' filesep 'index.dat']); locs = importdata(['..' filesep '..' filesep 'Results' filesep 'NEURON' filesep 'locs' filesep 'locs_all_seg.txt']); diams = index.data(:,1); locations = locs(:,1:3); parent_locs = locs(:,4:6);...
ef6010d08bcafbbb9ce45a1da3225251a9ec1b02c6f6f8c054f61167f8892313
MATLAB
2,963
67
function [trainBoutsInd, testBoutsInd] = GetTrainAndTestInd(MouseIDs,contextLabel,sessionNames) miceIdClasses = unique(MouseIDs); contextLabelVec = unique(contextLabel); trainBoutsInd = []; testBoutsInd = []; useMouseForTrain = true(length(miceIdClasses),1); useMouseForTest = true(length(miceIdClasses),1); f...
d7d627b3d75b9ed36ec39f1822a2efa47b5c9bb609e5088f4cd994dda2cb3f6f
MATLAB
2,967
89
function imp = Array2ij(array, typestr, name) %IJARRAY2PLUS Converts MATLAB array to ImageJ ImagePlus object % imp = ijarray2plus(array, typestr) % array size [nRows,nCols,nFrames,nPlanes] % $Id: ijarray2plus.m 475 2009-03-20 20:43:13Z kenichi $ % Edited by Arthur Sugden 180731 % Nam...
92e74246109874651d56cf8d039593136049f567599b393a34a0296453c2d5e9
MATLAB
2,968
56
%% Extract all sbx files within a folder % Clear any previous variables in the Workspace and Command Window to start fresh clear clc % Set the directory of your 'sbx' files mainDir = 'D:\2photon\AB40\221004\'; % add '\' to mainDir if it is not included if mainDir(end) ~= '\' mainDir(end+1) = '\'; end ...
49c273f29be2bc41c84e41f1d93b3471039c8b4a6517d2ed3a71ebb009bfa69e
MATLAB
2,984
81
% Compute artificial alpha input (10 Hz sine wave) % First part: ~10 minutes of activity with short alpha burst % Second part: ~10 minutes of activity with slow power % modulation (0.01 - 0.03 Hz) function generate_artificial_input() %{ Generate first part: 10 minutes with short alpha burst %} % G...