sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
8cef0f004403edca1f65dff9525b237260394fdb6a17eea7fa9757fee3283cd8
MATLAB
3,899
114
function [Kernel, feat, D] = hmm_kernel(X_all, hmm, options) % [Kernel, feat, D] = hmm_kernel(X_all, hmm, options) % % Computes a kernel, feature matrix, and/or distance matrix from HMMs. % Implemented for linear and Gaussian versions of Fisher kernel & "naive" % kernels % % INPUT: % X_all: timeseries of all subjec...
a4ffd96ad0f78706a54605846fbde13c1b78c73188f772bf4f3e2e7d6c07ae81
MATLAB
3,899
132
function Metrics = Gradient_Metrics_Calculation(GradientResult, Options, OutDir) % ========================================= % Gradient Metrics Calculation (Subject-wise) % Compatible with Result struct from Gradient_Calculation % ========================================= % Input: % GradientResult: struct with fields...
b92235251e96a862189295f89783130c1407742a673748b650e1d8d5f8d4876d
MATLAB
3,899
108
% Second-kind integral equation on the unit square, Laplace single-layer. % % This is basically the same as IE_SQUARE1 but with the identity added to the % system matrix in order to create an artificial second-kind volume integral % operator. It skips the preconditioned GMRES comparison since the problem is % well-cond...
d9d4f445c36ad09e01ccb920c9f99b110db234525ba09f1904077bb692f0ee62
MATLAB
3,899
114
function [goodTrials,badTrials,p]=inputBADtrials(p_strct,subj_location) % prep work numTrial = ceil(p_strct.epoching(subj_location,3) / p_strct.epoching(subj_location,2)); %%%%%% GUI f=figure('Visible','off','Units','pixels','Name','Bad Trial Input',... 'Position',[50 200 250 400]); % Enter Channels textIN=uico...
2a8816e7299324f35647bc538241eeb4c9f6f22e373bdc3461136d82c7c25f89
MATLAB
3,900
70
%% Apply a new atlas to an image % Here the atlas HCPex_SUIT_AGBT was applied to the PET scan, % which means that the scan was masked. % Each parcel of the new image is now the average voxel intensity % of the corresponding parcel on the PET scan. % 08.04.2022 - JVH %% SPM is needed for Lead DBS, which we use to read ...
5622dc9057f904f7379fd8a76da122b8a600a987dc08d117b9110f14fb932242
MATLAB
3,901
170
function xend = filter_hilbert(x,Fs,Fp1,Fp2,norbin) % <°LAN)<] % v.0.1.2 % % Hilbert filter % (1) Realizar filtros pasabanda de la senal x, Entre Fp1 yFp2, % Fs como frecuencia de muestreo % (2) Aplica transfomada de hilbert para generar senal analitica (Sa) % de la senal (S), forma:...
b6528ce3e2ade82b95c8cde20bfae0e4246ac8ed6c1af9c4e591942dbc33f95e
MATLAB
3,902
62
function X0 = getStartingState_ToRORdLand(varargin) if (~isempty(varargin)) if (strcmp(varargin{1}, 'm_endo')) X0 = [-88.6369922306458,11.8973412949238,11.8976610470850,... 141.234464714982,141.234423402713,7.26747296460659e-05,... 6.33786975780735e-05,1.53265306371...
ee701548bdcf6ac7495cb73ee352577a422f423d68ddcc9e0638661cbb1fb393
MATLAB
3,904
91
function id = ticStatus( msg, updateFreq, updateMinT, erasePrev ) % Used to display the progress of a long process. % % Essentially, use 'ticId = ticStatus' to start a new progress % indicator, and then update the progress indicator with a call to % 'tocStatus( ticId, fracDone )', where fracDone is the fraction of % th...
b61ccf50cac6ed8c1df7f3f28d3cf5c9234303c51fa4c47007565f28bc94a734
MATLAB
3,905
129
%XMLDEMO1 Demonstrate how to create an XML tree and save it % % Description % This script demonstrates the use of the xmltree class to % create an XML tree from scratch and save it in a file. % Copyright (C) 2003 Guillaume Flandin % Please note that this script is only a demonstration of how % to use xml...
05210184e669d31468b52a64e1b25c41d5b15796ea9434f5a5c2befadf45fb07
MATLAB
3,906
96
function filt = filter_with_correction(B,A,dat,dir,usefftfilt) % FILTER_WITH_CORRECTION applies a to the data and corrects % edge-artifacts for one-pass filtering. % % Use as % [filt] = filter_with_correction(B,A,dat,dir); % where % B,A filter coefficients % dat data matrix (Nchans X Ntime) % dir...
357b950c4a214a61fa1dffc0d874b1ddb5fb8b53a809721a01d068dceebf594a
MATLAB
3,906
230
function [] = plot_neur_new(rat_name,type) %%% plot pulse responses rat=rat_name(2:end); rat=str2double(rat); res=2; dur=66; load data/combined_kernels.mat %%% (generated by combine_neural_kernels.m) data=data_all_trials; data.centers=-1:res/100:2; vecx=0.01:0.02:dur/100; data.vecx=vecx; load data/rat_for_e...
6fea27e1a1cd3b46ab5b2ab687b9ced96c955cdc248ea77b3e4e4720435aa71f
MATLAB
3,907
84
function [bvc_loglik,fr_loglik, fd_loglik, uniform_loglik, bvc_prob, fr_prob, fd_prob, bvc_logprob, fr_logprob, fd_logprob] = fit_bvc_and_other_models(v, dataset) % Generate bvc tunings v = calculate_bvc_tunings(v); % Create environment based on resolution and aspect ratio v = env_distances(v); bvc_pop = generate_bvc_...
6480c001b49ed9842d527f51136fe35a099a1d3bb66af1271ad4e9a13d2bfe84
MATLAB
3,908
120
function meg_Fig4b_TE_allTrials_mdlFit_slope_bar % meg_Fig4b_allTrials_mdlFit_slope_bar % Plot linear model slope (All trials) %% Load data filename = 'figData/ModelFit_SeparatePrecueT1T2_2Hz_session.mat'; load(filename) %% Figure settings titleVis = 0; % if title vis off, then will plot for appropriate manuscrip...
8d1c4636a1e03bf69c15615a8a7cd640c8208a92c77bdfb5401fcc1779d237c4
MATLAB
3,908
138
clear; clc; close all; srate = 400; atimes = linspace(-1500,1500,srate*3); mtimes = linspace(-1500,1500,srate*3); frequency_range = [1:40]; %% warning('off'); band_labels = {'\delta (<3Hz)','\theta (3-6Hz)','\alpha (7-14Hz)','\beta (15-30Hz)','low \gamma (31-40Hz)'}; band_limits = [3 6 14 30 40]; ...
e1e09bd84520fd9dd1ab853f03bdced25678624c6e02707854891a0c3c803270
MATLAB
3,908
108
function [dat] = read_ricoh_data(filename, hdr, begsample, endsample, chanindx) %function [dat] = read_ricoh_data(filename, hdr, begsample, endsample, chanindx) % %% READ_RICOH_DATA reads continuous or averaged MEG data %% generated by the RICOH MEG system and software, %% and allows the data to be used in FieldTrip. ...
267db5b3da621a5f02c87e6b91ca35ab78d39d0246269c6210120f83984102c3
MATLAB
3,910
107
function [group_copes, thresh] = run_group_glm( data, ... first_level_design_matrix,first_level_contrasts,... group_level_design_matrix,group_level_contrasts,... nperms, use_tstat,use_flame) %%function [group_copes, thresh] = run_group_...
8bd0d31e9300fde5b674ec051d47a23120a1b0f9dd897cd8482263426ef60206
MATLAB
3,910
108
classdef ActionResults < handle % % % %<PRE> % This file is part of dspace-core. % % Copyright (C) 2020 University Zurich, Sepp Kollmorgen % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU Affero General Public License as ...
dda10d292aea891d91948f2e6b45099388cfa1a9f3528d2b4bdb73aaf65fe336
MATLAB
3,911
191
%%% This code is an additional code that helps doing projector calibration in 3D scanning setup. %%% This is not a useful code for anyone else but me. %%% I included it in the toolbox for illustration only. fprintf(1,'3D scanner calibration code\n'); fprintf(1,'(c) Jean-Yves Bouguet - August 2000\n'); fprintf(1,'Inte...
f7e9dbbe2197bc06cbfdcabdd57e63f3ab1ab34440ff042201ecdafa5d71aa9d
MATLAB
3,912
264
clear clc close all %%% uncomment rat name to produce the corresponding plot % ratto='P049'; ratto='P055'; % ratto='P059'; % ratto='P095'; % ratto='P100'; % ratto='P101'; % ratto='P102'; directory_sessions='data/Sessions_trials/'; load([directory_sessions ratto '_sessions.mat']); minperf=.65; minbeta=.65;...
5a36fb7260ff7ff999203f88f4977616daaba219df3876c94407a53b61afc0a0
MATLAB
3,914
100
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % This script computes the global efficiency and participation coefficient% % according to the Seitzman et al. (2020) atlases. % % Make sure to compute the information for the group atlas first!!! % % ...
5dadc14c79cb61b6c994548811587f73bfb015aa156a619deebf66878921bdd6
MATLAB
3,914
98
function [event] = read_nmc_archive_k_event(eventfile) % READ_NMC_ARCHIVE_K_EVENT extracts event-data from nmc_archive_k datasets % % Use as % event = read_nmc_archive_k_event(eventfile) % % % This function specifically only reads data from one of the archived % datasets of the Neurophysiological Mechanisms of Cogni...
6ae082bc787df84648e6aa66ddac46e62b1ff78b6ec1a92e7f65b7ef4f56d889
MATLAB
3,917
150
function y = dyadup_gpu(x,varargin) %DYADUP Dyadic upsampling. % DYADUP implements a simple zero-padding scheme very % useful in the wavelet reconstruction algorithm. % % Y = DYADUP(X,EVENODD), where X is a vector, returns % an extended copy of vector X obtained by inserting zeros. % Whether the zeros are ins...
4435a14b1dc3724daa812f4d55e657e5ecd11e02b5bc3562b04c2c04372cd197
MATLAB
3,918
72
function [PC, integralpd] = meshneighborints_Pn(P, t, normals, Area, Center, RnumberP, ineighborP, Indicator, numThreads) % Accurate integration for electric potential on neighbor facets % Done for a selected interface only ("Indicator" variable is used) % Copyright SNM 2018-2022 ppool = gcp('nocre...
b50a1a0f1b0d736aebbdcd797141b0f2341c583574ab49244238f2ec78a9f759
MATLAB
3,918
124
function doitColor(debugging,scale,aspect,imFile,append,origin,seedFile) randn('state',sum(100*clock)); stimPath = '/e/2.2/p1/freeman/Documents/EeroLab/textures/stimuli/'; oim = double(((imread(fullfile(stimPath,imFile))))); % for 256, scale of 2, aspect of 0.25, overlap of 0.01, and rad deg of 0.5 % gives me a good...
58234d11d8e13004a2e1233cf983293ca802766c3524e4bb19a932b907563978
MATLAB
3,920
141
% Re-select te corners after calibration if ~exist('n_ima')|~exist('fc'), fprintf(1,'No calibration data available.\n'); return; end; check_active_images; flag = 0; for kk = ind_active, if ~exist(['y_' num2str(kk)]), flag = 1; else eval(['ykk = y_' num2str(kk) ';']); if isnan(ykk(1,1)),...
4398298436278ac271c1e849908c97f7f567650060e4c77d519f24b90a9437cc
MATLAB
3,921
122
function [data] = femdata_TR_moments(mesh, varargin) % FEMDATA_TR_MOMENTS Calculates spatial distributions and boundary values % of statistical moments or Mellin transforms of time-resolved data for a % FEM mesh in the NIRFAST format. This function is a wrapper to call % mesh-type-specific femdata functions. This...
ab036f62487cb095b9d24242cf02b5362ca0a5eeb93ed2c2b523878b717e3239
MATLAB
3,921
94
% MATLAB code provided by Seyed Mohammad Ali Rahmati % Affiliation: Biomechanics and Motor Control Lab, Department of Biological Sciences, Georgia Institute of Technology, Atlanta, GA. % Description: % This script computes a sensitivity analysis of the mean maximum muscle-tendon (MT) moment to changes in % muscle para...
768109015b7716d58bf539171426214c3b2b2779707237a6cbc6f9bbca999902
MATLAB
3,923
95
% MATLAB code provided by Seyed Mohammad Ali Rahmati % Affiliation: Biomechanics and Motor Control Lab, Department of Biological Sciences, Georgia Institute of Technology, Atlanta, GA. % Description: % This script computes a sensitivity analysis of the mean maximum muscle-tendon (MT) moment to changes in % muscle para...
2f05a6cde3419c0895a54abb164f789e4d420204ca5287ddbfbac2c24ed24525
MATLAB
3,924
100
%{ Copyright (c) 2025 Axion BioSystems, Inc. Contact: support@axion-biosystems.com All Rights Reserved %} classdef BlockVectorHeader < Entry %BlockVectorHeader Primary data regarding a BlockVectorSet of Data % This class contains the basic information about an entry of % Block Vector Data th...
aba8dd1152f748355f144d6ec6f1963c10d9110a93ac20c9f877a5e5eac068fd
MATLAB
3,924
152
function hh = herrorbar(cax, x, y, l, u, symbol) %HERRORBAR Horizontal Error bar plot. % HERRORBAR(X,Y,L,R) plots the graph of vector X vs. vector Y with % horizontal error bars specified by the vectors L and R. L and R contain the % left and right error ranges for each point in X. Each error bar % is L(i)...
bc684a600d67c6a314559c28f7e83fc4243aebe1e8320107bb9b92b840ecdf83
MATLAB
3,924
96
%######################################################################### % Parse the ontology.xml of the AllenBrainMouse_CCFv3_201710 % xDoc = xmlread('1.2_ontology_-_used for manuscript.xml'); allListitems = xDoc.getElementsByTagName('structure'); parsedOntologyXML={'structureId', 'structureLR', 'structure...
d5669516fe85212a1f4473bfd508081d5d10bcb803fad4037f8da710cdd114a1
MATLAB
3,924
121
function StoreEdfInMat(IDs, behDataFolder, exeFile, skipPractice) % StoreEdfInMat % convert edf to asc, readAllEdf, store that in result.s addpath ../../Experiments/MyFuncs/ if exist('IDs') && ~isempty(IDs) if ~iscell(IDs) IDs = {IDs}; end else IDs = {'Tri';}; % find all by default end if ~exist('...
85233d10fdc46640b6e4075a42d0839a9510fd48c6c85da84af64cd3bb9a0630
MATLAB
3,925
89
function y_Normalize_WriteToMNI_DARTEL(SubjectID,SourceDir,OutpurDir,T1ImgNewSegmentDir,DARTELTemplateFile,IsSubDirectory,BoundingBox,VoxSize) % FORMAT y_Normalize_WriteToMNI_DARTEL(SubjectID,SourceDir,OutpurDir,T1ImgNewSegmentDir,DARTELTemplateFile,IsSubDirectory,BoundingBox,VoxSize) % SubjectID - The ID (or nam...
bc2818650f5c5f4de255af8db7ca5a95ccaaeb4cc647f43daddb1688957745bf
MATLAB
3,925
119
function draw_figureS5(p,decRes,rsaRes) % % This code is for drawing figure S5 % In the paper, we used Pycortex (Gat et al., 2015) for drawing map. % Here, similar visualization is mimicked without pycortex % %% settings % prepare surface map load([p.rootPath,'code/util/hcp360colMap.mat'],'hcp360colMap'); % ROI info....
7204df40332d441a0e5507550e47347463b4cca92d4b21edf481080ba9135117
MATLAB
3,927
110
function grad = getGradient(problem, x, storedb, key) % Computes the gradient of the cost function at x. % % function grad = getGradient(problem, x) % function grad = getGradient(problem, x, storedb) % function grad = getGradient(problem, x, storedb, key) % % Returns the gradient at x of the cost function descri...
b34368038819018d3cb8d48e39a4ccbb508e1c43452e8b5158883338c19f7a3b
MATLAB
3,928
103
% Five-point stencil on the unit square, Poisson equation. % % This example solves the Poisson equation on the unit square with Dirichlet % boundary conditions. The system is discretized using the standard five-point % stencil; the resulting matrix is square, real, and positive definite. % % This demo does the followin...
3981eaec953978db24e1faed04f363763790d540243b72667529d256609650ef
MATLAB
3,930
93
% calc_pop_signals % load(fullfile(saveLoc, 'par_sess')) for sess = 1 : 8 clear par dd beh behMap behView spk spkMap spkView clear spkZ spkMapZ spkViewZ spkZnan spkMapZnan spkViewZnan load(fullfile(saveLoc, ['spk_S' num2str(sess)])) load(fullfile(saveLoc, ['spkZ_S' num2str(sess)]...
509f4f07142a1dffe225ce152f392352ae11c4303fbf00efaf2bf7a5939d9929
MATLAB
3,930
105
%PURPOSE: Calculate language lateralization in HCP subjects using %Fedorenko lab methods %INPUTS: t-statistic maps from story-math contrast (preprocessed and %fsaverage6 resolution), LanA atlas in fsaverage6 resolution %OUTPUTS: .csv file contatining lateralization values per participant %DEPENDENCIES: gifti %package(h...
cdbc54f832de616fa896c6c7e665ced13a2190bf94fafed2672697353d159b9e
MATLAB
3,930
98
classdef DataspaceLook < dspace.app.DataspaceLook_whiteTheme % Change the constants defined in this class to adjust the dataspace % GUI appearence. % % There are two blocks of constants: % (1) Looks % (2) Other Constants % % Best practice is to copy a block, comment out the origi...
c2ae655100689a6ef73cd12a393cd5084384e208661cd541f008dd56fe29088b
MATLAB
3,931
157
classdef HeatmapReader < handle properties (Constant) % sprintf-style pattern; tgt,frm,part, all 1-based filepat = 'hmap_trx_%d_t_%d_part_%d.jpg'; filepatre = 'hmap_trx_(?<iTgt>[0-9]+)_t_(?<t>[0-9]+)_part_(?<ipt>[0-9]+).jpg'; end properties dir % fullpath heatmap dir imnr imn...
f3c5d5ddcadd81247c65c223368ed0565947ad14312262eca241b5dcb917aa91
MATLAB
3,932
95
% MATLAB code provided by Seyed Mohammad Ali Rahmati % Affiliation: Biomechanics and Motor Control Lab, Department of Biological Sciences, Georgia Institute of Technology, Atlanta, GA. % Description: % This script computes a sensitivity analysis of the mean maximum muscle-tendon (MT) moment to changes in % muscle para...
351ba950ce442d4cde281a9b22b63fb45715735cab693f2e96def4694f00a0ca
MATLAB
3,934
92
function [ titleStr, settings, results ] = runMatlabFunction( dataview, settings ) % Run matlab commands on the current datasource. The matlab commands have % to be specified as a one or several matlab expressions that may use the variables: % % >> dsource % % >> dview % % >> p...
dfcad275c0e136c7afafcc5d346e553ca4217621d2d3079df88342e7b5d02f0b
MATLAB
3,934
101
function [dat, dimord] = read_shm_data(hdr, chanindx, begtrial, endtrial) % READ_SHM_DATA reads the data in real-time from shared memory % this is a helper function for READ_DATA % Copyright (C) 2007-2009, Robert Oostenveld % % This file is part of FieldTrip, see http://www.fieldtriptoolbox.org % for the documentatio...
fed6ed32f1e9ab5440b7387cb41a55bf1b596ad51051177d291cb3585e8ef4d6
MATLAB
3,934
127
%% autocov_to_var % % Calculate VAR parameters from autocovariance sequence % % <matlab:open('autocov_to_var.m') code> % %% Syntax % % [A,SIG] = autocov_to_var(G) % %% Arguments % % See also <mvgchelp.html#4 Common variable names and data structures>. % % _input_ % % G autocovariance sequence % % _outp...
c5896e43a44bc8e22700e80e44d7579f91baeaf9c156da932145e8892e815b7a
MATLAB
3,935
116
function [ferns,hsPr] = fernsClfReplaceFeature( data, hs, ferns, features_remove, varargin ) % Train random fern classifier. % % See "Fast Keypoint Recognition in Ten Lines of Code" by Mustafa Ozuysal, % Pascal Fua and Vincent Lepetit, CVPR07. % % Dimensions: % M - number ferns % S - fern depth % F - number...
f1506c242f69778e6a0d6443b28e1184099e84ee871100c62b9ea741b6578a95
MATLAB
3,935
100
function NewColorMap = y_AdjustColorMap(OriginalColorMap,NullColor,NMax,NMin,PMin,PMax, PN_Flag) % Adjust the colormap to leave blank to values under threshold, the orginal color map with be set into [NMax NMin] and [PMin PMax]. % Input: OriginalColorMap - the original color map % NullColor - The values between ...
4a0f3bd473b162accb76f63782d383b39da81b52012f92336569ca8fcafdeb5f
MATLAB
3,937
80
%% %NOTE - x axis in Figure 8d of the manuscript should be labelled radius, not diameter - this has been updated in this script %% clear all %% %Define Parameters [opt] = ParameterOptions(); %% %Define Parameters for Oscillating gradients opt.nOscillations=3; % Number of oscillations per TR opt.Waveform='Sine'; %...
c84763538199c1bf2e0ded0df9bf18c284706fdac235438bf0dbb623c4dd0149
MATLAB
3,938
101
function [posterior, out]=demo_Qlearning(choices, feedbacks) % // VBA toolbox ////////////////////////////////////////////////////////// % % [posterior, out] = demo_Qlearning([choices, feedbacks]) % Demo of Q-learning simulation and inference % % This is a simple example of reinforcement learning algorithm. % % Backgro...
c9b3ef750421d3995cfd768edac19be659d853c655798723f586ea0c39ea1ef3
MATLAB
3,938
102
function [w,output] = boundOptL1Stepwise(X,Y,lambda) % Fit the weights for L1 penalized multinomial logistic regression by % updating each component of each weight sequentially in O(ndc)time where n % is the number of training examples, d is the number of dimensions and c % is the number of classes. % % Inputs: % % ...
23885cec85e53035ae0ca9954477c4b55597bd3a918d0e811b8f20611ba23388
MATLAB
3,939
96
% MATLAB code provided by Seyed Mohammad Ali Rahmati % Affiliation: Biomechanics and Motor Control Lab, Department of Biological Sciences, Georgia Institute of Technology, Atlanta, GA. % Description: % This script computes a sensitivity analysis of the mean maximum muscle-tendon (MT) moment to changes in % muscle para...
5df1763db1c6b2405b24bd3a802505caae3507bda584069c954bd891198b6c72
MATLAB
3,939
152
function [tot_newbdye,tot_newbdyp]=create_nodes_perimeter(bdye,bdyp,dl) % gets a 2d bdy and creates new nodes along that bdy which are located 'dl' % apart each other along that bdy idx=1; tot_newbdyp=[]; tot_newbdye=[]; allnodes=unique([bdye(:,1);bdye(:,2)]); twod = false; if size(bdyp,2) == 2 bdyp(:,3) = zeros(s...
cb3e9cb45553f57fafe228fa6939f365f9c1644ead4d158b013e9a1f53ef0ce4
MATLAB
3,941
112
function ret = w_spm_ov_rgb(varargin) % RGB overlays % A shorthand to overlaying the absolute value of three different images % onto a displayed image in colours red, green and blue. The overlay images % are optionally masked and multiplied with a scaling image. The displayed % overlay images are the absolute value of ...
76637d1904a5c93431af549db3f4b4a564b3feeaefe1ca511faf412097b66485
MATLAB
3,942
118
function [] = randnetDecode(replaytrajectory, varargin) % plots.randnetDecode.m % % Plots decode results from run_net_decode.m % % Inputs: % - replaytrajectory: Bayesian decoding results cell array % - replaytrajectory{p.day}{p.ep}.<fieldname> % % Outputs: % - No output. Generates plots. % %% Parse inputs i...
d9d5fb04eec83baaf24a583ce940acdabd6b6b88c539ba016263ea7155e76ce6
MATLAB
3,942
91
%% This file runs and saves the results used in Figure 2. % for each set of Delta (2500 sets), 1000 simulations of randomly chosen % D,beta pairs are used to test the R^2 values of simulations. %% Machine and simulation parameters N = 1000; % Number of simulations NDirs = 64; SNR = [5,10,20]; % Signal-to-Noise ...
9a5ce6289c1837eb06c725eae7eec090819b9a79423473913060fb936f6523d9
MATLAB
3,943
152
%-------------------------------------------------------------------------- % OUTLIERS: outlier detection % % [ Xmd,OL ] = OUTLIERS( Xol ) takes as input a dataset Xol, which may % contain outliers, and returns as output a modified dataset Xmd, where % the outliers have been removed (i.e. every outlier is re...
3a8afc9e9ab57a17a785b61b5a608f076097a36d17a497fc2be9d1d8ce6e3701
MATLAB
3,945
116
function [negloglik, grad] = neglogLikBTDR_IncompObs_uneqvar_lambonly(pars,S,Ai,Ri,zzi,r,ni,g) % Negative marginal log-likelihood for basis of population regression % model % %[negloglik, grad] = neglogLikBTDR_IncompObs_uneqvar_S_fast(pars,Ai,Ri,zzi,r,ni,g) % %Computes negative log-likelihood under linear Gaussian reg...
08fd3f2bae17378ee2732d089bf0d9972959a341fb3509bc77b2a95ab9f414bd
MATLAB
3,946
145
function RGB = colormaplan(type,n,lim,cbar,nmax,ne) % <*LAN)<] % v.0.0.3 % % RGB = colormaplan(type,n,lim,cbar,nmax,ne) % Created Colormap and colorbar % type = 'pval' % using the rval result of nonparamteric.m % 'logP' % plot the -log10(p value) % n = n % resolution, default...
4585c215c2eb2808970e78954f8c8fbd1da8d39e37fb3282ca026f27fb030517
MATLAB
3,949
1
function GLAN = timefreq_stata_boot(GLAN,cfg) % REALIZA BOOTSTRAPPING A TIEMPO-FRECUENCIA % % % % cfg. % subject = [{}{}{}] % comp =[n1], 'all'; % INDEX OF THE CONDITION, % alpha =0.05; % bl =[ 0 0.4]; % BASELINE % boot = 1 % nrandom = 2000 % tail = 'both', 'lower', 'upper' % % % % Pab...
1a26f184b44aab46a600cdd4910295864f63a27be3fb11f298902fd948b3bd5e
MATLAB
3,951
92
function [ titleStr, settings, results ] = labelDatapoints( dataview, settings ) % Allows to manually label datapoints. A labeling variable is created that contains % labels per datapoint. Three labelling modes are available. % % This function can be particularly useful for continual labeling if it...
ac5557dc58b0bf9f5f240754523d1a9659ca8b798e15d79eb673e2bfac334f19
MATLAB
3,952
118
function mesh = move_detector(mesh) % MOVE_DETECTOR Moves MESH detectors onto the surface of the MESH % % [MESH] = MOVE_DETECTOR(MESH) Where MESH is a FEM mesh in the NIRFAST % format. % % See also MYTSEARCHN, MYTSEARCHN_FAST, LOAD_MESH, MOVE_SOURCE. % % Part of NIRFAST package. % H. Dehghani and S. Wojtki...
075b56d8998d21778e7ec05398efae6e4f1418b91aac70601f2f4279e2928fb4
MATLAB
3,953
92
function [] = visualise_replay_probability_matrix(log_odd,folders,folder_number) index_pval = intersect(find(log_odd.experiment==folder_number),... find(log_odd.pvalue >= log10(0.001) & log_odd.pvalue <= log10(0.005))); index_log_odd = intersect(index_pval,find(... log_odd.normal_zscored.original>= -1 & ... ...
7807b9da2a985d0fdff59fb5cf9274352dfecab7e48ad8ad067b839bde8b806f
MATLAB
3,954
127
if exist('myPool')&&myPool.Connected~=0 disp('Parpool active...') else delete(gcp('nocreate')) myPool=parpool;% end GPU_Accelerate=0; QuaSOR_PixelSize_nm=21 AZBoxSize=50; CenterCoord=[26,26]; AZBox_XData_px=[0:1:AZBoxSize]; AZBox_XData_px=AZBox_XData_px-AZBoxSize/2; ProfileCoords=[1:1:AZBoxS...
0d125aae0381d6ee629348add917d1049baa9c867f71ee427c00eb5d0a49659e
MATLAB
3,957
160
function [p] = violinPlotsStats2(data,opts) % significant box of violins % setup commonly used values nCond = size(data,2); nObs = size(data,1); nPt = 200; if ~isfield(opts,'yl') || isempty(opts.yl) yl = [min(data(:)) max(data(:))]; opts.yl = yl+diff(yl).*[-0.1 0.1]; end if ~isfield(opts,'sigLevel') || isempt...
fe792bf1c4ed36e0649bcfbab442a5cd40ac783003e2f55529a948a1fa32de08
MATLAB
3,958
64
function [ ] = bemf1_graphics_dipole_zoom(strdipolePplus, strdipolePminus, strdipoleCurrent, type) % Dipole(s) plot with several options % type = 1 for a planar plot in the coronal plane (XZ) % type = 2 for a planar plot in the sagittal plane(YZ) % type = 3 for a planar plot in the transverse plane(XY) % ...
096578bf32d18c1c51c46fb5be196eaa785fbf0724bd97a1bf02d534a9bf1bcb
MATLAB
3,959
170
classdef ParameterVisualization < handle % Parameters that want a visualization when they are being set should % subclass this abstract base class properties hTile hAx lObj prm propFullName is_ma = false; is2stage = false; is_ma_net = false; stage = 1; end methods (Abst...
f31f8f4c9f9ceaac51a891f9924ad05274c7d1e3448350d66b6ed6fa3dab5fbe
MATLAB
3,959
139
% calc_sig_struct_view global dNames % dNames = {'TinC', 'TinI', 'Ramp', 'PC1', 'WhatD', 'WhenD', 'MinC', 'MinI'}; disp(['Finished generating signals until ' dNames{d}]) par = par_sess{1}; fw = ones(1, 50)/50; tsl = find(par.tsl >= 0 & par.tsl <=0.6); sig_coh = []; session = []; sigSL = []; sigRL...
288053bf4cfde4fad46fe527fb5cc60d535fe36802a2da36ed98e61e4fd8abc5
MATLAB
3,960
116
function sp_combat_est(input_fn,avg_fn,pkg_dir) threshold = 10; % threshold based on intensity histgram (specify other values if necessary in your case) seed = 60000; % initial number of seeds used in superpixel parcellation (specify other values if necessary in your case) % by defauly, the mask is 121*145*121...
297f1ed950aa0facf747be206f555fa0ecf5a7a7ec125b31a0535446f7177ec4
MATLAB
3,960
94
function [varargout] = rfbevent(varargin) % RFBEVENT sends a keyboard or mouse event to a VNC server % % RFB ("remote frame buffer") is a simple protocol for remote access to % graphical user interfaces. Because it works at the framebuffer level it % is applicable to all windowing systems and applications, including X...
7d43e03e3be808dc454584eeeb707bf0054cfada400ccd30d018ffc6bf10b469
MATLAB
3,960
107
function varargout = jbm_skeletonGUI3(varargin) % JBM_SKELETONGUI3 MATLAB code for jbm_skeletonGUI3.fig % JBM_SKELETONGUI3, by itself, creates a new JBM_SKELETONGUI3 or raises the existing % singleton*. % % H = JBM_SKELETONGUI3 returns the handle to a new JBM_SKELETONGUI3 or the handle to % the exis...
ef611260a16b90953f3c27a26945fed3fee6aec1bdfebc56340a011a5ed4e595
MATLAB
3,960
109
% testRandnetCalculator.m % % Adapted from simulateNetwork.m. Tests that all randnet_calculators produce % identical spike results. % %% Set up addpath("../src") Config = utils.setConfig(); [s,simParam.sim_git_hash_string] = system('git rev-parse HEAD'); myPlotSettings %% Simulation options simParam.saveFlag = ...
5c894c530109d814b4a0ebb761d48b6fa2bba4ba935a7f56a51ff6e010a4d3f4
MATLAB
3,962
65
function [ ] = bemf1_graphics_dipole(strdipolePplus, strdipolePminus, strdipoleCurrent, type) % Dipole(s) plot with several options % type = 1 for a planar plot in the coronal plane (XZ) % type = 2 for a planar plot in the sagittal plane(YZ) % type = 3 for a planar plot in the transverse plane(XY) % type ...
b7c3a057da9243740240e200c1697137caefc5a101beafdcdf63d2831baecce9
MATLAB
3,962
115
function [basis,gradbasis]=legs(x,dir,n,scale) % usage: [basis,gradbasis]=legs(x,dir,n,scale) % % returns the values and directional derivatives of (n+1)^2-1 basis functions % constructed from spherical harmonics at locations given in x and, for the % gradients, for (in general non-normalized) directions given in di...
5ef8866e0c8a9a2572722edb41ebee2e5b8f4ec4ce0b3a87ef5ad0aecead3d8c
MATLAB
3,963
70
%% Simulation % Figure 1B/1C cd('/data/wheelock/data1/people/Cindy/DIAN'); % where the centrality results were saved savedir = './postcovbat_individual_signed_complete_Z_/'; load(fullfile(savedir,'Centrality.mat')); load('Mutation_CDR_bins_NCmatched.mat') refgroup = bins==4; % NC match 1 meanS = sort(mean(S(refgroup...
ad6ac2b34e8c7e398005ba5e7be80f85e5701aef787977366276db37bdc2e0a9
MATLAB
3,965
96
function [vertices, fs_coords] = CBIG_RF_MNICoord2fsaverageVertex(mni_coords, surf_mesh) % [vertices, fs_coords] = CBIG_RF_MNICoord2fsaverageVertex(mni_coords, surf_mesh) % % This function takes in RAS coordinates in MNI152 space, to convert to the corresponding % vertex number and coordinates in fsavearge surface spa...
53868e28a8bfaf09a0596d9c527d2b5c8b821abc1821331476fde6028b7ba443
MATLAB
3,970
122
clear glob_avg1 glob_avg2 glob_avg3 glob_avg4 glob_avg5 glob_avg6 [traces_int_on] = extract_variables ('traces',[],resultsPath, 'all', [],conditionType,conditionValue); [pyr_id,int_id] = extract_variables ('nCells',[],resultsPath, 'pyr', 'int',conditionType,conditionValue); [si_img] = extract_variables ('si_img',[],re...
3060f91a3dd6e59e70a44693ecd9517a979596442791f42dc02c1f484e1d5304
MATLAB
3,971
135
%% plot clusterperm fig5 % load up combined files with permutations % cluster to get p-vals % plot clear; %% combine if ~exist('spatial_neighbors','file'); eeglab nogui; end timelock = 'readyBS'; file1 = sprintf('RegressPermuteStuff2_%s.mat',timelock); if ~exist('xTimes','var'); load(file1, 'xTimes','timesToPlot');...
62ab313e8788c8eed3bc915cff72d7de67a35534956a24a8500c60dcb6333d75
MATLAB
3,972
75
function lan_master_gui_spec_comp(LAN_var) LAN = LAN_var; comp_ax = figure(); cfg_control(1) = uicontrol('style', 'text', 'units', 'norm', 'position', [.3 .92 .44 .05],... 'string', 'Test : ', 'horizontalalignment', 'right'); cfg_control(2) = uicontrol('style', 'text', 'units', 'norm', 'position', [.75 .92 .2 .05...
199c4aec24ff0f93e308e958337351abddbbb1e0440732b8935f6504d6b7b2f1
MATLAB
3,974
103
function tfrsave(name,tfr,method,sig,t,f,p1,p2,p3,p4,p5); %TFRSAVE Save the parameters of a time-frequency representation. % TFRSAVE(NAME,TFR,METHOD,SIG,T,F,P1,P2,P3,P4,P5) saves the % parameters of a time-frequency representation in the file % NAME.mat. Two additional parameters are saved : TfrQView and % TfrView. If...
5f719690c46995f7c050268c1d9a837d9a4a413b8abb027e581293e919b23671
MATLAB
3,975
83
classdef CBIG_preproc_100subjects_clustering_unit_test < matlab.unittest.TestCase % % Target project: % CBIG_fMRI_Preproc2016 % % Case design: % CBIG_fMRI_Preproc2016 already have unit tests, here we % call its "100subjects_clustering" unit test and automatically % ...
a816cdcf661a18d70944493ade0f043eaa6574fc1adb7976819c2b21cee79305
MATLAB
3,975
65
function [ ] = bemf1_graphics_dipole_thicc(strdipolePplus, strdipolePminus, strdipoleCurrent, type) % Dipole(s) plot with several options % type = 1 for a planar plot in the coronal plane (XZ) % type = 2 for a planar plot in the sagittal plane(YZ) % type = 3 for a planar plot in the transverse plane(XY) % ...
0d1570857d260e91bcb7cea694c306676403404f388f2ecef5efbf30cbb2247d
MATLAB
3,976
159
function [DJS,b,muy,Vy] = VBA_JensenShannon(mus,Qs,sources,w,base) % evaluates the Jensen-Shannon divergence (DJS) % function [DJS,b] = VBA_JensenShannon(mus,Qs,sources,w,base) % This function evaluates the DJS: % - either from a set of N-D Gaussian densities, in which case those are % defined through their first- and ...
861dff0ea8d626e7a4f901c4e6a416591ca091f4f6138d20388c9da488967b44
MATLAB
3,978
112
function [allVec,allTs,allTs_marker,allTs_trigger] = Closed_Loop_ETP(fullCycle) % Closed-loop algorithm using ETP method to detect peak based on the % adjusted period % allVec: Raw EEG (channel*sample) % allTs: Timestamp of each sample % allTs_marker: Timestamp of event markers % allTs_trigger: Timestamp of the s...
e8590cfe77df45cc9c519a36def4786ace889ae6ec9c06bb28227ac30b063bf6
MATLAB
3,981
104
function [version] = hasyokogawa(desired) % HASYOKOGAWA tests whether the data input toolbox for MEG systems by % Yokogawa (www.yokogawa.com, designed by KIT/EagleTechnology) is % installed. Only the newest version of the toolbox is accepted. % % Use as % string = hasyokogawa; % which returns a string describing th...
40e79d82c22ba0fc51f6eda8467ef98c7af28ed5be5cbf482723dadd2e1ecf58
MATLAB
3,982
118
function [X,Y,mX,sX,mY,sY,It,diff,Xrec,Yrec,T,P,C,W,Wstar]=plsmbtsr2(X,Y,A) % TSR 2 for PLS-MB (adapted from PLS-ME) % % INPUTS: % X: predictor data matrix with NaN for the missing data % Y: response data matrix with NaN for the missing data % A: number of PLS components % % OUTPUTS: % X: original predictor data matri...
c6be4b0cac6044ca4ee1fea895f29bf4dc5723bdd38df7ba978dbb766f582f6f
MATLAB
3,984
95
function [hdr] = read_shm_header(filename) % READ_SHM_HEADER reads the header in real-time from shared memory % this is a helper function for FT_READ_HEADER % Copyright (C) 2007-2010, Robert Oostenveld % % This file is part of FieldTrip, see http://www.fieldtriptoolbox.org % for the documentation and details. % % ...
80c0c8ffadd632ad5086190b3a081df85a172b26c37b71340f7163002801ef11
MATLAB
3,986
169
function newmatrix = wlAux_mergeTrialsChannels(oldmatrix, comparefunc) % function newmatrix = wlAux_mergeTrialsChannels(oldmatrix, comparefunc) % % This function merges an event matrix's events across trials and channels % (so that each band has a single trial with a single channel). Duplicate % events (as detected by...
dc8ff8584286c94fcddbf0a40bb7b7580b2d85de33478dab95094ec4d9a2fcb6
MATLAB
3,986
100
parfor total_wab_queue = 1:(shifting_key_n.*length(stitching_queue)) [kk, mm] = ind2sub([length(stitching_queue), shifting_key_n], total_wab_queue); image_1_max = zeros(z_truncate,stitching_queue(kk).res_i); image_2_max = zeros(z_truncate,stitching_queue(kk).res_i); img_te...
29991c1d8dc3a040b5f819b86196d7ad7befaf2d8847d999f55f2f31ec3a8027
MATLAB
3,987
93
function varargout = jbm_fiducialFinderGUI3(varargin) % JBM_FIDUCIALFINDERGUI3 M-file for jbm_fiducialFinderGUI3.fig % JBM_FIDUCIALFINDERGUI3, by itself, creates a new JBM_FIDUCIALFINDERGUI3 or raises the existing % singleton*. % % H = JBM_FIDUCIALFINDERGUI3 returns the handle to a new JBM_FIDUCIALF...
c751eb120b6be240c1bdcbe4dfa360120fd0cc9ecdc10f5a89f5bd53218e95da
MATLAB
3,990
136
function ft_documentationreference(outdir) % FT_DOCUMENTATIONREFERENCE is a function to maintain the online documentation. % % Normal users will not be calling this function, but will rather look at % http://www.fieldtriptoolbox.org/reference where the output of this function can % be found. % % See also FT_DOCUMENTAT...
bca4cf2a71fa9e6076b6e162551335a2f8270ff2b662af345659daaec749f94b
MATLAB
3,991
145
function LAN = fourierp_lan(LAN,cfg) % v.0.2 % <*LAN)<| version % cfg. % chn = numero del canal % method = 'mt' (multitaper, otherway fourier) % tapers = [TW K] where TW is the % time-bandwidth product and K is the number of % ...
6dcdbd4889de23503b6e8034d954312a6031c5a05be040558b06aba89d282962
MATLAB
3,994
126
function [EI,Pth,Qthth] = lme_mass_RgEI(X,Zcols,W,CBhat,L,phi,ni,GD,invG) % [EI,Pth,Qthth] = lme_mass_RgEI(X,Zcols,W,CBhat,L,phi,ni,GD,invG) % % Expected information matrix of the restricted log-likelihood of a whole % region. % % Input % X: Ordered design Matrix (according to time for each subject). % Zcols: Vector w...
9c47ffd1baf42be90bc8a746e537be0e7856c12c75e4ee01dc9a675b304e64ad
MATLAB
3,995
110
function I = bfGetPlane(r, iPlane, varargin) % BFGETPLANE Retrieve the plane data from a reader using Bio-Formats % % I = bfGetPlane(r, iPlane) returns a specified plane from the input % format reader. The index specifying the plane to retrieve should be % contained between 1 and the number of planes for the ser...
9b7368ac6b268e94e8ba1999eeee32777c2c1ecd2ba5e3dccefd9249bb788b5c
MATLAB
3,996
134
function Y = ttm(X,V,varargin) %TTM Sparse tensor times matrix. % % Y = TTM(X,A,N) computes the n-mode product of the sptensor X with % a dense matrix A; i.e., X x_N A. The integer N specifies the % dimension (or mode) of X along which A should be multiplied. If % size(A) = [J,I], then X must have size(X,N) =...
76ef1afc1f374d25d77890740e57ae46e9a6687ebd3a0baec8365e794c5853ed
MATLAB
4,000
117
%% Calculating Kappa Coefficient of Agreement % This example illustrates hows JAGS handles a more complex hierarchical Bayesian model and compares the % output from JAGS with the output from WinBUGS % % The model was taken from the WinBUGS course developed by Michael Lee and Eric-Jan % Wagenmakers at <http://www.ejwag...
d09d71f158e3a1fc15c7d3560313136989932eccab08dd9972a827d8ec4d5427
MATLAB
4,002
126
close all; clear all; clc; Rii=150; %Ohm*cm logituinal resistance Rmm=1000; %Ohm*cm2 membrane resistance a=0.0002; %cm neuron radius ri=Rii/(pi*a^2); %Ohm/cm rm=Rmm/(2*pi*a); %Ohm cm lambda=1*((rm/ri)^0.5) %cm V0=0.03; %0-1mV 100 intervals potential change per particle d=[0.25*a 0.5*a 0.75*a a 2*a]; %part...
3490a6024ef2e6d84ee7bdb8e75063988df12708b1d9a785b9e2143ef76cf64c
MATLAB
4,003
129
%% Plot Figure 2 function figureOut = PlotFigure2(xhatArr, xArr, params, Rs, figNr) % Plot Ahat, Bhat and R in upper subplots, pain (xhat) and tissue % damage (x) in lower subplots, all for different values of R % ==== Input === % perceived pain: xhatArr = [nSim by n by nR-array] of xhat % ...
1ebcaaa28c54af15b29e989f44c6d095e4f73a7b351aa18e39213783f747c594
MATLAB
4,006
131
function proc_separateDigits(epo, fname, fpath, trigger_name) %% set max events max_events = 6000; % all 3 conditions %% select trials and reset signal to baseline % D1 [epo1_short, epo1_long] = get_separatedEpoStruct(epo, max_events, trigger_name{1}); % D2 [epo2_short, epo2_long] = get_separatedEpoStruct(epo, max_e...
6f2452460436c42681cea2cb59b51fef6e5ed03e52dad034420f8ee79c91f899
MATLAB
4,006
109
function HumanOdorRep_plot_decoding_results(data_path,... decoding_results_file, plot_title, plot_name, y_limits, save_path,... figsize, Err_type) % function HumanOdorRep_plot_decoding_results(data_path,... % decoding_results_file, plot_title, plot_name, y_limits, save_path,... % figsize, Err_type) % %...
cd0a943c7755c8cd970ae880f931b3db9423cc97e44052ccd7fe614831c671ac
MATLAB
4,006
103
% AUTHORSHIP % Primary Developer: Connor Meehan <connor.gw.meehan@gmail.com> % Secondary Developer: Stephen Meehan <swmeehan@stanford.edu> % Bioinformatics Lead: Wayne Moore <wmoore@stanford.edu> % Provided by the Herzenberg Lab at Stanford University % License: BSD 3 clause % classdef DataSource m...
47cfc04a4b7e9c73c83f7a31f6cf8eea71969440a9cc09826d36b064bb4e3e6b
MATLAB
4,008
108
%----------------------------------------------------------------------------------------- % Plot firing rate of odor-modulated neurons to liked vs. disliked odors % % Kehl et al. 2024 (DOI:XX) % Single-Neuron Representations of Odors in the Human Brain % Figure 4d % Author: Marcel Kehl % License: MIT License %-----...