sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
0df005844ed6998e5bd7031d991401add5f687e800163f161006c2ccdcec18b7
MATLAB
2,343
54
classdef CohenDTest < handle %COHENDTEST Cohen's D Test for network tests % This Cohen's D test is run for all of the tests % Input: % edge_test_results: Results from the edge tests % network_atlas: Network Atlas % result_object: This is a NetworkTestResult object. This needs to be passed ...
e1c869da07071bbaa1ed662b4fa272ccd86870f64e62773f9c8993e8c251c067
MATLAB
2,343
66
%% realization of the instantaneous model : U = L*W %%% OUTPUT % U: N*M matrix of filtered noises % INPUT % N data length % C: input covariance matrix (may be interpreted as Su or Sw, see above) % B0: M*M matrix of instantaneous effects (when relevant) % when flag='StrictlyCausal': % given Su, applies Chole...
021e330134138e30473cf14a98436051503bb16b4deb565275cb7d063171029a
MATLAB
2,348
70
%% Generation of CFTf surrogates - useful to test the DC - VERSION FOR EXTENDED MVAR MODEL! %%% ABSENCE OF FULL (direct&indirect) CAUSALITY FROM yj TO yi - Bim and Bmj coefficients are forced to zero % Note: the length of the series should be not be odd %%% input: % Y, M*N matrix of time series (each time series ...
3b1bc18cf8fc23c0a1cb1694bb228fbf5b03eb05d011b2ec1e02a3f0a6e7e13b
MATLAB
2,353
63
function shaded_areas(x, y, error, varargin) % SHADED_AREAS Plots a line with shaded error areas. % shaded_areas(x, y, error) plots the data in vectors x and y with % shaded areas representing the error. The error can be a constant, % a vector of the same length as y, or a matrix with two colu...
4fd98608932eb70efcc099db892bfc892b975557af981d67bc51291c07087d96
MATLAB
2,353
53
function O = cluster_DTI_perm_2groups_2(S_perm) 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(...
97e01aca70e2a066b8aae2b5df9ad1cc51c28e8cdc814aa817f0a7e21a30fc98
MATLAB
2,357
106
% Convert image of different orientations to standard Analyze orientation % % Usage: nii = rri_orient(nii); % Jimmy Shen (jimmy@rotman-baycrest.on.ca), 26-APR-04 %___________________________________________________________________ function [nii, orient, pattern] = rri_orient(nii, varargin) if nargin >...
113c0c5061240cd514faea0b81774e9407f5416ca6cd3d73030cc9388cb98a31
MATLAB
2,359
82
classdef NumberWithoutDefault < nla.inputField.InputField properties name disp_name min max end properties (Access = protected) label = false field = false end methods function obj = NumberWithoutDefault(name, disp_name, min, max) ...
c0034c841bf5f103f1c381a442965b4a69791cc18bc538bab4d8267e85d01b24
MATLAB
2,384
78
function edg = SurfStatEdge( surf ) %Finds edges of a triangular mesh or a lattice. % % Usage: edg = SurfStatEdge( surf ); % % surf.tri = t x 3 matrix of triangle indices, 1-based, t=#triangles. % or % surf.lat = 3D logical array, 1=in, 0=out. % % edg = e x 2 matrix of edge indices, 1-based, e=#edges. if ...
366919f1ac08e03587b9133a283e023fd60b5f71dea8ba2822acfeb6dc7f37f6
MATLAB
2,385
61
function varargout = run(func_name, varargin) %RUN Run mex function, compiling if necessary import nla.findRootPath if isstring(func_name) func_name = char(func_name); end if (ischar(func_name)) % hash the source file to check if we have an up-to-date binary % already c...
4c68846e6b34bec8182747701d3be0d271237d7c5cb218bf63777533292b6772
MATLAB
2,390
49
function shape_classification_features_info(data) clf(figure()) set(gcf,'name','Features Info','NumberTitle','off','color','w','units','normalized','position',[0.1 0.2 0.4 0.6],'menubar','none','toolbar','none') no_of_classes = size(data.classes,1); slider_one_value = 1; if no_of_classes>1 slider_one_step=[...
92d2d93818f2d452ee673bc608cf12b272d35493c233e5cf8c6e923cdff2b7b4
MATLAB
2,392
62
%%% DISCLAIMER %%% % This file is a modified version of `tt_cp_fun.m` from Tensor Toolbox: % Brett W. Bader, Tamara G. Kolda and others, Tensor Toolbox for MATLAB, Version 3.1, % www.tensortoolbox.org, June 2019. https://gitlab.com/tensors/tensor_toolbox. % It is therefore subject to the following license: % BSD 2-Cla...
63a56b5486a2d6c1bc69bfaa82b52f5abd2d58e1bfe07536d277385406c1d9da
MATLAB
2,395
81
function SurfStatWriteSurf( filenames, surf, ab ); %Writes coordinates and triangles to an array of .obj or FreeSurfer files. % % Usage: SurfStatWriteSurf( filenames, surf [,ab] ); % % filenames = .obj or FS file name (n=1) or n x k cell array of file names. % If extension=.obj, writes a .obj file...
5a40a545cb515f2578986ef24681d3dbc91496e87ac0f250452d8025991ddeb5
MATLAB
2,396
67
dFC_project = struct(); [dFC_project] = compute_dFC(dFC_project,1); if ~isstruct(dFC_project) errordlg('An error occured while computing dFC') return end dFC_project = compute_variability(dFC_project); if ~isfield(dFC_project,'var_output_dir') dFC_project.var_output_dir =uigetdir(pwd,'Select folde...
919b9128c470a62d4c21faa8dd224926cf9062ccd893f0cfad61c0341b6cc5e1
MATLAB
2,410
75
%% clear % current working directory needs to be /path/to/scripts mainpath= pwd; thisSubject='S2'; workingDir=[mainpath filesep '..' filesep 'subjectData' filesep thisSubject filesep '6_EEG']; % addpath([mainpath filesep 'toolboxes' filesep 'fieldtrip']) addpath([mainpath filesep 'toolboxes' filesep 'tc_functions']) f...
c468c6118c942419a3dbcbdfce6c5d71dc8a653ba152200b21ea03a863f1039c
MATLAB
2,412
100
clear tfn = [path_ludisc '\common\Data\MIPCART pilot\Analysis\ParTable_250625.mat']; load(tfn); uID = unique(T.ID); %% clf % pnl = {'D', 'Vi', 'MKi','ufa2', 'Va', 'MKa'}; % plab = {'{\itD} [µm^2/ms]', '{\itV}_I [µm^4/ms^2]', 'MK_I [1]', 'µFA [1]', '{\itV}_A [µm^4/ms^2]', 'MK_A [1]'}; pnl = {'D', 'Vi', 'Va'}; plab =...
74ad84a92a540ec3ba5404fe2e37113eeb3a6cbfbfc03c1b979488fa704111de
MATLAB
2,415
54
function loc_list_color_histogram(data) input_values = inputdlg({'number of bins:'},'',1,{'100'}); if isempty(input_values)==1 return else figure() set(gcf,'name','color-histogram-plot','NumberTitle','off','color','w','units','normalized','position',[0.2 0.3 0.6 0.4],'menubar','none','toolbar','fi...
1a7f97787bd7b8a6ff3beed6ec80c77f5b3e46621d05a4bc17c7d4795cb23149
MATLAB
2,432
55
function loc_list_density_plot_delauny_triangulation(data) answer = inputdlg({'Maximum Number of Localizations for Down Sampling'},'Input',1,{'1000'}); if isempty(answer)~=1 num_points = str2double(answer{1}); f=waitbar(0,'Please wait...'); for i=1:length(data) m = length(data{i}.x_data); ...
a9303e3b8141e2a56c2def5478c5001a70a4ddcbf2ed5fac5ac50f3dc08d9434
MATLAB
2,435
64
function [Kmeans_results,rangeK] = LEiDA_cluster(data_dir, mink, maxk) % % Cluster all leading eigenvectors into a set of K clusters using % the K-means algorithm. % This function returns an optimal solution for each values of K. % % INPUT: % data_dir directory where the LEiDA_EigenVectors file is saved % % OU...
f8e6bb43a387a6550d4a7ba41ce5b51f2e5460e3019a3b449f789724d97af0b9
MATLAB
2,440
99
%% SPECTROGRAM clc clear addpath('/Users/pelinozsezer/Documents/Science/Radboud/RGS-Project/code/ripples/fieldtrip'); addpath('/Users/pelinozsezer/Documents/Science/Radboud/RGS-Project/code/ripples/functions'); load('GC_ripple_4clusters_median_wa.mat'); %% Merge data per treatment GC_veh=[GC_Bp_cluster1_veh_median_wa...
27d9d9c1e882147ead64741221e9def00c31c4f6a21af3810ecea3d866d58c16
MATLAB
2,466
46
function colorSelector(src, plot_figure, parameters, chord_type, callback_function, color_choices) original_figure = src.Parent.Parent; modal = figure('WindowStyle', 'normal', 'Units', 'pixels', 'Position',... [original_figure.Position(1), original_figure.Position(2), original_figure.Position(3) / 2, or...
ad7063d196c3b6c47014383fc7393543ee0395da3b7f10f2c604ed30383a668d
MATLAB
2,468
96
function [Label2, Perc, nbpCluster2, PercentROI2, nbpROI2] = gin_det_plabels(XYZmm, MNIY, MNID, ROI,fact) % % Compute Labels and % for local maxima % % XYZmm : Local Maxima % MNID : atlas volume with labels values % ROI : structure : link between labels values and label name. % BORDER_XYZ : structure contains th...
32d545eb4beb4e2049fe173fd769042bbe01fb795d45f7c9570d93f14dab4455
MATLAB
2,469
66
function loc_list_montage(data,map,scatter_num,scatter_size,c_lim) global Int if length(data)>6 msgbox('Number of files selected should be less than or equal to 3') else figure() set(gcf,'name','Montage Plot','NumberTitle','off','color',[0.1 0.1 0.1],'units','normalized','position',[0.15 0.2...
71deea9372c8059bc64cecf3a167329129880b83462533c23114a681a79f8481
MATLAB
2,476
50
% Code to perform flat hyperellipsoid projection. In this code we take a % current density input which can be the output of a gradient descent % procedure and project it inside (on the boundary) of an ellipsoid to % satisfy the constraint of the problem. This is the generalization of % projecting to an ellipsoid in a b...
da9e19befdf3376be65ac5c7bd0911f60b25fe4755a02d7dbf089da9f02ad19b
MATLAB
2,476
80
function [R,eff]=randmio_und(R, ITER) %RANDMIO_UND Random graph with preserved degree distribution % % R = randmio_und(W,ITER); % [R eff]=randmio_und(W, ITER); % % This function randomizes an undirected network, while preserving the % degree distribution. The function does not preserve the strength ...
9457bf5582197d416c75c0e2600ddbf711940429b0d6e182e068ed646fc25b5f
MATLAB
2,479
46
function [data_clustered,data_not_clustered] = loc_list_voronoi_monte_carlo(data) answer = inputdlg({'Number of Iterations:','nm per Pixel:','Analysis Pixel Size:','MC Confidence Bounds:','Maximum Number of Thresholds:','Minimum number of Localizations per Cluster:'},'Input',[1 50],{'5','116','20','99.5','8','5'}); i...
1e1f9cda937edaded6597bcd1da168ed6cf6ed473efd30a6c772b425ade5ba0c
MATLAB
2,482
88
function osl_spinning_brain(fname,fig,duration,tight) % Make an animation by spinning the figure % The azimuth angle will sweep through 1 revolution, while the % elevation will remain unchanged % The animation will start with the current azimuth angle % All axes will be rotated % % INPUTS % - fname - output fil...
6b7106ea0308ec427949c6b3dc0e2005a053660586cada748ebdd6754378ebe5
MATLAB
2,488
70
function [virtChannels, validROIinds]=timelock2virtualChannels(timelockData, headmodel, leadfield, sens, ROIcoords) %% [virtChannels, validROIinds]=timelock2virtualChannels(timelockData, headmodel, leadfield, sens, ROIcoords) disp('compute LCMV beamformer...') % LCMV beamformer cfg = []; cfg.method = 'lcmv'; cfg.grid ...
425f5df3682239926edf0e7824b055e4a02c8cc35dd4093835ae6365894a72db
MATLAB
2,490
86
function dps = resQ_4d_fit2param(mfs_fn, dps_fn, opt) % function dps = resQ_4d_fit2param(mfs_fn, dps_fn, opt) if (nargin < 2), dps_fn = []; end if (nargin < 3), opt = []; end opt = mdm_opt(opt); dps = mdm_mfs_load(mfs_fn); % Convert dps.m to large numbers f = resQ_unitSwap([], -1); f = reshape(f, [1 1 1 n...
60e89b7cc6ef0c66bcd4fff0bea110bc56e2521cee394c67aca93deeb4b98b19
MATLAB
2,490
75
classdef SandwichEstimatorInput < handle % used to pass object by reference to SandwichEstimatorInputGUI and % receive output settings from that GUI % % call 'struct' function on an instance of this class to get an % equivalent struct properties groupId %n x 1 vector permute_meth...
545273005dd481dc3c658d8a5f8dc1aacceaef2f72f2e7ebd0ebe8e1aef8e000
MATLAB
2,491
61
function FC_project = get_roi_info(FC_project) old_path = pwd; switch FC_project.atlas case 1 % AAL3 parcellation roi_info = struct2cell(load('ROI_MNI_V7_List.mat').ROI); all_roi_names = permute(roi_info(3,1,:),[3 1 2]); % Get hemisphere info roi_split = cellfun(...
41d2f321eacc7e8d6d1cb268f5bc3c181db17f7b7b3de073f286612b5485e47e
MATLAB
2,493
85
function dFCstream = TS2dFCstream(TS, W, lag, format) % FUNCTION dFCstream = TS2dFCstream(TS, W, lag, format) % takes time-series (TS), size of window (W), and value of shift of window % (lag) as input and calculates dynamic functional connectivity stream % (dFCstream) as output. % % inputs: TS(t,n) --> rows are t dif...
dcd570f453dae6db84b575850f60e3b53c2e54c082cbe7636f1d6a22ef3babcb
MATLAB
2,495
75
function [newData1,newData2,newData3] = reorganizeData(data1,data2,data3,Filter) newData1 = cell(1,length(data1)); newData2 = cell(1,length(data1)); newData3 = cell(1,length(data1)); for i = 1:length(data1) if ~isempty(data1{i}) Clusters1 = extract_clusters(data1{i}); end if ~i...
a6a3a4e246135f45387a7247033325bbde3c8f82218f470864fd17af436a1072
MATLAB
2,507
72
function Plot_K_vector_labelled(data_dir,save_dir,selectedK,centroid,parcellation) % % Plot the selected centroid in vector format with the labels of each area. % % INPUT: % data_dir directory where LEiDA results are stored % save_dir directory to save results for selected optimal K % selectedK K defined ...
1dd006c7ba71055cd5ff4da95ef33bc46a65846d8a8dba2798cae2a553eee081
MATLAB
2,510
74
function [alphamap] = pl_permalphavalue(data, varargin) % % Returns the location-specific alpha values of a statistical map created % from a statistic applied on 'data' % This function is part of the permutationlab software: % Author: Dimitrios Pantazis % The code is currently under development, please do not s...
57f33b77e9786d91c6a2577239130ab973e6510a63c23207f6bbdd0c6d9acd3c
MATLAB
2,513
64
function loc_list_roi_module(data,scatter_num,scatter_size,map) figure(); set(gcf,'name','ROI Selection Module','NumberTitle','off','color',[0.1 0.1 0.1],'units','normalized','position',[0.25 0.15 0.5 0.7],'menubar','none','toolbar','none'); data = data{1}; data_down_sampled = loc_list_down_sample(data,scatter_nu...
86702aa6fa1dd1bce786ddbef8b0a700ad0eab2779611a62e2d0347a0f3ce9b5
MATLAB
2,514
44
%% read %prot = tblread('L:\Elite\LARS\2014\oktober\OLUF HUNT\endelig\results\proteinGroups.txt','\t') %prot = tblread('L:\Elite\LARS\2014\november\Kamilla\combined\txt\proteinGroups.txt','\t') prot = xlsread('L:\Elite\kamila\Heart\Sub12LFQ.xlsx') protlfq=prot(:,[1:36]) %protlfq=prot(:,[117:128]) %protlfq=prot(:,...
6108a63c8f5ad28150a5c6bf00c9bb82877db8d8fda3536f498fb53539ad112f
MATLAB
2,516
72
%% data x=[220.22 223.54 1.00 223.84 237.44 1.00 258.32 287.93 0.00 241.53 267.49 1.00 241.79 281.38 1.00 253.21 280.85 1.00 256.95 292.47 0.00 209.14 207.97 1.00 251.28 290.98 0.00 246.40 283.78 1.00 240.18 290.06 0.00 239.29 274.88 1.00 239.76...
44454c348dc039b51d37ed2711af209aaac2af0df4757d898b3343a09e4bda62
MATLAB
2,517
75
% This script visualizes the firing activity of neurons in different sleep stages per % treatment. %% Loading Data load('RGS_Session_1.mat') % load('RGS_Pyr_S1_No_Rn3.mat') load('Vehicle_Session_1.mat') Pyr_RGS=RGS14_Session_1.Pyramidal_Cells; Pyr_Veh=Vehicle_Session_1.Pyramidal_Cells; %% Correcting for Outliers...
d56659d7d11335de10f1402b810f67c03f3948396c922ee7d64c81b48c39d0f8
MATLAB
2,518
72
function Plot_C_vector_labelled(data_dir,save_dir,selectedK,centroid,parcellation) % % Plot the selected centroid in vector format with the labels of each area. % % INPUT: % data_dir directory where LEiDA results are stored % save_dir directory to save results for selected optimal K % selectedK K defined ...
3fc5b90aac38a6ff4bcbbceab47865167a0ce18a86de8242b55b5b6162b34c8d
MATLAB
2,526
65
clear;clc;close all [file_name,path] = uigetfile('*.locb','Select .txt File(s)','MultiSelect','on'); if path~=0 file_name = cellstr(file_name); [file,path_excel] = uiputfile('*.xlsx'); if path_excel~=0 save_to = fullfile(path_excel,file); for i = 1:length(file_name) locs_...
9c263b3cfa3f37773269f5f2ef206a65d3c85294ac41e796885659b9b9c582d5
MATLAB
2,529
59
classdef PairedT < nla.edge.BaseTest %PAIREDT Edge-level Paired T-test properties (Constant) name = "Paired T" coeff_name = "Paired T" end methods function obj = PairedT() obj@nla.edge.BaseTest(); end function result = run(obj, test_options) ...
67d526e87037b05f65a4197457d2cbfcf3faa3ab9aa0da374df978ab7f418dc3
MATLAB
2,530
57
function spt_motion_classification_butterfly(data) input_values = inputdlg({'spatial threshold','distance threshold:'},'',1,{'1.5','8'}); if isempty(input_values)==1 return else spatial_threshold = str2double(input_values{1}); distance_threshold = str2double(input_values{2}); not_butterfly_...
88192aa0034841bf5e3a6b6887f6eb6dfd7df641ac3450266a95215c087b87bb
MATLAB
2,532
110
function demo_saem(sim,type) path_ = pwd; addpath(genpath(strcat(path_,'/MVAR_simu'))); addpath(genpath(strcat(path_,'/joint_est'))); addpath(genpath(strcat(path_,'/two_step_est'))); addpath(genpath(strcat(path_,'/misc'))) meas_snr=5; bio_snr_vals=[1 3 5 10]; num_sources=3; bio_snr_arr=repmat(bio_snr_vals, [50 1]); di...
24d57d22a9ffde08653cccbf0853445351d04691ca4ab7a046197883cb9183f7
MATLAB
2,538
60
%% if ~(exist('mainpath','var')) clearvars % currrent working directory needs to be /path/to/scripts mainpath = pwd; else clearvars -except mainpath end addpath([mainpath filesep 'fmriRegAnalysis']) addpath([mainpath filesep 'toolboxes' filesep 'tc_functions']) %% fconts = dir([mainpath '/../subjectDa...
316862895024a370b1de506dacf61562740ea05e57f823a9f0ea0463ff5acdab
MATLAB
2,545
69
function jds_rippleIEI(animalprefixlist) %JDS_RIPPLEIEI Distributions of cortical ripple inter-event intervals. % jds_rippleIEI(animalprefixlist) computes inter-event intervals between % successive cortical ripple start times within REM bouts and within NREM % bouts, compares the two distributions (rank-sum), and...
0812a3d4ac64f31fabba0f63204b65aa897afde18fb5abb61765c55be93e2b1e
MATLAB
2,549
55
function h=subplot_tight(m,n,p,margins,varargin) %function subplot_tight(m,n,p,margins,varargin) % % Functional purpose: A wrapper function for Matlab function subplot. Adds the ability to define the margins between % neighbouring subplots. Unfotrtunately Matlab subplot function lacks this functionality, and the margin...
f2959e45049199caded4b0f5fc3e8703d6f09b899cb7a0a4e61fa5fb98f427d7
MATLAB
2,560
69
function O = InducedResponses_Morlet_ROIs_AarhusClust( S ) O = []; % It sends one job for each subject to Aarhus University cluster (for parallel % computing purposes). % It makes sense (and therefore it is implemented) only for single_subject % option. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
8e0d201188041ac7ef6f228987d47e92eb32a50c02c07a1fe3b94b3d94a0c37a
MATLAB
2,565
60
%% on the cluster addpath('/projects/MINDLAB2017_MEG-LearningBach/scripts/scripts_osl_learningbach/Cluster') % config of the cluster server see cluster_split.m for more deatails clusterconfig('slot', 1); clusterconfig('long_running', 1); % clusterconfig('scheduler', 'cluster'); MRIsubj = dir('/projects/MINDLAB2017_...
f5507979fe5b2167a840b492c0111a3d18c738894fd84f4ae41f6f4ed94718b7
MATLAB
2,565
67
function computation_gavg_crosscorr(subjects,settings) %-------------------------------------------------------------------------- % Till Habersetzer, 05.07.2025 % Communication Acoustics, CvO University Oldenburg % till.habersetzer@uol.de % % Description: % Computes a group-level grand average from individual-subj...
6345b58feffe68871ab5a66fbc8578004ecfa0547b3dd59c2e749ae39396ba2b
MATLAB
2,566
90
function [pwr_high, pwr_high_rel, pwr_high_rel_max, pd, pd_prop, pd_relative, freq] = mot_FFT(mot_data,TR,varargin) % mot_FFT(mot_data,TR,varargin) % % mot_data = time X motionparam (assumes 6) % TR = TR in seconds % varargin = info about whether or not to make extra plots (if 1 = plot, % default is not to plot) % % lo...
3f030d29da4a9b17380f70acc1e679ee0ab057a8fdd15fbf9dae86548c4dee65
MATLAB
2,568
99
%% files beckprot=xlsread('V:\felles\PROTEOMICS and XRAY\Abundance\Beck-2011-supplementary table 1-protein copies per cell.xls') commprot=xlsread('V:\felles\PROTEOMICS and XRAY\Abundance\Common proteins in IF studies-Supplementary from review modified GS.xls') commprot=xlsread('X:\Elite\kamila\idcombo.xls') %% ...
c478668cf8a122d6d6163a005e993d6a4ae91a041e0d02d6ba8826c41401b61d
MATLAB
2,569
76
% Finding Patches from IRES Solution % Abbas Sohrabpour % 20/2/2018 % Zhengxiang Cai % 30/10/2018 % This version has been vastly improved by removing extra for loops by % using cell arrays and using the unique command and more importantly by % defining a global pointer that avoids checking all global indices by % defi...
f0fca76d61f694640b2598c7abcff9fefc3c188baf009e1268c105b792c17f9c
MATLAB
2,579
60
function dynamicBC_Reslice(PI,PO,NewVoxSize,hld,TargetSpace) % PI - input filename % PO - output filename % NewVoxSize - 1x3 matrix of new vox size. % hld - interpolation method. 0: Nearest Neighbour. 1: Trilinear. % TargetSpace - Define the target space. 'ImageItself': defined by the image itself (corre...
f3fde6813863fc5104aa8712c1cc865889b809c7ec413eda66d06f56a1b89cf2
MATLAB
2,586
72
function [embedding, lambdas] = laplacian_eigenmaps(data, n_components, random_state) %LAPLACIAN_EIGENMAPS Performs non-linear dimensionality reduction using Laplacian Eigenmaps % % [embedding, lambda] = LAPLACIAN_EIGENMAPS(data, n_components) % % Performs non-linear dimensionality reduction using Laplacian Eigenmaps. ...
ec668950cb010717e121ecd00e5e8d61a859fd2b0ee80b308e8f4eb00f3c048f
MATLAB
2,588
84
function pDM = pinv_reg(DM,lambda,regtype,breakPoints) % pDM = pinv_reg(DM,lambda,regtype) % % returns pseudoinverse of design matrix DM with ridge regression % using identity matrix multiplied by parameter lambda % http://www.math.kent.edu/~reichel/publications/square.pdf if nargin<2 % no regularisation lambda =...
c5ade6a216d8eec417f357330bdbe0dd8a40d8733afa668e26d5e6f704b20bb7
MATLAB
2,591
81
function [cij,flag] = makerandCIJdegreesfixed(in,out) %MAKERANDCIJDEGREESFIXED Synthetic directed random network % % CIJ = makerandCIJdegreesfixed(N,K); % % This function generates a directed random network with a specified % in-degree and out-degree sequence. The function returns a flag, % deno...
cbaa9d7e4f2bd05c4f4154b16c90115b734c08269e23c16655964593e1d8ae55
MATLAB
2,598
123
clear tfn = [path_ludisc '\common\Data\MIPCART pilot\Analysis\ParTable_250625.mat']; Tin = load(tfn); %% T = Tin.T; T = T(contains(T.dps_fn, 'resQ_nocov_dps.mat'), :); % keep only resQ T = T(1:2:end, :); % Remove broken retest T = mipp_time_2_commonTime_v2(T, 105); tstr = {'Diffusivity', 'Isotropic variance', '...
65256d02ba65dcfbba5bd613bd7adcd183ffdabf133156b8609fa7a7d900341c
MATLAB
2,600
69
%% IDENTIFICATION OF EXTENDED MVAR MODEL: Y(n)=B(0)Y(n)+B(1)Y(n-1)+...+B(p)Y(n-p)+W(n) % MAKES USE OF ICA (no need of prior knowledge!) %%% input: % Y, M*N matrix of time series (each time series is in a row) % p, model order % idMode, determines strcitly causal estimation algorithm (0:builtin least squares, els...
0c7c9e95147064cc155193b295f168b00e99a3183a7682faf6e3a315136f97df
MATLAB
2,610
55
function drawConvergenceMap(edge_input_struct, input_struct, net_atlas, sig_count_mat, num_tests, names, edge_result, color_map) %DRAWCONVERGENCEMAP View convergence map (chord plot summarizing many %results) % edge_input_struct: edge-level input struct % input_struct: net-level input struct % ...
e5ca555a48cb4b51b611c5921ee48bfe436eae3f591fe0474b05d609dc521999
MATLAB
2,614
94
function out = labelmean(D,L,varargin) % LABELMEAN mean value within label % Averages columns with the same label. D must be a two-dimensional % matrix. L must be a row vector containing integers (NaNs allowed). % These integers are the labels of the corresponding column in D. The % sortbylabelvector flag wi...
7cbb3a3dc4fd3e71ebb4be07add9a276cac32a9ef8760fad10283b98ffd41dfb
MATLAB
2,615
74
function surfw = SurfStatInflate( surf, w, spherefile ); %Inflates a surface towards two fitted hemi-ellipsoids. % % Usage: surfw = SurfStatInflate( surf [, w [, spherefile ]] ); % % surf.coord = 3 x v matrix of coordinates, v=#vertices. % w = weight in [0,1] given to hemi-ellipsoids, default 0.5. %...
5de4da440cbb81ba786ea6ec91a14134f88b2171ee5430e4562a5b99658d270e
MATLAB
2,619
93
%% read csv %pep=csvread('X:\Elite\LARS\2013\mars\tobias\reverse.csv'); %pepval=csvread('M:\Results\Sissel\HeK50\mascot\peparea.csv'); %pepval=csvread('X:\Results\Sissel\HeK50\sequest\pep12.csv'); %rt=csvread('X:\Qexactive\WTH6\WTHRT9RepMHpep.csv',1,6); %rt=xlsread('X:\Qexactive\WTH6\Multiconsensus from 9 Report...
a6fd7677cbb8995c2a21e72102890c357b123cde5d1dcf5521a295e775925462
MATLAB
2,621
64
function [index_old, index_young] = young_or_old(thresh) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Compute the indexes of young and old subjects that have given more than % thresh correct answers. If thresh is empty, it just get the informations % about old and young indexes. % INP...
d9c5dd0bd5c72cca7eab1586182d0f9a83c7e65eb2f4957327178386bc8b6a58
MATLAB
2,623
87
function [GErout,Erout,Eloc] = rout_efficiency(D,transform) % ROUT_EFFICIENCY Mean, pair-wise and local routing efficiency % % [GErout,Erout,Eloc] = rout_efficiency(D,transform); % % The routing efficiency is the average of inverse shortest path length. % % The local routing efficiency of a node u is the ro...
86351cf3dc3b0d06fab4d0a5cda84b122aea07e8d079b83593efbd98266c9710
MATLAB
2,624
96
%% read data synergi=xlsread('L:\Elite\kamila\Copy of FA UDC IM raw data.xlsx') %% synergy check dLR5=synergi(2:5,1:4)' dLR5=synergi(2:5,6:9)' dLR5=synergi(7:10,1:4)' dLR5=synergi(7:10,6:9)' d=dLR5(:,2:4)./repmat(dLR5(:,1),1,3) % control normalization p=anova2(d,1,'off') [h p]=ttest(2-(d(:,1)+d(:,2)),1-d(:...
93c4d173f1b08faf504e41940baa2f4b3877de731c7a6a8ed9e1115f07c98b89
MATLAB
2,626
67
function Plot_K_tpm(data_dir,selectedK) % % Plot the mean transition probability matrices for each condition. % % INPUT: % data_dir directory with the results from running the hypothesis % tests on the state-to-state transition probabilities % selectedK K defined by the user % % OUTPUT: % .fig/.p...
2a6cd3c18864fb403e843290dd0751a67d5da02de226b75f6d583638503b88c7
MATLAB
2,634
61
function model = GenerateModelFitforPlot(data_to_fit,j) UseWeights = data_to_fit.UseWeights; ModelFit = data_to_fit.ModelFit; FitLocError = data_to_fit.FitLocError; NumberOfStates = data_to_fit.NumberOfStates; JumpsPerdT = data_to_fit.JumpsPerdT; JumpProb = data_to_fit.JumpProb(j,:); JumpProbCDF = data_to_fit.JumpProbC...
b5573cb9dddadd778710d33c5379c370dd7a66426b60d435f7fa6a4fb7e15725
MATLAB
2,634
68
classdef WorkShopPerform2018Test < 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 ...
b8a4c29cd0d64919539f6c7a0a111e2aed99476030965255aa1a56ba9a8f7642
MATLAB
2,644
68
function [trl, event] = my_trialfun_olsa(cfg) %-------------------------------------------------------------------------- % Till Habersetzer, 05.07.2025 % Communication Acoustics, CvO University Oldenburg % till.habersetzer@uol.de % % Description: % Custom FieldTrip trial function ('trialfun') for defining epochs fr...
ad9308e62589a5000630a13f952230a28491180a8804cc60bcc4fd9d5e647985
MATLAB
2,649
70
function loc_list_clusters_aspet_ratio_table(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') for i = 1:length(data_to_send) data_...
c54e50f46f93d95c933f289ad5da4e2f305b90ee4a8d43bf8eef085c94a87ff5
MATLAB
2,672
81
function gt = gtom(adj,numSteps) %GTOM Generalized topological overlap measure % % gt = gtom(adj,numSteps); % % The m-th step generalized topological overlap measure (GTOM) quantifies % the extent to which a pair of nodes have similar m-th step neighbors. % Mth-step neighbors are nodes that are reachable ...
69a0f367d990a04e68684318d0b4652ef6777a0dc8fe8fd4515594ed6609829c
MATLAB
2,679
77
function denoised_data_path = melodic_ICA(func_data_path,seg_data_path, stim, numIC) % Preparation for ICA melodic pipeline [outdir,sidename,~] = fileparts(func_data_path); outdir_ICA = [outdir filesep 'ICA_' sidename filesep]; if ~exist(outdir_ICA,'dir'); mkdir(outdir_ICA); end denoised_data_path = fullfile(outdir...
7b5afaad31d4bdc2a293ec0342a3c3957b2432fe9358ce61fa2ff0e6e0fb048d
MATLAB
2,688
81
function O = Cov_GenEig( S ) O = []; % Tests for computing covariance over averaged subjects for generalised % eigenvector solution. % Many solutions here are hard coded and the reason to use the cluster is % to overtake problems about memory. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
a34acbf773df2b643f43b184a4e7c700df3de4134555a15901c8b800139ed13e
MATLAB
2,691
83
%MAT_INTO_HDR The old versions of SPM (any version before SPM5) store % an affine matrix of the SPM Reoriented image into a matlab file % (.mat extension). The file name of this SPM matlab file is the % same as the SPM Reoriented image file (.img/.hdr extension). % % This program will convert the ANALYZE 7.5 SPM...
b72a415f106e506e3f690a25f86fbbb8992f95c96b9b7ec1b63ae9ea4158603e
MATLAB
2,691
62
classdef Heteroskedastic_FAST < nla.helpers.stdError.AbstractSwEStdErrStrategy properties (SetAccess = protected) REQUIRES_GROUP = true; end methods function contrastStdErr = calculate(obj, sweStdErrInput) %Computes Standard Error, but accelerated using assumption ...
15d14da1c21f4895b391964ead5ad607d2a05925d44dcc25cd35187cdd79b0e8
MATLAB
2,699
91
function SurfStatViews( data, vol, z, layout ); %Viewer for slices of volumetric data. % % Usage: SurfStatViews( data, vol [, z [, layout ]] ); % % data = n x v matrix of data if k=1, or n x v x k array of data if % k>1, or a memory map of same. % vol.lat = nx x ny x nz logical array, 1=...
1723932c9cb5b63a24914f061dc78627aedb7d149d4daad106520a4b7f42a69b
MATLAB
2,702
103
function [g2g,Duration_off,Count_off,Rate_off,Duration_on,Count_on,Rate_on,NonREMdur_tot,NPD]=get_off_data_trial(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('isempty',x...
47a42a10a4be151bda212af32753ab561816ac31a825f970c6589d14ceb3aa31
MATLAB
2,712
121
function [Label,Dist] = gin_det_dlabels(XYZmm, MNID, ROI, BORDER_XYZ, BORDER_V) % % Compute Labels and Distances for local maxima % % XYZmm : Local Maxima % MNID : atlas volume with labels values % ROI : structure : link between labels values and label name. % BORDER_XYZ : structure contains the regions edges in...
4a710b4d99f5dcef442df131aecae0392a8482cc0345381f6c32cd6e55ed2201
MATLAB
2,720
63
function spt_tracks_number_of_frames_histogram(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 Number of Frames Histogram','NumberTitle','off','color','w','...
f1b0811f62985384e53dd95aa740b1fb64a80d11f5a3001f658b16fe1196c4f3
MATLAB
2,720
70
% Input % DT - delaunayTriangulation object for a set of [x,y] points % kppt - logical array indicating the [x,y] points that should have their % neighbors identified; length(kppt) = size(DT.Points,1) % dispStrOut - logical value whether to write updates to command window % % Output % neighborList...
65b10e0eaaf8957b64370f2b8ef8b0412ea47cb02a965c9d7292529596228bc0
MATLAB
2,721
52
function pval=pvalvsNull(readleft1,readright1,readleft2,readright2,permno,wsname, v_exclude_left, v_exclude_right) % Calculate the p-value of correlation between two surface maps based on % the null distribution of spins of map 1 % FORMAT pvalvsNull(readleft1,readright1,readleft2,readright2,permno,wsname) % readleft1 ...
bb924736d7f4db64a6e4167fedcbf85d0776c8a95189bcd0e25fc7cee3e94230
MATLAB
2,726
65
function [f,F]=motif4struct_bin(A) %MOTIF4STRUCT_BIN Frequency of structural class-4 motifs % % [f,F] = motif4struct_bin(A); % % Structural motifs are patterns of local connectivity in complex % networks. Such patterns are particularly diverse in directed networks. % The motif frequency of occurren...
90b571dcbd905612a5c6ea00c1a80cbfdb5ca219b80d324e292df1c4a82f63c0
MATLAB
2,739
114
clear % maindir =[path_ludisc 'common/Data\MIPCART pilot\Pilot MRI\']; % % par = 'D'; % srs = {['resq_dki_wf1_' par '.nii.gz'], ['resq_dki_wf2_' par '.nii.gz'], ... % ['resq_dki_wf3_' par '.nii.gz'], ['resq_dki_wf4_' par '.nii.gz']}; % % % % for i = 1:numel(srs) % fnl(i).paths = fix.findFiles(maindir, s...
d11f806627f4909e362e20a7c5de3b921a63cbc3acffbafabf420a3370f61fea
MATLAB
2,739
86
function []=acf(x, k, caption) %ACF Plot of sample autocorrelation function. % % ACF(x) plots the sample autocorrelation function of the univariate % time series in vector x. By default, the sample autocorrelation % function is plotted up to lag 25. ACF(x,k) plots the sample % autocorrelation function up to lag k....
fb368a0f411a9e09e063c92842934e8e4d5e80e3f2657cca237b80fda3d9c77e
MATLAB
2,740
75
function LEiDA_StateTime %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % LEADING EIGENVECTOR DYNAMICS ANALYSIS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Function to plot the state time courses for all participants and plot...
589f0f06e62d5054a167292daef45717e5a0912b568fbc5ead2c9c4a192ac7a9
MATLAB
2,753
100
function [filtdat,empVals,fx] = filterFGx(data,srate,f,fwhm,showplot) % filterFGx Narrow-band filter via frequency-domain Gaussian % [filtdat,empVals] = filterFGx(data,srate,f,fwhm,showplot) % % % INPUTS % data : 1 X time or chans X time % srate : sampling rate in Hz % f : peak frequency of ...
5de92794a4afdc61c04290647c333058b1e2ff51914002229ae46c93fd5f2a28
MATLAB
2,755
80
function [R,eff] = randmio_und_signed(W, ITER) % RANDMIO_UND_SIGNED Random graph with preserved signed degree distribution % % R = randmio_und_signed(W,ITER); % [R,eff] = randmio_und_signed(W,ITER); % % This function randomizes an undirected network with positively and % negatively signed connectio...
755452435904cce08434074cee8e8dc24185bf9491a373689b6bb42c48769383
MATLAB
2,762
94
function result = getProjectionDataFromExperiment(expID) % get projection data from Allen experiment ID % % function data = getProjectionDataFromExperiment(expID) % % Purpose % Get projection information from ARA sample brain(s) given one or more experiment IDs. % These can be searched for using findAllenExperim...
e4d1b1056c7fb0b906feb9b68bad372cafa868a31dd0c3b85d5e4dfb2dd71272
MATLAB
2,762
102
function varargout = findAllenExperiments(varargin) % find all Allen experiments defined parameters % % function [IDs,json]=findAllenExperiments('param1','val1','param2','val2',...) % % % Inputs % 'injection' - search for experiments with injections in this location. not searched for by default. % ...
5659f5bf8e81402ddc5c7f4bf6d458404a181a28fd3114fc11b8491f2c9ed680
MATLAB
2,763
67
function drawCortex(ax, anat, ctx, mesh_alpha, view_pos, color_l, color_r) %DRAWROISONCORTEX Draw ROIs on cortex mesh % net_atlas: relevant NetworkAtlas object % anat: struct containing various inflation values of cortex vertices % ctx: MeshType object determining what mesh inflation value to use ...
3c30afd4be983606aa11bbfcf41c8e9b75793cf5ff102c608d925b21f6a5a026
MATLAB
2,766
80
function [R,eff] = randmio_dir_signed(W, ITER) % RANDMIO_DIR_SIGNED Random directed graph with preserved signed % in/out degree distribution % % R = randmio_dir(W, ITER); % [R,eff] = randmio_dir(W, ITER); % % This function randomizes a directed weighted network with p...
5877ca00404bb330286c8294a6e92f7bd1a83d6a6442fd971ae617327ca7c2ba
MATLAB
2,766
92
function [cfg, varargout] = rollback_provenance(cfg, varargin) % ROLLBACK_PROVENANCE rolls the provenance one step back and should % be used whenever a FT function calls another FT function without % the user being (or having to be) aware of this. % % Some examples for use % % tmpcfg = []; % tm...
e9efbb310157f362cb0ba33d945f45045e279fc6bccf1c91382671d8c4af6dc1
MATLAB
2,768
67
% current working directory needs to be /path/to/scripts mainpath = pwd; addpath([mainpath filesep 'toolboxes' filesep 'analyzePRF']) addpath([mainpath filesep 'toolboxes' filesep 'knkutils']) addpath([mainpath filesep 'toolboxes' filesep 'tc_functions']) addpath([mainpath filesep 'toolboxes' filesep 'OpenFmriAnalysis'...
86c833bf3a7a513a4b2f1e6e4afc19cd0fd256d63668825bb083cbd2da3306cb
MATLAB
2,776
88
function regs_conv = tc_conv_parmod_hrf(regs, config) %% regs_conv = tc_conv_parmod_hrf(regs, config) % convolves input regressors with hrf function using spm % % Note that the function will crash (indendedly), because spm_jobman is % exploited to do the convolution % % regs must be a cell array of different regressors...
b149d5dc6b4d4d8e141bf8236c44235f7cd8eb1c1634587129142b085b0ffdba
MATLAB
2,776
76
function E=efficiency_bin(A,local) %EFFICIENCY_BIN Global efficiency, local efficiency. % % Eglob = efficiency_bin(A); % Eloc = efficiency_bin(A,1); % % The global efficiency is the average of inverse shortest path length, % and is inversely related to the characteristic path length. % % The loca...
c7f21bbb3aecea1bc5c3672ee80d2816db2e11cc1fc30a604e30a5d5b389ff3b
MATLAB
2,777
88
classdef PullDown < nla.inputField.InputField properties display_name name options items_data plot_figure = false label = false field = false value = false end properties (Constant) ARROW_SIZE = 15 % Size of pulldown arrow end ...
d8c8720eb8ba93bc79d88b3cc093d5a38318ef2e5eab02fab0f1d6151952d92c
MATLAB
2,778
84
function O = Induced_Resp_SingleSub_AAL_Coordsj_AarhusClust( S ) O = []; % It sends one job per subject to the Aarhus cluster (for parallel % computing) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % leonardo.bonetti@psych.ox.ac.uk % Leonardo Bonetti, Oxford, UK, 12/06/2022 %%%%%%...
24d60bdc92b63536bbd4b9bd5c1645871d19e3d11619c545ef5f37cf163bcf92
MATLAB
2,788
63
function spt_tracks_last_first_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...
3203787d071702a7904ed6d8952b5dbc7e91466b815f9d1133f82f496a9dc2b3
MATLAB
2,791
82
function shape_classification_iterative_pairwise_clustering(data) input_values = inputdlg({'Mass Coeff. of Variation Threshold:','Lengh Coeff. of Variation Threshold:','Width Coeff. of Variation Threshold:'},'',1,{'10000000','0.15','0.15'}); if isempty(input_values)~=1 coefficient_of_variation = [str2double(inpu...
81bc9b8db0048836f1e9cc17dda067ad3888348a758c3f032c30a054e696475b
MATLAB
2,791
96
function TS_rnd = PhaseRand_surrogates(TS, value) % FUNCTION TS_rnd = PhaseRand_surrogates(TS, value) % takes time-series (TS) and type of randomization (value) as inputs and % provides phase-randomized TS as output. % % inputs: TS(t,n) --> rows are t different time-points; % columns are n ...