sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
81a30fa7894dbcc151f5bcb2be3e9f923335e055fe6e5c9d298365afd62f4e14 | MATLAB | 2,810 | 70 | %%%% Compute the GCA on residual %%%%%%%
function [ResultMap1,ResultMap2,ResultMap3,ResultMap4,ResultMap5] = restgca_residual(AROITimeCourse, ABrain4D,Order,theCovariables)
% [nDim1, nDim2, nDim3, nDim4]=size(ABrain4D); % component by QX
nDim4 = size(AROITimeCourse,1);
% AROITimeCourse = r... |
59c5b8cb54ee4166f02c991a1c3fb002da990645dc73801b121875602873b8e1 | MATLAB | 2,814 | 72 | function loc_list_clusters_data_table_short(data)
counter = 0;
for i = 1:length(data)
data_to = unique(data{i}.area);
if length(data_to)>1
counter = counter+1;
data_to_send{counter} = data{i};
end
end
if exist('data_to_send','var')
f = waitbar(0,'Extracting Data Table Informati... |
8c251ced2e69f546136deb0852fd373f512bdeeb3471905c314209c9176778c0 | MATLAB | 2,818 | 108 | function hh = trisurf_customized(tri,varargin)
%TRISURF Triangular surface plot
% TRISURF(TRI,X,Y,Z,C) displays the triangles defined in the M-by-3
% face matrix TRI as a surface. A row of TRI contains indexes into
% the X,Y, and Z vertex vectors to define a single triangular face.
% The color is defined by th... |
44bcb0d55fa17c2f169aa19b2caa381add4be1c66bdc5cb48a8c8d596882ea47 | MATLAB | 2,823 | 71 | function [data_clustered,data_not_clustered] = loc_list_dbscan_elbow(data)
answer = inputdlg({'Enter Minimum Number of Points:'},'Input',[1 50],{'5'});
if isempty(answer)~=1
db_points = str2double(answer{1});
for i=1:length(data)
counter(1) = i;
counter(2) = length(data);
[data_cl... |
a1f5a1e806567b08afa8695a166526344e01f7b2f41877ff49bccbc6d012297f | MATLAB | 2,827 | 91 | %% read file
%[~,A,~]=xlsread('L:\Elite\LARS\2014\mars\B5inputStim.xls');
%[~,A,~]=xlsread('L:\Elite\LARS\2014\mars\B5inputUnstim.xls');
%[~,A,~]=xlsread('L:\Qexactive\Berit_Sissel\B005\B5Stimonly.xls');
[~,A,~]=xlsread('L:\Qexactive\Berit_Sissel\B005\B5Unstimonly.xls');
A=A(2:end,1);
size(unique(A),1)
%[~,B,~]=... |
30089284364742afa64824ee5aa7a2faa52297b53a5eb2bbcd8777e51ad63f8e | MATLAB | 2,828 | 90 | %% download AICDA sequence
AICDA=getgenpept('Q9GZX7')
AICDA.Sequence
%% in silico trypsin digestion of AICDA with Trypsin
[AICDApartsT, AICDAsitesT, AICDAlengthsT] = cleave(AICDA, 'trypsin','missedsites',1)
plot(AICDAlengthsT)
hist(AICDAlengthsT)
size(AICDAlengthsT)
%% add PO3 to S/T/Y and calculate+w... |
28c965117c55d9ca3e4d55a6170a19a2a6a9d09d1d51cecfe3786f5f6d8494da | MATLAB | 2,837 | 102 | function [g2g,Duration_off,Count_off,Rate_off,Duration_on,Count_on,Rate_on,NonREMdur_tot,NPD]=get_off_data_trial_pt5(SD_Data_Veh_Pyr,i,ii,NPD,Trial)
x=SD_Data_Veh_Pyr(i).RatxData(ii).SD_Spike_Info;
xx=struct2table(x);
xxx=table2cell(xx(:,1));
NPD=[ NPD sum(~cellfun('isempt... |
e378640995df775c5f85088dea779dfe8b334efae6d6cd966fa1b907d0659b61 | MATLAB | 2,837 | 47 | %% *** Temporal pattern recognition in the human brain: a dual simultaneous processing *** %%
% EXAMPLE OF AUTOMATIC CREATION OF LEFT AND RIGHT HEMISPHERE IMAGES FOR WORKBENCH
% Leonardo Bonetti
%Aarhus, DK, 29/01/2021
%% CREATING ONE IMAGE PER HEMISPHERE USING WORKBENCH BRAIN TEMPLATES
%defining all paths where y... |
2edd0ef9daa8f262a66c009ff9bace8f273a1cdfa0f15d8c4fe26c22ff14ea2b | MATLAB | 2,842 | 90 | function Plot_subj_stairs(data_dir,save_dir,selectedK,subj)
%
% Plot the state time course for a specific participant considering K PL
% states as a stairs plot
%
% INPUT:
% data_dir directory where LEiDA results are stored
% save_dir directory to save results for selected optimal K
% selectedK K defined ... |
e266007e9e56eb91b2c61daca6501038561a311e53ea5c4146103c3a385e62db | MATLAB | 2,848 | 98 | %--------------------------------------------------------------------------
% Till Habersetzer, 24.07.2025
% Communication Acoustics, CvO University Oldenburg
% till.habersetzer@uol.de
%--------------------------------------------------------------------------
close all
clearvars
clc
%% Load data
%-------------------... |
28673ee2e20b8666d3f1c60a51cd7ded6ac95322071f09c0c1ee97cc4acaa298 | MATLAB | 2,860 | 96 | clear
clc
% error('Do not rerun');
onam = 'ParTable_260303.mat';
maindir = [path_ludisc '\common\DATA\MIPCART pilot\Pilot MRI\'];
analdir = [path_ludisc '\common\DATA\MIPCART pilot\Analysis\'];
% fnl = fix_findFiles(maindir, '*roi_tumor.nii.gz');
fnl = load('mipp_fnl_roi_dMRI'); fnl = fnl.fnl;
%%
analver = 'analys... |
83a110dcb33afc8a59979bcbe0a0e8f96f3672d9c22781c371d172511aa60367 | MATLAB | 2,860 | 68 | function spt_tracks_maximum_distance_traveled_callback(data)
input_values = inputdlg({'number of bins:'},'',1,{'100'});
if isempty(input_values)==1
return
else
number_of_bins = str2double(input_values{1});
figure()
set(gcf,'name','Tracks Distance Histogram','NumberTitle','off','color','w','... |
d713c83062428aacec575c073648b15b32db10f945975f96b1531dd608664148 | MATLAB | 2,870 | 84 | function Plot_C_vector_ordered(data_dir,save_dir,selectedK,centroid,parcellation)
%
% Plot the selected centroid in vector format with the labels of each area
% and ordered by contribution
%
% INPUT:
% data_dir directory where LEiDA results are stored
% save_dir directory to save results for selected optimal ... |
b575eca956a81c346155864152cacf56933ce21f660db37f04be790129a48ca8 | MATLAB | 2,871 | 86 | function scatterbar3(X,Y,Z,width, varargin)
%SCATTERBAR3 3-D scatter bar graph.
% from: https://fr.mathworks.com/matlabcentral/fileexchange/1420-scatterbar3
% SCATTERBAR3(X,Y,Z,WIDTH) draws 3-D bars of height Z at locations X and Y with width WIDTH.
%
% X, Y and Z must be of equal size. If they are vectors, th... |
9aa4a92f2e106df4342b4c79782db205406ce263a8884e0faf84b3b591dbc75e | MATLAB | 2,875 | 70 | function [selChan, dataTF, values] = eegSelectVC(parameterSettingsVCsel, dataVC, dataTF)
%% [selChan, dataTF, values] = eegSelectVC(parameterSettingsVCsel, virtChannels, dataTF)
tc_struct2ws('caller', parameterSettingsVCsel)
% only for saving, to have the set (index, value, pos) complete
ROIpos = dataVC.ROI;
% test wh... |
5cecf4f4efec41f70f27b0625195c54cdd09af90f9a04a9ade6a34b638823b70 | MATLAB | 2,876 | 77 | function O = Induced_Resp_SingleSubj_AarhusClust( S )
O = [];
% It computes time-frequency analysis (induced responses) using Morlet
% wavelet.
% It sends one job for every subject.
% Meaningful only for Aarhus cluster.
% It should be used in connection with "InducedResponses_Morlet_WholeBrain_LBPD_D.m"
% INPUT: ... |
2ab2d21b47e0004778948270c91188f31e3ec88a403d5af2de833ad42e9c30e6 | MATLAB | 2,881 | 91 | function [Rlatt,Rrp,ind_rp,eff] = latmio_dir(R,ITER,D)
%LATMIO_DIR Lattice with preserved in/out degree distribution
%
% [Rlatt,Rrp,ind_rp,eff] = latmio_dir(R,ITER,D);
%
% This function "latticizes" a directed network, while preserving the in-
% and out-degree distributions. In weighted networks, the fu... |
15bc169f1a47b98b2e91bdc1a404c3d71aa778af470a85b5ee9af4dea0183835 | MATLAB | 2,883 | 86 | function [ResultMap1,ResultMap2,res]=gca_coef_new(AROITimeCourse, ABrain4D,Order,theCovariables)
% [ResultMap1,ResultMap2,res]=gca_coef_new(ROIsignals1(IOrds,:), maskedSignal(IOrds,:),Order,theCovariables(IOrds,:))
ResultMap1={};ResultMap2={};
nDim4 = size(AROITimeCourse,1);
AROITimeCourse_now = AROITimeCourse(Order+1:... |
5648c9c3fd9e4039de18df2fe9df8a3bb2b49d96e1987de253dee690218dd650 | MATLAB | 2,892 | 83 | function run_all_analysis(rootPath, subjectIDs, subjectInfo, regionDef, exclusionFile, opts)
% run_all_analysis
%
% Master script for the insular iEEG chronic neuropathic pain analysis.
%
% This script runs the analysis pipeline in the order used for the manuscript.
%
% Required inputs:
% rootPath : roo... |
341f2b98f003aa01503a775c7a586c046453697d09529d284935c413a17b6631 | MATLAB | 2,895 | 101 | function [Inds]=optimizePowerAndSpace(varargin)
%% [Inds]=optimizePowerAndSpace(varargin)
% optimizes a set of coordinates and corresponding values such, that the
% distance between the maxima in each region are increased, while
% preserving the power as much as possible.
%
% Key value pairs can be:
% 'coords' - the po... |
5f17586bea928b6cc1a716806394accb7fbf8b498cf593495d582124c9c7cb5a | MATLAB | 2,897 | 63 | function [decharges,dechNorm,varList] = extractIndivSignals(tiffData,cellMap,dSiz,ROI_list,varMin)
% This function extracts the fluorescence signal of each ROI in *ROI_list*
% over the entire recording *tiffData* and removes the signals with less than
% *varMin* amplitude variations in their normalized signal compared ... |
af361a1d7d44f20f077d7daef37ac04f448c0e35d1d033d8f79830bb01eae598 | MATLAB | 2,904 | 103 | addpath('/scratch/nbe/braintrack/ecog/SubjectNY394')
addpath('/m/nbe/scratch/braintrack/fieldtrip')
ft_defaults
%% load electrode locations
fid = fopen('NY394_MRI_coor.txt');
elec_info = textscan(fid,'%s %f %f %f %s');
fclose(fid);
% create FieldTrip electrode structure
% elec = [];
elec.label = elec_info{1};
... |
59332486e04d5499bbb8cad8f0f9845bb0b7fdf5328d200cb9b17d92f24c1499 | MATLAB | 2,907 | 90 | function [ ] = plotting_ROIs_horzbars_LBPD_D( R )
% It plots horizontal bars describing the frequence of a specific
% parameter (originally thought for verteces degree) for each ROI.
% This relies on previous codes by Joana Cabral.
% INPUT: -R: cell array with for each cell a 3 x number of ROIs cell
% ... |
fb2b27f31526628539f0c799a0e3071058e62521fed107e588045c007c3f8856 | MATLAB | 2,913 | 74 | function [trl, event] = my_trialfun_audiobook(cfg)
%--------------------------------------------------------------------------
% Till Habersetzer, 27.06.2025
% Communication Acoustics, CvO University Oldenburg
% till.habersetzer@uol.de
%
% MY_TRIALFUN_AUDIOBOOK Defines trials for continuous audiobook EEG/MEG data.
%
%... |
da76201ff9adfe0f6c0cdab50a1c82d1c4ac1a289ebee476ce5d2483d87aac1a | MATLAB | 2,925 | 102 | function signal_corrected = nst_tddr_correction( signal , sample_rate )
% This function is the reference implementation for the TDDR algorithm for
% motion correction of fNIRS data, as described in:
%
% Fishburn F.A., Ludlum R.S., Vaidya C.J., & Medvedev A.V. (2019).
% Temporal Derivative Distribution Repair (T... |
bca6379f018817dac481b9398ae4d78cf6a4b888ee6d3208239a4722f1e69ac3 | MATLAB | 2,926 | 90 | function make_motif34lib
%MAKE_MOTIF34LIB Auxiliary motif library function
%
% make_motif34lib;
%
% This function generates the motif34lib.mat library required for all
% other motif computations.
%
%
% Mika Rubinov, UNSW, 2007-2010
%#ok<*ASGLU>
[M3,M3n,ID3,N3]=motif3generate;
[M4,M4n,ID4... |
782fee9101d228516de52a6fbd72eb546b5856f8457443d7f71e5001314b65e6 | MATLAB | 2,927 | 72 | function spt_tracks_total_distance_traveled_callback(data)
input_values = inputdlg({'number of bins:'},'',1,{'100'});
if isempty(input_values)==1
return
else
number_of_bins = str2double(input_values{1});
figure()
set(gcf,'name','Tracks Distance Histogram','NumberTitle','off','color','w','un... |
87e3ad6dcb71541ac4cdd46d82e093be5e7e1541c5c3e03ab8a1ad54782e432c | MATLAB | 2,928 | 76 | function BC=betweenness_wei(G)
%BETWEENNESS_WEI Node betweenness centrality
%
% BC = betweenness_wei(L);
%
% Node betweenness centrality is the fraction of all shortest paths in
% the network that contain a given node. Nodes with high values of
% betweenness centrality participate in a large number ... |
82b8c41377ee11633a16cd0441dbdc8237c27907643f87e298e8ce1f3e5cd419 | MATLAB | 2,936 | 105 | function Ip = get_vertices_fmri(D,MaskImages,Nm,Pflag,remove_vert_thr,mods);
Np = length(MaskImages);
M = D.inv{D.val}.mesh.tess_mni;
Smooth = 0;
Ip = cell(1,Np); allIp = [];
for p = 1:Np
V = spm_vol(MaskImages{p});
q = spm_read_vols(V);
q = q > 0.5; % !!depends on nature of mask
% q... |
9eed5666ba46d3b1c9233b0b83808011faae9a8e3b400c115eb688c890387ed8 | MATLAB | 2,937 | 83 | classdef datasets_tests < matlab.unittest.TestCase
% Tests all data loaders.
methods(Test)
function test_conte69(testCase)
testCase.assumeTrue(exist('gifti', 'file'), 'Gifti library not found.');
[surf_lh, surf_rh] = load_conte69();
[sphere_lh, sphere_rh] = load_conte6... |
5d62464f28a92eda9d86a47e694c1fd3b43ecd68781ad0a746a2f83f3051d4da | MATLAB | 2,943 | 96 | function [sStudy, ResultFile] = nst_bst_add_surf_data(data, time, head_model, file_tag, comment, ...
sInputs, sStudy, history_comment, surface_file, ...
sparse_storage, extra)
... |
4f650b7fc45aeeadcdede229bc522dfd74bef5e3d2185e7a5b274f7d455c221b | MATLAB | 2,947 | 93 | function [coreg_path,coreg_other_path] = Cor_multi_spm(reference_path,source_path,varargin)
addpath('/home/user/matlab/spm12');
output = struct;
[d, f, e] = fileparts(source_path);
output.rstructural = [d filesep 'r' f e];
if exist(output.rstructural,'file')
disp('Corregistration already performed');
coreg_... |
aa91cdd06e53307eebdb656a43c6f0a7c1234f83711ed5e068a9df3a48a74526 | MATLAB | 2,952 | 92 | % Preprocess EEG for the song familiarity project
%
% Other m-files required:
% EEGLAB toolbox https://github.com/sccn/eeglab
% /private/dm_prep.m
% /private/dmlab31.locs
% /private/dmlab33.locs
% Author: Cameron Hassall, Department of Psychology, MacEwan University
% email address: hassallc@macewan.ca
% W... |
941cc62b7e22c1d47ea9c651043bd5767134322627bc2ae8321554c008497665 | MATLAB | 2,955 | 52 | function [ PlotTitle ] = GeneratePlotTitle(SampleName, NumberOfStates, model_params, Min3Traj, CellLocs, CellJumps, CellJumps_used, CellFrames, TrajNumb)
%GeneratePlotTitle makes a title for a plot
% makes titles for both single-cell and merged datasets
global FitLocError ModelFit UseWeights
% main title
main_name ... |
c64d07f3e0d62b1a88e76ce33322cb0ffce9000dd6e5730770b77e4f131b9219 | MATLAB | 2,961 | 88 | function [map,vf] = dFmap(images,mask,dFlevel,framerate,i_framerate,tfilt,invert,vfup,vfdown)
exposure=1/framerate; %in ms
[rows,cols,num] = size(images);
images=double(images);
order=3; framesize=5;
%% Normalise APs
Imax=max(images,[],3); %Find maximum value of each pixel
Imin=min(images,[],3); %Find minimu... |
22ace83fbeee30127564acd02edfa9024d63ea83b869acc501f662864533e281 | MATLAB | 2,964 | 50 | function spt_tracks_displacement_histogram(data)
input_values = inputdlg({'Frame Intervsl (s):','Use Entire Trajectory (0 or 1):','Gaps Allowed (0,1 or 2):','Number of Delays:','Jumps to Consider:','Bin Width','Maximum Jump:','dZ'},'',1,{'0.0075','0','1','8','4','0.01','5.05','0.7'});
if isempty(input_values)==1
... |
ca825b21e1e7d390e30653f742d0fb99dfb5b77c3bbfabcbb243a0b6c75d786b | MATLAB | 2,964 | 83 | function [ PDn ] = Extract_BrainCluster_Information_3D_LBPD_D( S )
% It extracts information about the clusters of the provided brain image.
% INPUT: -S.fname: path and name of the figure (nifti format) depicting the brain clusters
% -S.stats: label for the statistics (or other category of... |
320231f7a5c0e61768a6fd5628c5c30f1a397ae733f726daf6e6a4da9583fa46 | MATLAB | 2,985 | 71 | function [D,B]=distance_wei(L)
% DISTANCE_WEI Distance matrix (Dijkstra's algorithm)
%
% D = distance_wei(L);
% [D,B] = distance_wei(L);
%
% The distance matrix contains lengths of shortest paths between all
% pairs of nodes. An entry (u,v) represents the length of shortest path
% from node u t... |
8cb57ca0cbc8d9f5d4bb0b73b55684e0ecf9eadc56ab98b03dcc97d5287ed773 | MATLAB | 2,985 | 65 | classdef SeparationTest < matlab.unittest.TestCase
properties
tmp_dir
end
methods(TestMethodSetup)
function setup(testCase)
tmpd = tempname;
mkdir(tmpd);
testCase.tmp_dir = tmpd;
utest_bst_setup();
end
end
methods... |
0f4d09b9111f863007109b5a4a8b7706890b5307c7c7fcc8ecfb798006fc622e | MATLAB | 2,993 | 86 | % Scripted example of Numerical Optimization of gradient Waveforms (NOW)
clear
% Change the parameters below to your liking. Those not
% specified are default-initialized as follows (see optimizationProblem for details):
% Max gradient = 80 milliTesla/m
% Max slew rate = 100 milliTesla/m/milliSecond = 100 T/m/s
... |
a2576ad23f331e4a1b22ba5fc93df1a64261d3fd9d98dbafc046bcc72de19568 | MATLAB | 3,004 | 78 |
%% Get path to NLA
root_path = nla.findRootPath();
%% Create a pool of tests
tests = nla.TestPool();
tests.net_tests = nla.genTests('net.test');
tests.edge_test = nla.edge.test.Precalculated();
% Example: Appending another net-level test
% tests.net_tests{end + 1} = nla.net.test.ChiSquared();
% Example: Using a cer... |
a995b18aeb8f8e88b14f7b26af7fc727dacefd51ae2dadadcabe5ed54daf7a3b | MATLAB | 3,007 | 97 | function Plot_K_V1_VoxelSpace_Slice(leida_dir,selectedK)
%
% Plot the mean centroids computed in MNI 10mm voxel space at each slice.
%
% INPUT:
% leida_dir directory where LEiDA results are stored
% selectedK K defined by the user
%
% OUTPUT:
% .fig/.png Plot of centroids in different slices in MNI 10mm vox... |
1936bba79365c03dee80897faa3f1735b8842956379b807319611f711cbc29fa | MATLAB | 3,009 | 64 | classdef WelchT < nla.edge.BaseTest
%WELCHT Edge-level Welch T-test
% Differs slightly from built-in Welch's ttest (errors ~1e-13) but
% runs about 4x faster.
properties (Constant)
name = "Welch's T"
coeff_name = "Welch's T"
end
methods
function obj = WelchT()
... |
8d53d395c784a121f95ca1ea7706b89e854b0e16342165bec79adb01fb45122f | MATLAB | 3,011 | 84 | function [cc_V_yeo7,p_V_yeo7] = Overlap_LEiDA_Yeo(parcellation,n_areas,centroids,rangeK)
%
% Function to calculate overlap between LEiDA K-means results obtained in
% Glasser, DBS80, AAL116 or AAL120 parcellation with the 7 Resting State
% Networks from Yeo et al. 2011
%
% INPUT:
% parcellation parcellation used to se... |
9cb5b2c640d48167c165113a0957cda76e8fafd4def4b7028dae945bcfde5c3c | MATLAB | 3,014 | 111 | function [map1] = upmap(images,mask)
% function for producing map of time at which maximum upstroke occurs
% (Based on - Zemlin et al 2008)
% Chris O'Shea and Ting Yue Yu, University of Birmingham
% Maintained by Chris O'Shea - Email CXO531@bham.ac.uk for any queries
% Release Date -
% For licence information... |
e7d1625dc8eca0274a13a600d41790d24d23ce5ecd87a74e9626fae52fea6723 | MATLAB | 3,023 | 88 | function O = GED_AvgSingleCovs(S)
O = [];
S = [];
addpath('/projects/MINDLAB2017_MEG-LearningBach/scripts/Mattia')
% Settings
srate = 250; % recorded at 1000 Hz, downsampled by 4
stimfrex = 2.439; % stimulation frequency: hard-coded 1 / 0.410 s (range is 0.400 and 0.420 but 0.410 is the mode)
fwhm = .3; ... |
6fe11d2743efaed6992fb175830633aed95450c3862f3f8d149fced0bbcb5aae | MATLAB | 3,037 | 89 | function h = draw_comparison_bar(group_y, y_top, sig_texts, colors, varargin)
% Draws comparison bars with multi-line, colorized labels.
% Always expects colors as N×3 numeric matrix (each row = RGB for a line).
%
% Usage:
% draw_comparison_bar(0.5, 0.8, {'**','p=0.003','n=40'}, colors);
% Parse options
p = ... |
5adb2e078b3643b78f249f80014438d17da14908cad7adfb113fa57c06e45086 | MATLAB | 3,046 | 72 | function image_gaussian_filter(data)
figure()
set(gcf,'name','Gaussian Filter','NumberTitle','off','color','w','units','normalized','position',[0.25 0.15 0.4 0.6],'menubar','none','toolbar','figure')
if length(data)>1
slider_step=[1/(length(data)-1),1];
slider_one = uicontrol('style','slider','units'... |
8b65fdcb03c69e12abe5433a440d3255cbb3c1be8cacec754bfe44323048393c | MATLAB | 3,049 | 61 | function O = cluster_DTI_perm_2groups_1(S_ori)
O = [];
%starting up some of the functions that I wrote for the following analysis
pathl = '/projects/MINDLAB2017_MEG-LearningBach/scripts/Leonardo_FunctionsPhD'; %path to stored functions (THIS MUST BECOME A FOLDER ON YOUR OWN COMPUTER)
addpath(pathl);
LBPD_startup_D(pa... |
d9cb8ec030131d271dbdd70158a92fe1787cd1842aca3acb1b097293eec77fd9 | MATLAB | 3,077 | 86 | %%%% EXTERNAL FUNCTION
% function taken from the fastICA package
% complete software may be downloaded from http://research.ics.tkk.fi/ica/fastica/
function [newVectors, whiteningMatrix, dewhiteningMatrix] = whitenv ...
(vectors, E, D, s_verbose);
%WHITENV - Whitenv vectors.
%
% [newVectors, whiteningMatri... |
227842cc4b75d78e9083f049bf50515d10117a47975f3ed6e9c3657cc36a390b | MATLAB | 3,081 | 58 | function h=subtightplot(m,n,p,gap,marg_h,marg_w,varargin)
%function h=subtightplot(m,n,p,gap,marg_h,marg_w,varargin)
%
% Functional purpose: A wrapper function for Matlab function subplot. Adds the ability to define the gap between
% neighbouring subplots. Unfotrtunately Matlab subplot function lacks this functiona... |
bcdb5801829defd71c47881f6f6078f58e81c7b6f5afbbcb63c4d1480b209141 | MATLAB | 3,083 | 72 | % Define the target animal ID and files to analyze
targetRatID = 'Rat1';
targetFiles = {'TestGroupI.avi', 'TestGroupII.avi'};
% Initialize counters
touchCounts = struct('LeftWall', 0, 'RightWall', 0, 'BothWall', 0, ...
'LeftFloor', 0, 'RightFloor', 0);
totalDuration = 0; % in seconds
% I... |
cbc29fb233f0b42755eb6ed1f060d65ba6467844a6447773bb09937fd28bb4f2 | MATLAB | 3,087 | 111 | function [vx,vy,v,X,Y,T,good,G,S,vgood]= velcalc2(XYT,resthresh,mspersamp,MINV,MAXV,xwin,ywin,twin,how_many2)
% function [vx,vy,v,x,y,t,good,G,S]=velocitycalc(XYT,resthresh,Outliers,mspersamp,MAXV,xwin,ywin,twin,how_many2)
% Use local fits to get velocity, drop points where estimates are bad
% Parameters
% XYT: data... |
ceb9dd71ef8ec385ff74cbbb720c6644489bfa69f573761fbb41d65c2ff51794 | MATLAB | 3,097 | 74 | function [resp_EMG] = GetEMG()
%GETEMG Extracts respiration phase at EMG onset for the new dataset.
%
% This function processes EEG data files for 17 participants. For each participant,
% it:
% - Loads raw EEG data,
% - Downsamples the signal to 512 Hz,
% - Filters and extracts the respiration phase using the Hilber... |
44154bb4f94eae7abf231e9cf2792384639b4904241b15a9e5c9c27d510d8a40 | MATLAB | 3,100 | 150 | %% read
d=xlsread('C:\Users\animeshs\SkyDrive\Gotland 125m Landsort Deep 400m.xls')
d=xlsread('C:\Users\animeshs\SkyDrive\Density and year basin 1 and basin 2.xls')
d=xlsread('C:\Users\animeshs\SkyDrive\Animesh cross correlation.xls')
%% test
t1 = 1960:10:1990
d1 = sin(t1)
plot(t1,d1,'r.')
t2= 1970:1:2000... |
967dce00cfd00c7cb9e2a9c88a66ca65443ff760e8f0728e54e685a9fe84f6f2 | MATLAB | 3,101 | 67 | function h=subtightplot(m,n,p,gap,marg_h,marg_w,varargin)
%function h=subtightplot(m,n,p,gap,marg_h,marg_w,varargin)
%
% Functional purpose: A wrapper function for Matlab function subplot. Adds the ability to define the gap between
% neighbouring subplots. Unfotrtunately Matlab subplot function lacks this functiona... |
fa17d4ec7ad6fc22e80b7e92ed8d8e60bdab020e0271086a748124b0af162485 | MATLAB | 3,128 | 80 | function obj = loadData(filename, simultaneousRecording)
% LOADDATA - Load neural recording data from MAT file (static method)
%
% SYNTAX:
% recordedData = RecordedData.loadData(filename)
% recordedData = RecordedData.loadData(filename, simultaneousRecording)
%
% INPUTS:
% filename - Path to ... |
999cdae0edd17cc0ea57c66be7057aa135e09024465ed6e669bf38e05ee093cc | MATLAB | 3,129 | 64 | function loc_list_delauny_triangulation_plot(data)
answer = inputdlg({'maximum number of localizations for down sampling'},'Input',1,{'1000'});
if isempty(answer)~=1
num_points = str2double(answer{1});
m = length(data.x_data);
data_sample(:,1) = data.x_data;
data_sample(:,2) = data.y_data;
if... |
d34f2e67229f746bfcda90785411d9332eec24df6908e4d258a0896d08aa3b7f | MATLAB | 3,129 | 120 | clear all
%% NEW RHS FILE CONVERTER
%
[fname,pathname]=uigetfile('*.rsh')
filename=[pathname,fname]
fid=fopen(filename,'r','b')
fstr=fread(fid,'int8=>char'); %string of chars held in .rsh file
fstr=fstr';
fclose(fid);
fstr;
%% get info
k = strfind(fstr,'DataXsize=');
xs=str2num(fstr(k+11:k+13)); %x
... |
5974f5260929a1b072d018ba7e9ce1a114db2b86edc44c8989d9945827cae951 | MATLAB | 3,132 | 97 | function [VIn, MIn] = partition_distance(Cx, Cy)
%PARTITION_DISTANCE Distance or similarity between community partitions
%
% This function quantifies information-theoretic distance (normalized
% variation of information) or similarity (normalized mutual information)
% between community partitions.
%
% ... |
799ffe6514cdcb7bc9f480f2e51b5ad54fa7ea11f76305765bd754126cb5aaee | MATLAB | 3,136 | 88 | function image_bpass_filter(data)
for k=1:length(data)
data{k}.image = bpass(data{k}.image,1,10);
end
image_plot(data)
end
function res = bpass(arr,lnoise,lobject)
%
% ; NAME:
% ; bpass
% ; PURPOSE:
% ; Implements a real-space bandpass filter which suppress
% ; ... |
217f73705d6a9ec34039b67c6dcb18a01266cb6c51b3a2d72501880d7ab77f1d | MATLAB | 3,138 | 96 | function ciu = consensus_und(d,tau,reps)
% CONSENSUS_UND Consensus clustering
%
% CIU = CONSENSUS(D,TAU,REPS) seeks a consensus partition of the
% agreement matrix D. The algorithm used here is almost identical to the
% one introduced in Lancichinetti & Fortunato (2012): The agreement
% matrix D is thresh... |
95e3ee8768e3bea283aa0fb3101688c82036c839185b2425827e349778fb4328 | MATLAB | 3,138 | 122 | function newmap = bluewhitered(m)
%BLUEWHITERED Blue, white, and red color map.
% BLUEWHITERED(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. This colormap is most useful for images and surface plots
% with positive and... |
b9f73e3644a01a9544359158e843dc6286a6076714ca457711dca95f0f515322 | MATLAB | 3,142 | 85 | function [ OUT ] = preparing_baseline_from_restingstate_LBPD_D( x, y, datapath )
% Given a cell matrix with resting state data for all subjects, it creates
% simulated trials, averages them, corrects for source leakage and computes
% their envelopes.
% Future updates may give user more options (e.g. calculating or not... |
af1bc820b6ef14b4637f19dd3ec665e2206f57f56af1d3349e96dcbe191414a1 | MATLAB | 3,148 | 74 | function shape_classification_hierarchical(data)
list_selection = listdlg('ListString',{'Inconsistent Cutoff','Distance Cutoff','K-max Cutoff'},'SelectionMode','single');
classes = data.classes;
if isempty(list_selection)~=1
parameters = shape_classification_normalized_parameters(classes);
[link,~,~]... |
6c37be414b9544794c531737016221804c3a45e1ba278a47370754f40f311e7e | MATLAB | 3,160 | 68 | function image_sharpen(data)
figure()
set(gcf,'name','Sharpen Image','NumberTitle','off','color','w','units','normalized','position',[0.25 0.15 0.4 0.6],'menubar','none')
set(1,'defaultfiguretoolbar','figure');
if length(data)>1
slider_step=[1/(length(data)-1),1];
slider = uicontrol('style','slider'... |
3928a8723c7a3452d5d919e9f4acdc8740eafeecdcca8ec47918dbe70f317e18 | MATLAB | 3,167 | 82 | function [EBC,BC]=edge_betweenness_wei(G)
%EDGE_BETWEENNESS_WEI Edge betweenness centrality
%
% EBC = edge_betweenness_wei(L);
% [EBC BC] = edge_betweenness_wei(L);
%
% Edge betweenness centrality is the fraction of all shortest paths in
% the network that contain a given edge. Edges with high values... |
726540add66ca9d72420b8435cdad80dbce4c2415da6bcc3cec964f2a4ba6d9f | MATLAB | 3,167 | 99 | classdef SandwichEstimator < nla.inputField.InputField
properties
name = 'sandwich_estimator';
disp_name = 'Sandwich Estimator';
end
properties
settingsObj
end
properties (Access = protected)
button_start_sandwich_gui = false
end
me... |
84f6ae029f54ec127c5246c289049ceed6e6c3a713c0350bf43eda4d104d94ee | MATLAB | 3,167 | 85 | function [sbc, fpe, logdp, np] = arord(R, m, mcor, ne, pmin, pmax)
%ARORD Evaluates criteria for selecting the order of an AR model.
%
% [SBC,FPE]=ARORD(R,m,mcor,ne,pmin,pmax) returns approximate values
% of the order selection criteria SBC and FPE for models of order
% pmin:pmax. The input matrix R is the upper tri... |
9d15c8a301dabe1fac5bb0fcc5499d1fc8de736cd87cc23345e80138c38146fd | MATLAB | 3,167 | 88 | %% read file
band4=xlsread('L:\MALDI\pso\141203_hclhydrolysis_herb3_band4.xlsx');
band3=xlsread('L:\MALDI\pso\141203_psoextract_band3.xlsx');
band2=xlsread('L:\MALDI\pso\141203_psoextract_band2.xlsx');
band1=xlsread('L:\MALDI\pso\141203_psoextract_band1.xlsx');
%% extract area and mass
maxarea=max([band1(:,7);b... |
5a37d89f6599df82eb20db50fac5440f488c753bb92b4c0f1051758586e30e9b | MATLAB | 3,168 | 86 | function [alphamap] = pl_permalphavalue2(data1, data2, varargin)
%
% Returns the location-specific alpha values of a statistical map created
% from a 2-sample statistic between data1 and data2
% This function is part of the permutationlab software:
% Author: Dimitrios Pantazis
% The code is currently under deve... |
b045f543ecc70bb8fec5e64424b144585d37d7570be5133ae363a14cdaf33798 | MATLAB | 3,169 | 147 | function [t,F,p,df,R2,cR2,B,r,aR2,iR2] = glm(y,X,c,pflag);
% [t,F,p,df,R2,cR2,B] = glm(y,X,c,pflag);
%
% Generic function for General Linear Model (GLM)
% Note: assumes error is spherical (residuals white)
% Rik Henson, 2004
%
% (Note requires Matlab stats toolbox, or SPM functions to be on path)
%
% Input:
% y = n... |
2f6bfaa13c5bc430f89a28cd9dd3e176af2bfaae9b63e037153549bcdaeb4344 | MATLAB | 3,171 | 117 | function [idx, dist] = nst_knnsearch(X,Y,varargin)
% For compatibility
try
[idx, dist] = knnsearch(X,Y,varargin{:});
catch
% Alternate implementation from file exchange
% https://www.mathworks.com/matlabcentral/fileexchange/19345-efficient-k-nearest-neighbor-search-using-jit
%
% Licence:
% ... |
935d9f22a369d39b12255c90542f5753903c951ca336fc544764bb8f8b7656af | MATLAB | 3,173 | 70 | classdef GroupHeteroskedastic_FAST < nla.helpers.stdError.AbstractSwEStdErrStrategy
methods
function stdErr = calculate(obj, sweStdErrInput)
%Computes Standard Error, but accelerated using assumption of
%heteroskeadisticity between groups for quicker computation
... |
229471aad2c726817c3e78a76f8602b9ab972b1e3d80ceb0926d0d2a7a3e5d29 | MATLAB | 3,176 | 75 | function image_disk_filter(data)
figure()
set(gcf,'name','Disk Filter','NumberTitle','off','color','w','units','normalized','position',[0.25 0.15 0.4 0.6],'menubar','none','toolbar','figure')
if length(data)>1
slider_step=[1/(length(data)-1),1];
slider_one = uicontrol('style','slider','units','normal... |
077cba8318482cae867dc275d8fd072f980fb5f1fa773ac221de5e2feb85901b | MATLAB | 3,188 | 78 | function [f,F]=motif3funct_bin(A)
%MOTIF3FUNCT_BIN Frequency of functional class-3 motifs
%
% [f,F] = motif3funct_bin(A);
%
% *Structural motifs* are patterns of local connectivity in complex
% networks. In contrast, *functional motifs* are all possible subsets of
% patterns of local connectivity e... |
821c6286bfe1c9ce6bfb00ef86537d195ec56280d187b655c27ab6b7d2d9243e | MATLAB | 3,190 | 85 | function vol = SurfStatSurf2Vol( s, surf, template );
%Interpolates data on each surface to a volume, then averages.
%
% Usage: vol = SurfStatSurf2Vol( s, surf [, template] );
%
% s = 1 x v vector of surface data, v=#vertices.
% surf.coord = 3 x v matrix of coordinates in mm, v=#vertices, in double
%... |
932e6a2e498fc9300958d935141761781c1627a0a6ff5af3b9a15bec7b69bd6b | MATLAB | 3,190 | 79 | function [lambda,efficiency,ecc,radius,diameter] = charpath(D,diagonal_dist,infinite_dist)
%CHARPATH Characteristic path length, global efficiency and related statistics
%
% lambda = charpath(D);
% lambda = charpath(D);
% [lambda,efficiency]... |
d8508c310a5ea30f4a9147c46135b1ffd454a85bd4400fabaaa29ceee425a9d6 | MATLAB | 3,190 | 124 | function newmap = colorbar_treatment(m)
%BLUEWHITERED Blue, white, and red color map.
% BLUEWHITERED(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. This colormap is most useful for images and surface plots
% with positi... |
b58f50dccbc903ac2d2a6248d41e03f6d035bf1eaeaa029548fcf72c94473162 | MATLAB | 3,198 | 96 | close all; clear all; clc;
path='E:\L6b_EEG\2022_JanFeb\';
pathin=[path,'OutputSignals24h\'];
pathout=[path,'Pwelch_PSD\perVS\'];mkdir(pathout);
notchfilter=0; % decide whether to apply notch filter
channels={'front';'occ'};
epochl=4;
maxep=21600;
fs=256;
fsh1=fs*epochl*maxep;
fs=256; % sampling rate ... |
2028680cd01459c2efa802a448207238e6646f55e3c2de7e91e266b83116e050 | MATLAB | 3,199 | 100 | function Plot_subj_cluster_blocks(data_dir,save_dir,selectedK,subj)
%
% Plot the state time course for a specific participant considering K PL
% states along with the fMRI signal
%
% INPUT:
% data_dir directory where LEiDA results are stored
% save_dir directory to save results for selected optimal K
% select... |
19315081ae4a9ca6a1193b9d604a0e7f68d1266eeee3e7ae944754c61427bd79 | MATLAB | 3,200 | 88 | %%
% current working directory needs to be /path/to/scripts
mainpath= pwd;
addpath([mainpath filesep 'toolboxes' filesep 'tc_functions'])
addpath([mainpath filesep 'fmriRegAnalysis'])
addpath([mainpath filesep 'toolboxes' filesep 'fieldtrip'])
addpath([mainpath filesep 'toolboxes' filesep 'OpenFmriAnalysis'])
tvm_inst... |
71494e1a643fc71b66f770feffff376d74ca0873607549d1bb00a557def29a20 | MATLAB | 3,201 | 77 | function thalamus
% make a projection density plot
%
% This is the MATLAB version of the R example found at
% http://api.brain-map.org/examples/doc/thalamus/thalamus.R.html
%
% We have some more robust MATLAB functions that encapsulate
% some operations that were performed in-line in the R example.
% These s... |
14a054e269312e085a9879864c60d09c1f2d25f07f848324048b8ba5a0a1dd80 | MATLAB | 3,207 | 100 | function O = Replay_TG_Plot_Stats_2Groups(S)
O = [];
%It computes plots for temporal generalisation (TG) decoding for two independent groups.
%It is designed to work on the Aarhus Cluster and it solves the OUT OF MEMORY issue.
% INPUT:
% -S structure with folloring fields:
% -list_TG: ... |
3388ff4fe5b4b5477937b84e5b50af423d5387442d530938a58ef8f77593c02f | MATLAB | 3,210 | 97 | function PlotRadarGraph(Data,seednum,maxpercent,patchcolor,markersize,sepnum)
pathmfile = which('AS_WTA_GUI.m');
[pat nam ext] = fileparts(pathmfile);
load(fullfile(pat,'SEEDCOLOR.mat'))
load(fullfile(pat,'JETcode.mat'));
SXpercent = Data/sum(Data);
Hsize = get(0,'ScreenSize');
Bsize = min(Hsize(3),Hsize(4));
B... |
409807ba23b1263b4698a42734a4fbde63d783baec4d1eedecc1d3dfcbca8492 | MATLAB | 3,215 | 80 | function fluence_dir = cpt_spherical_fluences(sSubject, head_scout_vertices, wavelengths, dcut)
fluence_dir = fullfile(nst_get_local_user_dir(), 'fluence', 'MRI__Colin27_4NIRS', 'spherical');
if ~exist(fluence_dir, 'dir')
mkdir(fluence_dir);
end
if nargin < 4
dcut = 40; %mm
end
disp(['Start generating missin... |
e9401e0dcba8db96185227f8857d15994241103f98a243ace9b58615abc7bf0d | MATLAB | 3,223 | 128 | function smarterd = TFfindRespFreq2(TF_subj,timeVec,freqVec,thr_max);
%TF_subj ERDgram freq x time in alpha or beta (e.g. 7:16 Hz - for alpha 1 bin is
%added for each side, it is needed in the peak search procedure)
%timeVec time vector in secs
%freqVec frequency vector in the alp... |
6db952e5bda4839e6a2d1e7273b6be5ba43814a8bb3752556d0e99a75a34400a | MATLAB | 3,225 | 64 | %--------------------------------------------------------------------------
% Till Habersetzer, 08.07.2025
% Communication Acoustics, CvO University Oldenburg
% till.habersetzer@uol.de
%--------------------------------------------------------------------------
% ensure that we don't mix up settings
clear settings
% ... |
e1d774f9925af4cfb952340eb1611260d342768ae5cff25bdb6ed80d666dbb11 | MATLAB | 3,226 | 99 | clear;
addpath('/home/common/matlab/fieldtrip')
sj='S36';
cond='';
stem='/project/3018037.01/Experiment3.2_ERC/AnalysisFolder/';
bpfilt=[1 7];
load(['/project/3018037.01/Experiment3.2_ERC/AnalysisFolder/subjectData/' sj '/6_EEG/chnls.mat'])
%chnls ={'all','-ECG','-PO4','-FT10'... |
51c10e87b616299e1aee79e3edde208866b6de71bf4d2f525f337a99cde3398f | MATLAB | 3,230 | 75 | function checkNormalityWithKS(fig, input_struct, test_pool, remove_index)
prog = uiprogressdlg(...
fig, 'Title', 'Checking Normaility', 'Message', 'Running Kolmogorov-Smirnov Test'...
);
prog.Value = 0.02;
prog.Value = 0.25;
edge_test_result = test_pool.runEdgeTest(input_struct);
... |
d6cba89a1453430863766ce7564083a3e20c7387a76f6a3653b33024f103d447 | MATLAB | 3,230 | 87 | function Surf_Resshow_subfun(Parameter)
pathfiles = which('BCCT.m');
[pat nam ext] = fileparts(pathfiles);
Outdir = Parameter.Outputdir;
% background = [path,filesep,'templates',filesep];
FStype = {'fsaverage','fsaverage3','fsaverage4','fsaverage5','fsaverage6','fsaverage_sym'};
[surfp,ab] = SurfStatReadSurf({[pat,fi... |
631298be15001b8f6ac8dc244ae7d3df218ec0fb3ee1b536013842513b6f12a9 | MATLAB | 3,237 | 102 | function M = clique_communities(A, cq_thr)
% CLIQUE_COMMUNITIES Overlapping community structure via clique percolation
%
% M = clique_communities(A, cq_thr)
%
% The optimal community structure is a subdivision of the network into
% groups of nodes which have a high number of within-group connections
% ... |
ede90cb14e01617656f5d28f236487912437c6c263c7df17447ce438785a0bc5 | MATLAB | 3,237 | 48 | function loc_list_voronoi_clusters_individual_plot(data)
figure()
set(gcf,'name','Voronoi Segmentation Clusters','NumberTitle','off','color','w','units','normalized','position',[0.3 0.2 0.4 0.55],'menubar','none')
set(1,'defaultfiguretoolbar','figure');
if length(data)>1
slider_step=[1/(length(data)-1),1];
... |
d5f1eaa4c4fd6ad5b7917a73b4a6dfb5c5758534bae46e9a7e74042fb32880f8 | MATLAB | 3,242 | 103 | function [autocorrSWS, autocorrREM] = jds_xCorrREM(animalprefixlist)
%JDS_XCORRREM Cortical ripple autocorrelations in NREM vs REM.
% [autocorrSWS, autocorrREM] = jds_xCorrREM(animalprefixlist) computes
% the z-scored, smoothed autocorrelogram of cortical ripple start times
% separately for NREM and REM (center b... |
da2d42991f413b7e3de678f407814ce6763019042378b7025523b51e01a9851d | MATLAB | 3,243 | 104 | function BCCT_MatrixShowFinalResPermVer_other_GUI(Pval,outdir,enhanind,Coltype,PVALT,Pvalused,orders,outname)
[mpat,mnam,mext] = fileparts(which('BCCT_MatrixShowFinalResPermVer_other_GUI.m'));
load(fullfile(mpat,'MatColormap','mycolormap.mat'));
load(fullfile(mpat,'gray.mat'))
colormapshow0 = AFNICOLORMAP(128);
if... |
1562ed84b6b2cb2556af2a6a86c94e7a08ae4718ddf84e1d90ee70fa382b0786 | MATLAB | 3,244 | 89 | function varargout = process_nst_rename_montage( varargin )
% @=============================================================================
% This function is part of the Brainstorm software:
% http://neuroimage.usc.edu/brainstorm
%
% Copyright (c)2000-2016 University of Southern California & McGill University
% Thi... |
e8a104b656e04e5d3c26d067388637ae85ad775d934873ab461b64454f003824 | MATLAB | 3,245 | 92 | function [sigma,shrinkage]=covCor(x,shrink)
% INPUT: x (t*n): t iid observations on n random variables (trial * channel/voxel)
% OUTPUT: sigma (n*n): invertible covariance matrix estimator (chan * chan)
%
% Shrinks towards constant correlation matrix
% if shrink is specified, then this constant is used for shrin... |
662d8ddfc966fb050c1b0f1af650d585416479573475cf36bfcf122340b1d958 | MATLAB | 3,260 | 75 | function [all_stim_onset_rel_to_A1, all_trigger_values_vec, all_reaction_times, sampling_rate] = tc_get_event_times_from_eeg(EEG_parameters, scanner_trigger, skip_N_scanner_triggers, response_trigger)
%% tc_get_event_times_from_eeg(EEG_parameters, scanner_trigger, response_trigger)
load(EEG_parameters, 'parameterSettin... |
a6ba123a57a1b42e403ed43f48420c5e136b8805633c5db0226c40f7a1fd5708 | MATLAB | 3,264 | 79 | function SpinPermuCIVET(readleft,readright,permno,wsname)
% Compute designated # of permutations/spins of the input surface data
% in CIVET.
% FORMAT SpinPermuFS(readleft,readright,permno)
% readleft - the filename of left surface data to spin
% readright - the filename of right surface data to spin
% permno ... |
9c8a841fd78e7c5f5ddaf9a307872834c31bee4ec68e9c511e5599da85747733 | MATLAB | 3,271 | 88 | function W = weight_conversion(W, wcm)
% WEIGHT_CONVERSION Conversion of weights in input matrix
%
% W_bin = weight_conversion(W, 'binarize');
% W_nrm = weight_conversion(W, 'normalize');
% L = weight_conversion(W, 'lengths');
% W_fix = weight_conversion(W, 'autofix');
%
% This function may either ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.