sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
229930bf0a59ec6f6456d2223b2b2c77438f77abc7ff164ecc708cc332e67949
MATLAB
1,609
47
function [TrainBatch,TestBatch] = train_test_division(stg,cls) % gets the data of all classes and subjects and divides them into % training and testing sets % % [TRAINBATCH,TESTBATCH] = TRAIN_TEST_DIVISION(STG,CLS) get the class data % CLS and divides them into test and training sets TRAINBATCH and % TESTBATCH. ...
bf925ec370970e4e6fc338f31eba0c4e3d3f6aa2eb365531400ef3ff2ce55524
MATLAB
1,609
49
function f = kummer(a,b,x) % This function is downloaded from MATLAB center: % http://www.mathworks.com/matlabcentral/fileexchange/29766-confluent-hypergeometric-function/content/kummer.m % % This function estimates the Kummer function with the specified tolerance % the generalized hypergeometric series, noted below. ...
deb633f768bc069d1386e8dd8a6cbe8870280b2bbb028c9136dada8a0cb996a4
MATLAB
1,609
42
function [largest_percent_change, baseline_mean, exp_max, exp_min, baseline_std, exp_mean, exp_std, p] = percent_change_above_baseline(data,baseline_start,baseline_end,exp_start,exp_end) %finds a baseline value by averaging the first part of the data, finds %the max deviation from baseline, and calculate how much devia...
453f652b0366ce4c4bc1aee97f34430eb9e75884712df80533a367f738d0c878
MATLAB
1,610
53
function gridmap = showGrid_DownSamplingImage(image, segments) % Overaly segmentation [sx,sy]=vl_grad(double(segments), 'type', 'central') ; s = find(sx | sy) ; % gridmap = image ; % gridmap(s) =244; % gridmap(s+numel(image(:,:,1))) =164; % gridmap(s+2*numel(image(:,:,1))) =96; % gridmap = uint8(zeros(size(imag...
e22942034a58e9adb671fc8ab8e756c430ff6a802a3cd757018d0879c17d996a
MATLAB
1,610
55
function plotCouplingSeq(curve1,curve2, couplingSeq, pairDist, curveLabels, figOrAxesHandle) % Make a nice plot illustrating the Frechet couplings and highlighting % where the maximal Frechet distance is if nargin<5 || isempty(curveLabels) curveLabels = {'curve1','curve2'}; end if nargin<6 || isempty(figOrAxesHand...
427429f6db582136c1ab4580bc5f8f8181a794a2821b0644875e7b820b64e249
MATLAB
1,611
44
%% BLOCK_AVERAGING % Performs a first quick analysis based on the grand average of the nirs data % over participants (without Bayesian statistics). % % INPUT: % - sub-*_trialsnirs.mat: the epoched fNIRS data of each participant % % OUTPUT: % - plots (and videos) of the block average of each participant and plots of ...
87810fa65e8261e5d01ab772f6c7f66b6d4b0412335811037a11a0bd4febdcd3
MATLAB
1,611
66
function out = combineCells(x,dim,d) %combines a collection of cells either horizontally or vertically, %depending on the initial orientation x = x(returnCellLengths(x) > 0); if isempty(x) out = []; else L = length(x); lengths = returnCellLengths(x)...
167ffe3861f7a79a255136ea9f602fc35db9e6d44a5f4e6a95db0bc0ee93178e
MATLAB
1,613
45
clear file=dir('ACC*uncertain*.mat'); k=1; for jj=1:length(file) load(file(jj).name) hit=find(outcome(:,1)==1); rewardtime=outcome(hit,2)+60; N=Info.Cellnumber; for j=1:N for i=1:length(hit) reward.uncertain_hitDF{k}(:,i)=eachDF{j}(rewardtime(i)-14:rewardtime(i)+30,hit(...
1f115a030ebcf2c38814f9d48653f683cb3a2b00f587be6e44f9f40e7e5e1df1
MATLAB
1,613
47
function params = getParamsSTPRF() % Function to get additional, default spatiotemporal pRF model parameters % % params = getParamsSTPRF() % % INPUTS % none % % OUTPUTS % params : (struct) default parameters, including: % - params.spatialModel : 'onegaussianFit' % - params.temporal...
91a5cf8579f8c712dd8a066661663c9502c38cc8302915c3058ddf2eadde310a
MATLAB
1,613
51
%% corr the coupling R2 or P-value with functional sPET roi_num = 48; load('Edge_GLM_fun_str_dis_commu_DBM.mat') AR = cat(1,results(:).AR); AR_p = cat(1,results(:).AR_moran_p); load('Sub_spet.mat') spet = mean(sub_spet,2); data = spet; data_name = {'spet'}; rand_time = 10000; load('dis_whole.mat', 'dis_matrix_bi')...
b9761f2b271aa0092d14f8c9c7318b693ede59d3429ce7ed8e3dcb7a7ad95ce7
MATLAB
1,614
46
function [speed_cm_per_s, speed_smoothed_cm_per_s, vx, vy, vx_smoothed, vy_smoothed] ... = ml_core_compute_motion(x_cm, y_cm, timestamps_ms, velocity_lowpass_wpass) % This computes the speed and then smoothes it % Convert from microseconds to seconds timestamps_s = timestamps_ms ./ 10^3; ...
81030f00fbf625390ed9809ebcdc15728719f9587f9868ee76a802acff73e206
MATLAB
1,615
40
% mglFrameGrab.m % % $Id$ % usage: mglFrameGrab(<[x y width height]) % by: justin gardner % date: 03/01/08 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: does a frame grab of the current mgl screen and % returns it as matrix of dimensions w...
438898f9f21777b31704dcfcf5c0edfb0e0e68d517a7cbb7f4d53706cbeff119
MATLAB
1,616
38
% ===== load behavioural data ============================================= % Overall, the code prepares and preprocesses perceptual time series data % for subsequent analysis, including correlation calculations and z-scoring. dataPath = 'datapath/'; load(fullfile(dataPath, 'KDE_groups')); %% ===== preprocess percep...
85a6e5de9ae60a5ceeb0ddab4d3e9819eaac5f8d757fd494fd32614c9760f3b1
MATLAB
1,617
51
% kaiserbeta() - Estimate Kaiser window beta % % Usage: % >> beta = pop_kaiserbeta(dev); % % Inputs: % dev - scalar maximum passband deviation/ripple % % Output: % beta - scalar Kaiser window beta % % References: % [1] Proakis, J. G., & Manolakis, D. G. (1996). Digital Signal % Processing: Prin...
e011d977f52443fc52802eacc142381c2c4484c56488f5e20b7865d1681e0b01
MATLAB
1,619
51
% mglSetParam.m % % $Id: mglMovie.m,v 1.1 2007/10/23 22:21:23 justin Exp $ % usage: mglSetParam('paramName',paramValue,<makePersistent>); % by: justin gardner % date: 12/30/08 % purpose: Set MGL parameters, if perisistent is set to 1, then % the parameter will be saved in a file...
eb2ec01b0d402ca222a4b526c0f8b14f6239502e9b13ec074a17fff28288e45c
MATLAB
1,619
40
%{ 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...
b61f0abd37fc0d3ba3ef3d403d09d1784b8c70d4e9f33c46182a2ac47a505d54
MATLAB
1,620
46
function makemda( inputfile, channel) %% makemda creates a new mda file with a specific channel data from an smr file % .mda is the input file format that MountainSort uses % For more informaiton on mda file formats and MountainSort see - % https://github.com/magland/mountainlab/blob/master/old/doc/mda_format.md % % I...
8725833c7349f47f8da1869cf5eab34877ea97955be26ba5d007e11a330f5d74
MATLAB
1,623
55
function setupEyeAnalysis %% DEFAULT PARAMETERS % Pupil radius initial parameters radiiPupil = 50; % default radius in pixels % X & Y Padding around Pupil in pixels xpad = 100; ypad = 40; % corneal refleaction radii bounds radiiCR1 = [6 12]; radiiCR2 = [6 12]; % Fraction features needed for pupil detection minfea...
8cde4dbc37801f53fefb3edd7093be682bbbe1a383629e6c7e1bbf64faf8bef1
MATLAB
1,623
56
function plot_kinematics(mov_dist,mov_duration,max_speed,Nbins) %% plot_kinematics plots the correlation between movement distance, duration and distance % % INPUTS % mov_dist: a cell array containing Nbins cells. Each cell contains a vector with the % distance of each movement within a duration bin. % % mov_duration: ...
b5d3646f64dd27dcb9be072d7cb4947531ba1857740456b669f7ada8fa0b6e20
MATLAB
1,623
42
function handles = fix_StorePanelPositions(handles) % store the positions of the panels in the GUI % splintered from fixerrorsgui 6/23/12 JAB % store positions of right side panels handles.rightpanel_tags = {'seqinfopanel','frameinfopanel','navigationpanel',... 'seekpanel','editpanel',... 'deletepanel','interpolat...
3050887150a5870401f0187df67f87975f8b14488dbc9a52d9430e326b26a894
MATLAB
1,624
49
function result = linearModel(param, prfResponse, t) % Function to compute linear model response to given pRF response % % result = linearModel(param, prfResponse, t) % % INPUTS: % params : (struct) should contain the following fields: % * shift: time between stimulus onset and when the signal % ...
6efa60806db1a435e16aa37571f3b2ef8f8ad106cf1ecc7551492a5986d95629
MATLAB
1,624
15
function results = vl_test_alphanum(varargin) % VL_TEST_ALPHANUM vl_test_init ; function s = setup() s.strings = ... {'1000X Radonius Maximus','10X Radonius','200X Radonius','20X Radonius','20X Radonius Prime','30X Radonius','40X Radonius','Allegia 50 Clasteron','Allegia 500 Clasteron','Allegia 50B Clasteron','Al...
efbe46a0ea4a91f7950f273cee4f974b1603b2a686ce330593d6de12f2c730fb
MATLAB
1,624
83
function J=vl_xyz2luv(I,il) % VL_XYZ2LUV Convert XYZ color space to LUV % J = VL_XYZ2LUV(I) converts the image I in XYZ format to the image J % in Luv format. % % J = VL_XYZ2LUV(I,IL) uses the specified illuminant. The following % illuminant are supported: A, B, C, E, D50, D55, D65, D75, D93. IL % is the na...
a1fdc32a64d472990c3f63b92a90cb0ab7a900cc7c1400908098418131a1c3cf
MATLAB
1,625
57
%% updated 2024/3/26 mw %% % rain_dot_box_plot_v is plot vertical bars % rain_dot_box_plot is plot horizontal bars %% raincloud_plot - plots a combination of half-violin, boxplot, and raw % datapoints (1d scatter). % Use as h = raincloud_plot(X, cl), where X is a data vector and cl is an % RGB value. h is a...
7851fb957050fe6fb2bf1f5e065a9e0c5013cf9df54c9482bdfad4af205269c7
MATLAB
1,627
39
% GIfTI Class for MATLAB % % Geometry format under the Neuroimaging Informatics Technology Initiative % (NIfTI): % http://www.nitrc.org/projects/gifti/ % http://nifti.nimh.nih.gov/ % % This MATLAB class is part of SPM: % http://www.fil.ion.ucl.ac.uk/spm/ % % It reli...
191b4cb9a9c4118f4cc2e7e3bbe656d068f49c4670859f9049bee5b87ac28479
MATLAB
1,629
50
function tree = copy(tree,subuid,uid) % XMLTREE/COPY Copy Method (copy a subtree in another branch) % FORMAT tree = copy(tree,subuid,uid) % % tree - XMLTree object % subuid - UID of the subtree to copy % uid - UID of the element where the subtree must be duplicated %______________________________________...
f2ea6cbd3e24d947ed1d4df3138190f43dbe7d4957768aee2feb29d92d189d0d
MATLAB
1,629
46
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [R] = compute_average_rate_differences_within_across_for_table(T) % Input should be a table that was created with one of the % compute average rate matrix tables. Each DAY should have ONE rate matrix. unique...
ef503a18d8b72fc64477d0d4ec87cace8420c054ea2a8ee36be3b0b4d3ac3bed
MATLAB
1,630
35
function spikeTimes_mus = ml_nlx_load_mclust_spikes_as_mus(nlxNvtTimeStamps_mus, tFilename, numBits) isVerbose = false; % Set to true for debugging. if numBits == 32 spikeTimes_mclust = ml_nlx_mclust_load_spikes_32bit(tFilename); spikeTimes_mus = spikeTimes_mclust .* 10^6; elseif numBi...
e897024ad865e13bef4c6b53554402013ae92d82cba41e4fb8fb4ad65fd3ccd5
MATLAB
1,632
62
close all clear all %% create figure 3A %% janine.thome@zi-mannheim.de %% paths pato=['/###/Figures/']; %% add output path if ~isdir(pato), mkdir(pato); end %% load file = 'DYN_performance.mat'; load(file) %% plot Balanced Accuracy % create colored fig h1=figure('c...
6e1a7b96cfc4cc81069bdff9e4df0791bea19fcbda62ec626c29b956afb739fc
MATLAB
1,633
64
function newmap = rdbu_sym(h) %rdbu_sym Blue, white, and red color map. % rdbu_sym(M) returns an M-by-3 matrix containing a blue to white % to red colormap, with white corresponding to the CAXIS value closest % to zero. % If only negative values are present, only the blue end will be used; if % only...
f4c4ddc3378974678a7b0da4301559c4414dbeb1864924aa90300003b462a41b
MATLAB
1,633
49
function [myscreen] = initEyeTracker(myscreen, varargin) % initEyeTracker.m % % $Id: initEyeTracker.m 203 2007-03-19 15:41:00Z justin $ % usage: myscreen = initEyeTracker(myscreen, [tracker]) % by: eric dewitt % date: 2009-03-10 % copyright: (c) 2006 Justin Gardner (GPL see mgl/COPYING) % ...
0eecfe1a5560568a8ec70ff4350317209019e89fc15a696f4f8719a2980196bb
MATLAB
1,634
59
function [n, npw, ts, wave] = plx_waves_v(filename, channel, unit) % plx_waves_v(filename, channel, unit): read waveform data from a .plx or .pl2 file % % [n, npw, ts, wave] = plx_waves_v(filename, channel, unit) % % INPUT: % filename - if empty string, will use File Open dialog % channel - 1-based channel n...
14b22c282b60df631d2cb26b6032e2d8f20922d640e1b12ae0468a5ac77d1d32
MATLAB
1,634
36
function [predNeural, params] = getPredictedNeuralResponse(params, prfResponse) % Function to get predicted neural response (n,time,space) given % spatial pRF response and choice of temporal model % % predNeural = time (ms) x space (xy collapsed) % % INPUTS: % params : (struct) should contain the follow...
e7cc6eb32d39ff780b4148abfaebedcf7e740b47ef44068a18ff9bb40393b724
MATLAB
1,634
40
function ret=SONSetRealMarkChan(fh, chan, sPhyCh, bufsize, comment,... chantitle, rate, minimum, maximum, units, points) % SONSETREALMARKCHAN creates a REALMARK channel % % RET=SONSETREALMARKCHAN(FH, CHAN, SPHYCH, BUFSIZE, COMMENT,... % CHANTITLE, RATE, MINIMUM, MAXIMUM, UNITS, POINTS) %...
7a55a14690d8643c67cbfa0284178f94ac9dff96c5d1fc115e26449a01a28e58
MATLAB
1,635
58
function data = simseq_loadEventRelatedData(simSeqSessionDir, roiName, varargin) % data = simseq_loadEventRelatedData(simSeqSessionDir, roiName, ... % [dataType], [scansToLoad], [recomputeFlag], [preserveCoordsFlag]) %% Parse inputs p = inputParser; p.addRequired('simSeqSessionDir', @ischar); p.addRequired...
e5e9c55d243e51570f5045c231b0da54be4234b69aaf29dcc874293311e38e59
MATLAB
1,635
51
% this function will call figure2_subplanels to create all 4 subplots of % figure2. % % figure2(data_dir, read_from_excel) % INPUTS: % data_dir (str): Path to source data (default: 'source_data'). % % read_from_excel (bool): Flag to read from Excel (true) % or .mat files (false) (...
6cf7470673bbaacc846d93e9bd71157ecca089113d936d72a118c5c7a90ac2a1
MATLAB
1,636
51
% mglDeleteTexture.m % % $Id$ % usage: mglDeleteTexture(tex) % by: Benjamin Heasly % date: 03/18/2022 % copyright: (c) 2008 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Deletes a texture. This will free up memory for % textures that will not be drawn again. No...
d966064cf064c729ddb2202927ab880b25598c2ccb9951e056665bffbac43b3f
MATLAB
1,636
83
<<<<<<< HEAD function [EER, EERlow, EERhigh, index] = computeEERIndex(FAR,FRR) %es. [EER, EERlow, EERhigh, iEER] = computeEERIndex(FMR,FNMR); % calcolo le posizioni di confine %t1 = min(find(FRR>=FAR)); %t2 = max(find(FRR<=FAR)); %distribuzione con valori grandi tipici degli impostori (es. iride) t1 = min(find(FRR<...
35bce36a5f09e6c006c9d4dfd83f94bf6d9432073179e7475b906b42ae9927cb
MATLAB
1,637
64
% mglDefaultScreenParams.m % % $Id:$ % usage: mglDefaultScreenParams() % by: justin gardner % date: 04/26/10 % purpose: Get a default screen parameters % % screenParams = mglDefaultScreenParams % function screenParams = mglDefaultScreenParams(screenParams) % get host/display name if nargi...
777ed138cdbeb2ab012620a4cc0bd65aae21a7f472af1a74a09b1f8e04b3f391
MATLAB
1,637
47
function GREPhase = mcpcc(GREMag, GREPhase, Params) % GREPhase = mcpcc(GREMag, GREPhase, Params) % %% Author: Xu Li % Affiliation: Radiology @ JHU % Email address: xuli@mri.jhu.edu % % Multiple channel phase combination - constant % updated 2017-03-15, X.L. %% get virtual reference phase using mcpcc method first cen...
526d1815d75d7107ab12aeb83dc36011c95dd94de34e344d92a1c75facd6c6a1
MATLAB
1,638
55
% "Coil tester line magnetic" tool for the entire coil. Outputs % total magnetic field (or any of the field components) along the line given I0 A % of conductor current % Copyright SNM 2017-2019 clear all; %#ok<CLALL> if ~isunix s = pwd; addpath(strcat(s(1:end-5), '\Engine')); else s = pwd; ...
90ad5d9614fe2da7ac0407e6ab0e2fd5f4cee124da30541a47201d0f0aadb61f
MATLAB
1,639
59
function decompressed = openmaestro(filename) % OPENMAESTRO reads in the raw analog electrophysiology file sepcified by % filename and outputs the decompressed signal % % Hannah Payne % Raymond lab 3/28/13 % % Algorithm based on https://sites.google.com/a/srscicomp.com/maestro/data-analysis/data-file-format/data-compr...
f279f49278addc28c90c6cc02c91be94b97a282842951696d68569876912dd31
MATLAB
1,639
33
function d = stageDirFor(cfg,micID,stageRoot,source) % The managed stage folder <stageRoot>/brainsaw_webpreview/<siteID>/<micID>/<source> % % function d = webupload.stageDirFor(cfg,micID,stageRoot,source) % % Purpose % The one place that decides where staged files live. clearStage deletes the re...
a05d6ccd1bd106cf0e4f9f36d65d8033d51b034201fd61a364b3e598ef787c5e
MATLAB
1,640
1
% LOWPASSFILTER - Constructs a low-pass butterworth filter. % % usage: f = lowpassfilter(sze, cutoff, n) % % where: sze is a two element vector specifying the size of filter % to construct [rows cols]. % cutoff is the cutoff frequency of the filter 0 - 0.5 % n is the order of the f...
e24fba9e72532e74e51d6e069dc83f856cff9c06a0c63e970930103f8d1c1984
MATLAB
1,640
52
function CBIG_ASDf_CCA_plotBar(score_names, struc_coeff, output_name) % CBIG_ASDf_CCA_plotBar(score_names, struc_coeff, output_name) % % This function plots the CCA behavioral score structure coefficients vs raw behavioral scores as % bar plot. If output_name is specified, the plot will be saved. % % Input: % - sco...
13fcf85c021a6abe1501d1b328636dc82ca8ff8896d9eedd7c055013314bae27
MATLAB
1,641
23
function [Coherence_1_150Hz,Coherence_5bans,comments] = Compute_Coherence(Selected_Signal,wpli_para) if size(Selected_Signal,2)>size(Selected_Signal) Selected_Signal = Selected_Signal'; end Freq_Range_5bands = [4 8;8 12;12 30;30 60;60 150]; % theta alpha beta low-gamma high-gamma params.tapers = [3 5];% ¡¾TW K¡¿...
1be81c20792233d83f87ac58bc41cd3398d3e07ff649e4fb793b464724b38c99
MATLAB
1,641
60
function [wout] = combineWeights(dm, w) % Combine the weights per column in the design matrix per covariate % % Input % dm: design matrix structure % w: weight on the basis functions % % Output % wout.(label).data = combined weights % wout.(label).tr = time axis dspec = dm.dspec; binSize = dspec.expt.binSize; ...
2cde1c51882b1f615ec1cb22a6c56f1203d023bd242287fd2978cd9d042cfa7b
MATLAB
1,641
70
% % Labels of methods and decompositions. % % RESULT % labels % .(method) Label of method % function [labels] = get_labels_method() labels = struct(); labels.zero = '0'; labels.pref = 'PA'; labels.mask = 'Mask'; labels.neib = 'Neib.'; labels.neib3 = 'P3'; % Decompositions labels.sym = 'A'; labels.sym_n ...
c9741119682bc117821c039d0dc53259a8544a1f35506ffc5b20bdff6c04845d
MATLAB
1,641
57
function modpath() this_file_path = mfilename('fullpath') ; this_folder_path = fileparts(this_file_path) ; addpath(fullfile(this_folder_path, 'params')) ; addpath(fullfile(this_folder_path, 'scripts')) ; addpath(fullfile(this_folder_path, 'tests')) ; addpath(degit(genpath(fullfile(this_fold...
ec49711408c83e46314496fc683b0e9182b062319e9ce92d9112d41199cd2a17
MATLAB
1,641
48
function [wing_pxls,pts] = track_segment_fit_wings(fg_size,imsize,wing_cc,ws,rot_vec,center,bbox,pos,calib) wing_pix = vertcat(wing_cc.PixelIdxList{ws}); % if only one wing, split it along the fly's major axis if numel(ws) == 1 wing_img = zeros(fg_size); wing_img(wing_pix) = 1; %center = detect.body_props(bods(...
799095fdfde2e2c4991aeeaaceac582fe968c2adbcbc5ffb60c157f82f51909d
MATLAB
1,642
57
% getPhaseDiffPDFs.m % % Function that takes phase differences (from getLegPhaseDiffs()) and % converts them into probability density functions (PDFs) % % INPUTS: % phaseDiffs - struct of phase differences from getLegPhaseDiffs() % numBins - number of bins to divide PDF into % units - 'radians' or 'degrees' for ...
d95392c8e83c31cec464c4cc29eadbc4d6e58f5f36a7bdcd41763f0cc2fe092c
MATLAB
1,642
38
function fH = makeFigure3_exampleVO12Data(ds, fLMM, lmmResults, projectDir,subjnr, saveFigs, saveFigDir) % Function to reproduce main manuscript figure 3: % panel a: VO1 time series for each stimulus condition % panel b: VO1 SEQ vs SIM amplitude voxel scatter plot for each stimulus condition % % From the paper: % T...
46dd24afa05ea3f38df21175a94b5d84f70e3dd34aae83eea065e3b269cfd068
MATLAB
1,643
59
function [xc_out] = one_event_xcorr(src_spk,targ_spk,stevt,endevt,xcorr_prefs) % one_event_xcorr.m % for autocorr, src = targ assert(isvector(src_spk) && isvector(targ_spk),'only vector inputs accepted for spks'); store_input = optCheck(xcorr_prefs,'store_input',false,[true false]); lags_msec = optCheck(xcorr_prefs,'...
8b9aee7e91c9526b3348ee1e41458283a5ebd29178181481862e6b7e42773827
MATLAB
1,643
41
function mltp_user_define_session_arenaroi(obj, session) % We need to define the ROI for each slice of data, not just the trials % because the user may find problems with the slices and not use them % as trials. if obj.isVerbose() fprintf('Defining the ROI for all trials of the session.\n')...
e32badb12300b77f1bf4fea88a02eddf8e73b13ac90f4ab09496959f079eee10
MATLAB
1,643
51
function relativeDeviation(numOfReturnedImages, queryImageFeatureVector, dataset, folder_name, img_ext) % input: % numOfReturnedImages : num of images returned by query % queryImageFeatureVector: query image in the form of a feature vector % dataset: the whole dataset of images transformed in a matrix of % feat...
6e9d6cce66b698f97397c206cb8d0a1e116fc29a5773810777a5b5e67031114b
MATLAB
1,644
49
% mglMirrorActivate: Selects which primary and/or mirrored windows are active. % % $Id$ % usage: mglMirrorActivate(indices) % by: ben heasly % date: 08/29/2022 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Selects which primary and/or mirrored windows...
9dd83a22d88d73e607300a63032a02343e184499968ab7b1cf88b67e4d13e50b
MATLAB
1,644
68
function out = decoding_interval_timeshift(IN,L) [nsig,ntime] = size(IN); nL = length(L); % for circshift shift = 4; nshift = round(ntime/shift); TCshift = zeros(nshift,ntime); for ns = 1:nshift TCshift(ns,:) = circshift(IN(3,:),shift*ns); end A = zeros(1,nL); UA = A; DIFF = A; DIFFiqr = A; ACC_AUA =...
cbc5c7964e86666a41b74cb8f08ac452916ade624a05ce0dd78944dc0fab57b2
MATLAB
1,645
46
clc;clear variables; close all; %% parameter parsing [descPara, ~] = makeDefaultParameters; if descPara.testinVocformat path_dataset = fullfile(descPara.folderPath_trainSet, 'JPEGImages'); testFiles = fullfile(descPara.folderPath_trainSet, 'ImageSets', 'Main', 'saliency_test.txt'); fid = fopen(tes...
371a857bee70d7c73493a8f9427257f167cd62474c16c950d6f2d2edc6a846ff
MATLAB
1,646
62
% plot1KernelPred.m % % Function that plots the kernel, the scatterplot of predicted vs. measured % responses with best fit line, and predicted and measured responses for 1 % kernel. % NOTE: kernel and responses should be on same time basis % % INPUTS: % kernel % lags - time points for kernel % inv - flag for ...
8d6f4b2ad88d9cfe578d5851b3dfcc92f42d7b8e88f518fb5f3c21c2c1a52045
MATLAB
1,651
49
classdef EyeTracking < types.core.NWBDataInterface & types.untyped.GroupClass % EYETRACKING Eye-tracking data, representing direction of gaze. % OPTIONAL PROPERTIES properties spatialseries; % (SpatialSeries) SpatialSeries object containing data measuring direction of gaze. end methods function obj = EyeTra...
df59b9a1f9f47f6975358d1b793a96fc81ae11fa6da2fda05fa5e7c8284547d8
MATLAB
1,651
54
% loadMetadataSpreadsheet.m % % Function to load information in metadata spreadsheet into a data struct, % to allow selection of specific subset of data for analysis. % % INPUT: % none - but brings up GUI to allow user to select metadata spreadsheet % % OUTPUT: % metaDat - struct of metadata % % CREATED: 9/27/20...
11aa414b14b8a749530754f2040b8aef361f7ca88a1c7bf9d76d5789b5cb6cb4
MATLAB
1,652
48
classdef WriteStatusTest < matlab.unittest.TestCase % Tests for webupload.writeStatus. properties Dir end methods (TestClassSetup) function addPackageToPath(tc) tc.applyFixture(matlab.unittest.fixtures.PathFixture( ... fullfile(fileparts(mfilename('fullpath'...
69143218a65eac5d7d5161d2fcb0d2f8122b0e7f95bbfa6d15df29817f32b858
MATLAB
1,652
51
%% This script computes Membrane Potential (Vm) in CC_AS_puff protocol Recordings % ================================================== % Authors: Arash Samiee, Knut Kirmse % last modification: 07/2024 % ================================================== % How to use: % (1) Specify parameters % (2) Run the script...
a7b9cf429857298755653bc78e4c4de1bbe557d4d3cc9a0669f5fa403115de3e
MATLAB
1,653
53
function L1(numOfReturnedImages, queryImageFeatureVector, dataset, folder_name, img_ext) % input: % numOfReturnedImages : num of images returned by query % queryImageFeatureVector: query image in the form of a feature vector % dataset: the whole dataset of images transformed in a matrix of % features % % outpu...
1eb3731edc4333aa3ba0ca511cd11aa8238e0d14c8093b694ad3f3534e458b12
MATLAB
1,654
42
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [Classifications] = classify_stability_registered_cells_on_specified_day(BestAligned, CellRegTable, SessionsToGroups, CLASSIFICATION_GROUP_LABEL, BESTALIGNED_STABILITY_THRESHOLD_CRITERIA) % This code returns a list of re...
66e3e53e2147baf0227823f4bed042e7dcc8058cf6327ea9a785e366b48697d3
MATLAB
1,654
64
close all clear all %% create figure 2A %% janine.thome@zi-mannheim.de %% path pato=['/###/Figures/']; %% add output path if ~isdir(pato), mkdir(pato); end %% load file = 'VOL_performance.mat'; load(file) %% plot Balanced Accuracy % create colored fig h1=figure('co...
d4fac4184545c2dd7ae1f1edbf24ed34e276480679e098322d615e0ce364c786
MATLAB
1,654
60
clear; tbl_dir = pwd; tbl_name = fullfile(tbl_dir,'S4_Data.xlsx'); [~, sheetNames] = xlsfinfo(tbl_name); groupStr = {'Young','Old'}; condStr = {'Load 1','Load 2','Load 4','Load 4'}; % # The third position is included for cases where I use ss = 1:3 rather than ss = [1 2 4] %% Fig.S1C figure('Name','DMS_wen_FigS1C') lin...
05f5d22d00d6d2c6c3622c53cf315d0d935c56a88f4cc55ab3bb8924b3732ade
MATLAB
1,655
60
function [h,txh] = aedes_calc_wait(str) % AEDES_CALC_WAIT - Wait message box % % Synopsis: % [h,txh] = aedes_calc_wait(str) % % Description: % Displays wait message box with text 'str'. Output argument 'h' is % handle to message box and 'txh' is handle to text string. % % Examples: % [h,txh] = aedes_calc_wait('Demo...
8fb378a13010cb188256130c9a0c56a35ddcc002b8f8d61fafd5a8336768a940
MATLAB
1,655
62
function [distance,branch] = breadth(CIJ,source) %BREADTH Auxiliary function for breadthdist.m % % [distance,branch] = breadth(CIJ,source); % % Implementation of breadth-first search. % % Input: CIJ, binary (directed/undirected) connection matrix % source, source vertex % % ...
cd27f13ece50d201af4c60c2e9994cab7a1bf7b8d6bd2a9121208ea5880a746d
MATLAB
1,655
72
function imdata=addicon(filename,fieldname) % ADDICON % % Synopsis: % % Description: % % Examples: % % See also: % % Copyright (C) 2006 Juha-Pekka Niskanen <Juha-Pekka.Niskanen@uku.fi> % % Department of Physics, Department of Neurobiology % University of Kuopio, FINLAND % % This program may be used under the ...
808609644c5817759886fa984b6ea4f743a35ab1f5b0909f6b3ac31a5a2f872e
MATLAB
1,656
51
%% corr the coupling R2 or P-value with functional gradient roi_num = 48; load('Edge_GLM_fun_str_dis_commu_DBM.mat') AR = cat(1,results(:).AR); AR_p = cat(1,results(:).AR_moran_p); load('unrelated_gradient.mat','Gt_fun') fun_grad = Gt_fun.gradients{1, 1}(:,1); data = fun_grad; data_name = {'Grad1'}; rand_time = 100...
815ddbb6034c107abe1623c9af4a95301860f3cdd8e899b7bcafbb0c8b5c37eb
MATLAB
1,657
58
function subj_variablity_response_ft(sn) % post-response variance of each set size load('subs.mat'); subname = subs.name{sn}; set_name = fullfile(Dir.prepro,[subname,'_clean.set']); EEG = pop_loadset('filename',set_name); EEG = pop_select(EEG,'nochannel',{'LHEOG','RHEOG','BVEOG','TVEOG'}); X = [EEG.chanl...
d50defee567114ad7728948cb03be76ad12e2755fdcdf411462fd22570f89b17
MATLAB
1,658
62
close all clear all %% create figure 2F %% janine.thome@zi-mannheim.de %% paths pato=['/###/Figures/']; %% add output path if ~isdir(pato), mkdir(pato); end %% load file = 'FC_performance.mat'; load(file) %% plot Balanced Accuracy % create colored fig h1=figure('co...
d25f08dd0f76b4372589e91f0b0e662a95ba05f2cef898ceed29dbe9fda768b8
MATLAB
1,659
53
% 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_Iattn_0.02_2d_4000/"; % ON-ON data = readFilename(rootFolder+"agree/*_*_*_*_*_*.png",'%f_%f_%f_%f_%f_%f'); data( ...
df35f0547aeca3253e359544da1955e8a379037f142a7757cc0e7d77b385bbbe
MATLAB
1,659
60
function [wout] = combineWeights(dm, w) % Combine the weights per column in the design matrix per covariate % % Input % dm: design matrix structure % w: weight on the basis functions % % Output % wout.(label).data = combined weights % wout.(label).tr = time axis dspec = dm.dspec; binSize = dspec.expt.binSize; ...
7afb09a3982ed5521373fcf1177f4f8993f2b384437eccf5b22622ddfe891b0c
MATLAB
1,660
39
classdef CBIG_MSHBM_unit_test < matlab.unittest.TestCase % Written by Ru(by) Kong and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md methods (Test) function test_example(testCase) % create output folder CBIG_CODE_DIR = getenv('CBIG_CODE_DIR'); ...
a0b5537cc06bf276a30529e7edbee61e7c18832e130e62254eef4a40d6920e48
MATLAB
1,661
49
function [ status ] = fillSetupONParameters( obj, data ) % Fill setup LFP recordings ON stimulation class % % Syntax: % [ status ] = FILLSETUPONPARAMETERS( obj, data ); % % Input parameters: % * obj - object containg data % * data - data from json file(s) % % Output parameters: % * status % % Example: % [ ...
d23a804aa15dd10166a2496a7d624e1a2ce83b7b78497e99ec5332f9caad5851
MATLAB
1,661
56
% computeVarianceExplained.m % % Function that takes in predicted response and actual response and returns % the variance explained given specified form of nonlinearity. % NOTE: The predicted response and actual response should be on the same % time basis. % % INPUTS: % actResp - actual response % predResp - pred...
f127d878b60df0402085705e83e3c90b3b89025a94b288ea656b0151e9750e84
MATLAB
1,661
48
%{ 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...
4b7a5927758af995db91b6e5bdcf1d27f52a426059d6aa7e4b9d0c0d1ffe1d74
MATLAB
1,662
60
close all clear all %% create figure S1 %% janine.thome@zi-mannheim.de %% paths pato=['/###/Figures/']; %% add output path if ~isdir(pato), mkdir(pato); end %% load file = 'Age_performance.mat'; load(file); %% plot Balanced Accuracy % create colored fig h1=figure('...
28c846bfdbcbf7c87fa1a1d59dfb73381052ffb90928e66ca8c7c571b196df65
MATLAB
1,663
73
function [h, hFill] = fillerror(x,mean,err,c,lineon, lighten,varargin) % h = fillerror(x,mean,error,c,lineon, lighten,varargin) % % INPUTS % x - x positions to plot % mean - y positions to plot (usually the mean) % error - width of error bars ie SEM % c - optional color ('r' etc). Will be lightened % lineon - include t...
5079b99e9e5d5d130cefaf9fda065dd9b96aa5d8398b651d93bad616cb973f87
MATLAB
1,664
55
function bases = makeSmoothTemporalBasis(shape, duration, nBases, binfun) % % Input % shape: 'raised cosine' or 'boxcar' % duration: the time that needs to be covered % nBases: number of basis vectors to fill the duration % binfun: % % Output % BBstm: basis vectors nkbins = binfun(duration); % number of bin...
9b257046fa0a49a55ee38e31769f8d16d8042cc26fa44ef40659bd2b8711b36f
MATLAB
1,664
59
function save_nii(data,fname,prop) % SAVE_NII saves files with .nii format using the NifTI Toolbox % (nifti.nimh.nih.gov/nifti-1/). Please download and include it in the % path. % % SAVE_NII(DATA,FNAME,PROP) saves a nifti file named as FNAME containing % the data DATA (2D,3D or 4D) with the properties PROP. PROP ...
aa6c36c5e61eb3e389467bad7744e41483a9772c26f5bf09d609545d015741c4
MATLAB
1,664
52
% mglMetalSetRenderTarget.m % % usage: results = mglMetalSetRenderTarget(tex) % by: Benjamin Heasly % date: 03/11/2022 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Set mglMetal's render target -- screen or offscreen texture. % usage: mglMetalSetRenderT...
04fb013405f7213fea63aad2d2538c57cc6d330a37cf8f38f091fc406c9b67d6
MATLAB
1,665
63
function keep(varargin) %KEEP keeps the caller workspace variables of your choice and clear the rest. % Its usage is just like "clear" but only for variables. % % Xiaoning (David) Yang xyang@lanl.gov 1998 % Revision based on comments from Michael McPartland, % michael@gaitalf.mgh.harvard.edu, ...
13100607a36ef384a9e886b60457e8477ef2a6692c44d4935d2afce5609327e5
MATLAB
1,665
54
function [] = plotBrainSensitivity(probe, channeltype) %PLOTBRAINSENSITIVITY Plot spatial brain sensitivity % Generate a spatial plot of channels color-coded by their brain % sensitivity. Can plot all channels, intra module channels, or inter % module channels only with the channeltype input. Channeltype can be...
2021b197b55c9c0d0440f9d54050de5f97a3b88e80c7b4e4640fe2990c270158
MATLAB
1,665
55
%Add useful formatting to FMUT output spreadsheets % %EXAMPLE USAGE % >> format_xls('results.xlsx') % %REQUIRED INPUTS % spreadsheet - name of spreadsheet file to format % %VERSION DATE: 18 April 2019 %AUTHOR: Eric Fields % %NOTE: This function is provided "as is" and any express or implied warranties %are...
6b51f851826e7a8f920e48c432580933ab12dc54379ecb5259397ec8b468ac29
MATLAB
1,665
61
function D = agreement(ci,buffsz) %AGREEMENT Agreement matrix from clusters % % D = AGREEMENT(CI) takes as input a set of vertex partitions CI of % dimensions [vertex x partition]. Each column in CI contains the % assignments of each vertex to a class/community/module. This function % aggregates the partit...
981edc1b85370179350ebc75d14166ac1e9c03066ad9fc8a079511c2ed67ec76
MATLAB
1,666
75
function output = smooth(input, window, kernel_type) % Smoothing function: % output = smooth(input, window, type) % "Type" should be set to 'gauss' for a gaussian kernel or to 'boxcar' % for a simple moving window average. "Window" is the total kernel width. % Input array must be one-dimensional. % % last modified 5/...
b7afeef2545176683ac164ebb2a8d35a28da9706682efb0519a58ac2dd93a6f9
MATLAB
1,666
58
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [hFig] = plot_per_day_cell_averaged_rate_difference_matrix_table(T) %T = compute_per_day_cell_averaged_rate_difference_matrix(DaysToSessions, RateMatrices, perCellNormalizationMethod); hFig = figure('position', get...
bcef3cfc02727536cc1208f0a791f689dcf678695234357b01b97bc4d825dc3b
MATLAB
1,666
36
function [HiddenNeuralStatesProbability] = DecodingHiddenNeuralStates(Best_HiddenMarkoModels, emision_sequence_cross, info,str_save_append) %% Decode hidden neural states probability based on the best Hidden Markov Models. %% authors: Stefano Diomedi %% date: 22nd February 2024 % %% Inputs: % - Best_HiddenMarkoM...
df52edbf7c1e6620e611d26d6b1779358c87c59aca92a0e73594852e02f6a3dc
MATLAB
1,667
69
function dxdt = GBMFuncoptimal(t,x,p) % Anderson et al. (2024) model of treatment-free glioblastoma-immune dynamics % to be used in conjunction with the optimal control code. % The purpose of this code is to determine system dynamics pre- and % post-treatment. %------------------------------------------------------...
30a4e2185d578722d8baca2e28b009aed670ef31e6009837a20b065c600a2b33
MATLAB
1,668
33
function Einc = bemf3_inc_field_electric(strcoil, Points, dIdt, mu0) % Computes electric field from the coil via the FMM % in terms of the pseudo electric potential evaluated for segment centers % % Copyright SNM 2017-2020 % Compute pseudo potentials N = size(Points, 1); segvector = ...
d9fb95353f61db00872ab72ff7644865bf1e06d2e231c3bd13cad91d4e738360
MATLAB
1,670
55
% "Coil tester line electric" tool for the entire coil. Outputs % solenoidal electric field -dA/dt (or any of the field components) along % the line given I0 A of conductor current and frequency freq % Copyright SNM 2017-2019 clear all; %#ok<CLALL> if ~isunix s = pwd; addpath(strcat(s(1:end-5), '\...
fb14824d6aa685ca89e57a971c4291cc6a390b4e3f2e140437077f43c7dce0b6
MATLAB
1,670
41
function varargout = nifti_stats(varargin) % Conversion among various statistics % FORMAT P = nifti_stats(VAL,CODE,OPT,PARAM) % CODE can be one of % 'CORREL' 'TTEST' 'FTEST' 'ZSCORE' % 'CHISQ' 'BETA' 'BINOM' 'GAMMA' % 'POISSON' 'NORMAL' 'FTEST_NONC' 'CHISQ_NON...
5aab85966769639e0cf5abe053f16e6253f5577bf957cc38f03266abb375b590
MATLAB
1,671
45
function vecIndName = addVecInd(DynamicTable, colName) %ADDVECIND Add VectorIndex object to DynamicTable validateattributes(colName, {'char'}, {'scalartext'}); vecIndName = [colName '_index']; % arbitrary convention of appending '_index' to data column names if isprop(DynamicTable, colName) VecData = DynamicTable....
9c57907ed0d6a098afd7f20e08a2ce3f7dfadca2fc0993217a3593b5dd21178b
MATLAB
1,673
40
function ret=SONSetRealMarkChan(fh, chan, sPhyCh, bufsize, comment,... chantitle, rate, minimum, maximum, units, points) % SONSETREALMARKCHAN creates a REALMARK channel % % RET=SONSETREALMARKCHAN(FH, CHAN, SPHYCH, BUFSIZE, COMMENT,... % CHANTITLE, RATE, MINIMUM, MAXIMUM, UNITS, POIN...
357ad3bf42bc090127dcee2036517bb8f454fc419d666e81183930785028cfaf
MATLAB
1,675
56
%% batchBuildMDA creates a new mda file with a specific channel data from an smr file % .mda is the input file format that MountainSort uses % For more informaiton on mda file formats and MountainSort see - % https://github.com/magland/mountainlab/blob/master/old/doc/mda_format.md % Maxwell Gagnon 10/2017 activateC...
3bc921951804a79e6438f05e024192fd169521a6753ca3299110910858f2d179
MATLAB
1,675
48
% ficTracDatPosVel.m % % Extracts FicTrac position and velocity from unwrapped position output % from .dat file % % INPUTS: % unwrappedPos - unwrapped position in radians % sampleRate - Rate the data was aquired at (samples/second) % lowPassFilterCutOff - frequency that the position signal will be low % pa...
d30b1d08c5bd0150fe03b8da27829e7574195e76dc1f84198a67e96d9838b383
MATLAB
1,675
46
% Example 2: Seamless blending of real and synthetic texture in an % image, using Portilla-Simoncelli texture analysis/synthesis code, % based on alternate projections onto statistical constraints in a % complex overcomplete wavelet representation. % % See Readme.txt, and headers of textureAnalysis.m and % textureSynt...