sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
0eee1728ab2bdab8fb08cc63d01f6833dbda71055b02758c706e3a70741aa53c | MATLAB | 6,327 | 153 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Fast unwrapping 2D phase image using the algorithm given in: %
% M. A. Herráez, D. R. Burton, M. J. Lalor, and M. A. Gdeisat, %
% "Fast two-dimensional phase-unwrapping algorithm based on sorting by ... |
2303a8fb97816fe90003e7f51bf24b6dcd72f9139461cad315da149d6c10abef | MATLAB | 6,328 | 223 | weights = cell(1);
for i = 1:32
for j = 1:32
TMP = rand(48,48).^2;
TMP(2:3:end,2:3:end) = 0;
weights{i,j}= TMP;
end
end
ds = 2.5*[1 101/3]; % propagation distances
[posx,posy] = meshgrid(-58.125:3.75:58.125,-58.125:3.75:58.125);
spa = 7.5e-3; % weight spacing
input = rand(... |
dbe72991aa496e762d62708b226003def0993b6f7cf9a49267ae478259e8546f | MATLAB | 6,328 | 168 | function [Z, P, X, A] = sparse_pca(A, m, gamma)
% Sparse principal component analysis based on optimization over Stiefel.
%
% [Z, P, X] = sparse_pca(A, m, gamma)
%
% We consider sparse PCA applied to a data matrix A of size pxn, where p is
% the number of samples (observations) and n is the number of variables
%... |
e17b625162b2c106045f43764bf365b075e50d364ce617f84ee5487f10b93d23 | MATLAB | 6,329 | 140 | function [chline,clline,pchline,nclline,sdposline,sdnegline,sddataline]=DetermineThresholds(data,Settings,DoDisplay)
%Given data, shifted to recenter around 0, determine cutoffs of positive data points, negative datapoints, and all datapoints.
%Used to set automatic thresholds in spike-determination. Optionally disp... |
a27041dc538d14db653e7f7b06deec598d8535329fc806b5df9369b68f68c8b0 | MATLAB | 6,335 | 215 | function SPT_timedata_Ca(basename)
%basename:the basename should be the same for tracking and for miniscope data
%session_number: the number of the session that you want to extract inthe trk file
SR=30;
binSec = 0.033;
%%%%%%%%%%%%%%%%%%%%%%Load data%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
miniscope_data=load([basena... |
3148a7054a2ac4887cf7ca5ecd72d04ec6d83f54e0e1582b6e1f9cdf09ab2d8e | MATLAB | 6,337 | 157 | function [Points, Fiducials] = ChangeCoordinates(Points, Fiducials, ...
Scaling, Orientation, System, Inverse, Vector, Verbose)
% Change to/from CTF or Curry coordinates given MEG fiducial coordinates.
%
% [Points, Fiducials] = ChangeCoordinates(Points, Fiducials, ...
% Scaling, Orientation, System, Inv... |
e854e27e3dd606052cd4b09be33e45502c4a62a1f1b60e06844e3d494925abd6 | MATLAB | 6,338 | 188 | % first we load a list of the names of EEG-channel
% we had in a given experiment. Your list may ONLY contain
% EEG channels (not EOG channels or others). Your list
% must be a subset of the example below.
load clab_example;
% Preparation of a structre which contains
% all necessary information apart from funct... |
fbd356efffbfd63e7d18aa64c1953b153c1fc7d962c15d4428040192d1d883e2 | MATLAB | 6,338 | 97 | function [ time, X, parameters ] = modelRunner_ToRORd( X0, options, parameters, beats, ignoreFirst)
% Parameters are set here
% defaults which may be overwritten
cellType = 0; if (isfield(parameters,'cellType')) cellType = parameters.cellType;end
% if the number of simulated beat is to be printed out.
verbose = fals... |
5a633632870353663c01952078a773a8f8b1406f73f8b784b045f795dbe83fb4 | MATLAB | 6,344 | 216 | function [out1,out2,out3] = ginput2(arg1)
%GINPUT Graphical input from mouse.
% [X,Y] = GINPUT(N) gets N points from the current axes and returns
% the X- and Y-coordinates in length N vectors X and Y. The cursor
% can be positioned using a mouse (or by using the Arrow Keys on some
% systems). Data points a... |
f794c27ed5d565b10f2c209ad250b42e887b05aea8c39109ee0d8cbc7f534c69 | MATLAB | 6,345 | 209 | function [Mean_MMT_Shoulder_Elbow] = Muscle_Moment_G9(x)
% MATLAB code provided by Seyed Mohammad Ali Rahmati
% Affiliation: Biomechanics and Motor Control Lab, Department of Biological Sciences, Georgia Institute of Technology, Atlanta, GA.
% This script computes the maximum muscle moment averaged over the cycle as a... |
c403da3f552e7cd4b7f540646599c4cabf452a1142c977d2ee2b4512fcf6a5fb | MATLAB | 6,349 | 175 | % Author: Birgit Nierula
% nierula@cbs.mpg.de
function ga_data4robustness_allsubj(subjects, conditions, srmr_nr)
%% reorganize matrices
% set paths
savepath_ga = getenv('GADIR');
%% =================================
%% single trial data
% Merve's data = Number of Subject x Amplitude for each trial
%% =============... |
000a11f06bae851779c5e7e7465e30e2a1e7de449da959797c16605f040117df | MATLAB | 6,350 | 260 | %if exist('images_read');
% active_images = active_images & images_read;
%end;
var2fix = 'dX_default';
fixvariable;
var2fix = 'dY_default';
fixvariable;
var2fix = 'map';
fixvariable;
if ~exist('n_ima'),
data_calib_no_read;
end;
check_active_images;
% Step used to clean the memory if a previous atttempt ... |
a34aff80c67498ff84269613bae4194be63222dccbbb6001f041c18ccfa7accc | MATLAB | 6,350 | 174 | % Seven-point stencil on the unit cube, constant-coefficient Helmholtz equation,
% Dirichlet boundary conditions.
%
% This is basically the 3D analogue of FD_SQUARE3.
%
% Inputs (defaults are used if not provided or set empty):
%
% - N: number of discretization points in each dimension (default: N = 32)
% - K: wave... |
0176f24a6416a84ffef0713376d2809b72f5da3225d89eebf6442611e3cf4460 | MATLAB | 6,351 | 148 | function [MUAResponses, allClicks_mua, allClicks_lfp] = MUAPercentChange(seizureInfo, Behavior, params)
% this function extracts the vrms mua signal from the seizure files,
% divides it into clicks and normalizes it by baseline to compute percent
% change which can be later used to generate mua percent change plots for... |
16ae4c1642f7702d92a32785ce1995a406a21f4c4fb9334e28746d27dfcf2c88 | MATLAB | 6,351 | 199 | function out=import_wcp(fn, varargin)
%IMPORT_WCP Import WinWCP files.
% OUT=IMPORT_WCP(FN) imports data recorded with WinWCP, where FN is a
% string containing the filename. OUT is the output struct containing the
% following fields:
% S Cell with C elements, where C is the number of channels.
% ... |
38fdfbd1cb83199c41134de971c29acbda8fca92dc6c407a587b9cf034f3604b | MATLAB | 6,352 | 244 | function [ps,ix] = dpsimplify(p,tol)
% Recursive Douglas-Peucker Polyline Simplification, Simplify
%
% [ps,ix] = dpsimplify(p,tol)
%
% dpsimplify uses the recursive Douglas-Peucker line simplification
% algorithm to reduce the number of vertices in a piecewise linear curve
% according to a specified tolerance. The a... |
6f20e188aef9f3f0bc66cd2dbefd2a140104ad12d38c9c083729ab5db7f3030b | MATLAB | 6,353 | 234 | %% Cell-Structure Horizonal Concatenation
% perform horizontal concatenation of array elements across a cell (dim 2)
% assumes that the 1st dimension is constant across all rows; tranpose if
% this assumption is violated
% 4.27.22 Update: Permits concentation of cell arrays of cells; requires the
% cellstructure... |
d33d60b60d9bdb439ea5687ceadf5049d6f7387d2733e8ef97cba9e8b4298dde | MATLAB | 6,354 | 173 | function MEIAnalysis = h_MEIAnalysis3(handles)
global h_img3;
[currentInd, handles, currentStruct, currentStructName] = h_getCurrendInd3(handles);
improfileOpts = h_getImprofileOpts(handles);
n = improfileOpts.lineWidth;
individuals = [];
avg = [];
% measure line profile
redImg = currentStruct.ima... |
48cd4be3b780493ecebd645b5cc1a1d27add5e140c8fdfb16d13d983540d4eba | MATLAB | 6,356 | 206 |
successes = 0;
for t_idx = 1:size(transcripts,1)
if all(transcripts(t_idx,2:3) == [3 2])
successes = successes +1;
end
end
successes
%% Score it
for base_idx = 1:params.NUM_CHANNELS
perc_base(:,base_idx) = sum(transcripts==base_idx,1)/size(transcripts,1);
end
figure;
% Chan 1 = Blue
% Chan 2 = Gr... |
daed29e90175020605984d1b0609529d3e1f0cfae342c00498785c5a3c1dabb5 | MATLAB | 6,356 | 200 | function [ok, message] = isalmostequal(a, b, varargin)
% ISALMOSTEQUAL compares two input variables and returns true/false
% and a message containing the details on the observed difference.
%
% Use as
% [ok, message] = isalmostequal(a, b)
% [ok, message] = isalmostequal(a, b, ...)
%
% This works for all possible i... |
9f34df3e6a07bdca401e2475317e22b87632d818a5b7308c08aa00d2dad4f2a8 | MATLAB | 6,358 | 170 | % Seven-point stencil on the unit cube, variable-coefficient Poisson equation,
% Dirichlet boundary conditions.
%
% This is basically the 3D analogue of FD_SQUARE2.
%
% Inputs (defaults are used if not provided or set empty):
%
% - N: number of points + 1 in each dimension (default: N = 32)
% - OCC: tree occupancy ... |
6aa7f07d3e054f1356c220b21cf2b28a83d774dddfbdf7bdca3b39f2c7995fc8 | MATLAB | 6,359 | 217 | function ie_fmm3dbie_sqrtscaling(ik,npu,norder)
% IE_SPHERE An example usage of strong skeletonization, solving a
% second-kind integral equation (Helmholtz combined field potential) on a
% wiggly torus
%
% - OCC: The occupancy parameter, specifying the maximum number of
% points a node in ... |
0f28b6c372a802d0dc59699916b56e899691378c76aa4bf895336e7816aab33d | MATLAB | 6,360 | 219 | function [Mean_MMT_Shoulder_Elbow] = Muscle_Moment_G3(x)
% MATLAB code provided by Seyed Mohammad Ali Rahmati
% Affiliation: Biomechanics and Motor Control Lab, Department of Biological Sciences, Georgia Institute of Technology, Atlanta, GA.
% This script computes the maximum muscle moment averaged over the cycle as ... |
c712ffe78a29f2f353b648363fba8c9ea000833151a830fa068c5eb98dcb0998 | MATLAB | 6,365 | 173 | %% autocov_to_smvgc
%
% Calculate conditional frequency-domain MVGC (spectral multivariate Granger causality)
%
% <matlab:open('autocov_to_smvgc.m') code>
%
%% Syntax
%
% [f,fres] = autocov_to_smvgc(G,x,y,fres,useFFT)
%
%% Arguments
%
% See also <mvgchelp.html#4 Common variable names and data structures>.
%
% _inpu... |
7409aefc001cec226b3097a3e340adc272678a7c3d560509622f2a8861af5fb4 | MATLAB | 6,366 | 93 | %% RELAX EEG CLEANING PIPELINE, Copyright (C) (2024) Aron Hill & Neil Bailey
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% any later... |
b36fea6fe46cbb1d31664c8ad61c413370c7c5e7bca842a9ea86b1e46ab0583b | MATLAB | 6,366 | 233 | function vesselness = vesselness2D(I, sigmas, spacing, tau, whiteondark)
% calculates the vesselness probability map (local tubularity) of a 2D
% input image
%
% vesselness = vesselness2D(I, sigmas, spacing, tau, whiteondark)
%
% inputs,
% I : 2D image
% sigmas : vector of scales on which the vesselness is comput... |
150038cee03299f359658cbc3171cf3c74624e2e9d32266b80bb7d4a6edfa152 | MATLAB | 6,368 | 137 | function dataout = ft_interpolatenan(cfg, datain)
% FT_INTERPOLATENAN interpolates time series that contains segments of nans obtained
% by replacing artifactual data with nans using, for example, FT_REJECTARTIFACT, or
% by redefining trials with FT_REDEFINETRIAL resulting in trials with gaps.
%
% Use as
% outdata =... |
5d2ed16b8ece2b80c7d89f7cb04be8e87d135acee64625ad0f80802fffa8c2bd | MATLAB | 6,368 | 155 | function CBIG_preproc_CensorQC_sort_plot(vol1_inmask, vol_m_inmask, vol2_inmask, N_inmask, outliers,...
FRAC_DIFF_inmask, CORR_inmask, outname_noext, measure_name)
% CBIG_preproc_CensorQC_sort_plot(vol1_inmask, vol_m_inmask, vol2_inmask,
% N_inmask, outliers, FRAC_DIFF_inmask, CORR_inmask, outname_noext, measure_n... |
44acdf86b4c7d6025cfdcf99d25e584b422ccfaaaf55aed7213eb33fa6ae35ca | MATLAB | 6,370 | 137 | function [dataout] = ft_interpolatenan(cfg, datain)
% FT_INTERPOLATENAN interpolates time series that contains segments of nans obtained
% by replacing artifactual data with nans using, for example, FT_REJECTARTIFACT, or
% by redefining trials with FT_REDEFINETRIAL resulting in trials with gaps.
%
% Use as
% outdata... |
10a7a7088c591de612ad51d20d7a65a9c3d6f1f1d0edcb35d46d28119bb3516b | MATLAB | 6,371 | 159 | %% Reproduce figures 12.2, 12.3 and 12.5 in Hastie ESL 2nd ed.
% PMTKneedsOptimToolbox
%% Generating Models
% Generate data as per Hastie 2ed, pg 16: two classes, blue and orange,
% each with a mixture of 10, 2D Gaussians.
%PMTKslow
% This file is from pmtk3.googlecode.com
requireOptimToolbox
setSeed(42);
ncenters = ... |
7c589e66aefcd0b16d92ea55a408473c28fbc975827859309c9871327156a66a | MATLAB | 6,374 | 193 | % Covariance matrix on the unit line, Matern 3/2 kernel.
%
% This is basically the same as COV_LINE1 but using the Matern 3/2 kernel.
%
% Inputs (defaults are used if not provided or set empty):
%
% - N: number of points (default: N = 16384)
% - OCC: tree occupancy parameter (default: OCC = 128)
% - P: half-numbe... |
5f3388cd9fe3c2e7197fec40f8dc54bc3a60f758b29758cb96dcfd7105563f40 | MATLAB | 6,375 | 159 | function [phi] = semi_infinite_TR(mua, musp, n, rsd, T, dt, boundary)
% SEMI_INFINITE_TR Returns time-resolved boundary reflectance as collected
% on semi infinite surface.
%
% SYNTAX:
% [PHI] = SEMI_INFINITE_TR(MUA, MUSP, N, RSD, T, DT)
% [PHI] = SEMI_INFINITE_TR(MUA, MUSP, N, RSD, T, DT, BOUNDARY)
%
% [PHI] = ... |
dad291b17d4235ecc3abb5b64fea7f976b96303c53fea719e0089c9bad159f68 | MATLAB | 6,375 | 230 | function LAN = electrode_lan(LAN,electrode,only)
% <*LAN)<]
% v.1.2
% LAN = electrode_lan(LAN,electrode,only)
% Elemina electrodes
% electrode = [1 4 ...] % numero del electrodo
% electrode = {'FP1'} % nombre del elet... |
9d917c23ff072c2737d1784098f47ae4adbac0d56ba5ff156c75c9ed216a7911 | MATLAB | 6,376 | 197 | function palm_plot(Y,X,I,Z,res,F,opt)
% Take a vector of data, a design, a constrast, then
% plots. If the code detects that what the contrasts
% is testing is an interaction, it constructs
% interaction plots.
%
% Usage:
%
% palm_plot(data,design,contrast,res,F,opt)
%
% - Y : Data.
% - X : Main effects (... |
af4918fd9f3477163225cd67c0a30ea7003a6aed1d5a187a2567be5536c5af71 | MATLAB | 6,376 | 156 | %% GSA_GetSy_MultiOut_MultiSI: calculate the Sobol' sensitivity indices
%
% Usage:
% [S, eS, pro] = GSA_GetSy_MultiOut_MultiSI(pro, iset, verbose)
%
% Inputs:
% pro project structure
% iset cell array or array of inputs of the considered set, they can be selected
% ... |
2890804d47ddf9e0a5debdc2c1ff79a1ed83ee45667739c33caefc12deee8503 | MATLAB | 6,378 | 230 | function [F,Vx,Vy,Vz] = tomosegmemtv( varargin )
% TOMOSEGMEMTV Centreline detection of plane ridges, membranes (Mac OS version 0.2)
% INPUT:
% I - Input tomogram (foreground dark), all of its dimension must be greater than 3
% s - Scale factor
% t - Membrane thickness factor
% v - (option... |
f16cefea9f163525c6eb1cc5243697fe302338d6cbd50c8cc21f48a579f3546e | MATLAB | 6,379 | 138 | function varargout = DPABINet_Install(varargin)
% DPABINET_INSTALL MATLAB code for DPABINet_Install.fig
% DPABINET_INSTALL, by itself, creates a new DPABINET_INSTALL or raises the existing
% singleton*.
%
% H = DPABINET_INSTALL returns the handle to a new DPABINET_INSTALL or the handle to
% the exis... |
1f192264d454f94a458430fafb9fda23d9f61e57437c2838f055492ca07e83a1 | MATLAB | 6,380 | 230 | function [F,Vx,Vy,Vz] = tomosegmemtv( varargin )
% TOMOSEGMEMTV Centreline detection of plane ridges, membranes (Mac OS version 0.2)
% INPUT:
% I - Input tomogram (foreground dark), all of its dimension must be greater than 3
% s - Scale factor
% t - Membrane thickness factor
% v - (option... |
d9e5d93b64c6b19785959abb9d995330995c37fa4fcec0e57dddd2c1d2911216 | MATLAB | 6,381 | 230 | function [F,Vx,Vy,Vz] = tomosegmemtv( varargin )
% TOMOSEGMEMTV Centreline detection of plane ridges, membranes (Mac OS version 0.2)
% INPUT:
% I - Input tomogram (foreground dark), all of its dimension must be greater than 3
% s - Scale factor
% t - Membrane thickness factor
% v - (option... |
fd803ee3656e82bd77911f32ce7699bb01ce17f41921bfc51a0ddc9142fc9140 | MATLAB | 6,381 | 111 | % GEN_MASS_MATRIX_TR_MOMENTS_CUDA Builds sparse matrices representation of
% time-resolved diffusion transport equation for direct calculation of
% moments of the time-resolved curves. Matrices can represent a FEM mesh
% in 2D (triangles) or 3D (tetrahedrons) space. Parallelized for
% multithreading with NVidia... |
6ad5bb9d4e4a84c944d25d6b113689b71a8ac7872a6ae99973e13aab361df6d2 | MATLAB | 6,382 | 190 | function [H, pValue, CM_limiting_stat] = cmtest2(x1 , x2 , alpha)
%CMTEST2 Two-sample Cramer-von Mises goodness-of-fit hypothesis test.
% H = CMTEST2(X1,X2,ALPHA,TAIL) performs a Cramer-von Mises (K-S) test
% to determine if independent random samples, X1 and X2, are drawn from
% the same underlying continuous po... |
9db172437d80fa36fff02887b4ab9262da868822a4892d71e062e554f3c457be | MATLAB | 6,383 | 230 | function [F,Vx,Vy,Vz] = tomosegmemtv( varargin )
% TOMOSEGMEMTV Centreline detection of plane ridges, membranes (Mac OS version 0.2)
% INPUT:
% I - Input tomogram (foreground dark), all of its dimension must be greater than 3
% s - Scale factor
% t - Membrane thickness factor
% v - (option... |
c8d2dac9eb8bdfbcc904e32defdc4a3034097e2de185339502517e314e5a84b0 | MATLAB | 6,383 | 205 | %TENMAT Store tensor as a matrix.
%
%TENMAT Methods:
% ctranspose - Complex conjugate transpose for tenmat.
% disp - Command window display of a matricized tensor (tenmat).
% display - Command window display of a tenmat.
% double - Convert tenmat to double array.
% end - Last index of inde... |
45835174dd44b2f60bd542617a0e3836c2c4fc9511debda3c4c3a6c0614b8dcd | MATLAB | 6,385 | 221 | function A = convnfft(A, B, shape, dims, options)
% CONVNFFT FFT-BASED N-dimensional convolution.
% C = CONVNFFT(A, B) performs the N-dimensional convolution of
% matrices A and B. If nak = size(A,k) and nbk = size(B,k), then
% size(C,k) = max([nak+nbk-1,nak,nbk]);
%
% C = CONVNFFT(A, B, SHAPE) controls... |
3f068102dd3a01966a2da907ad9bb11c6715468ef954f73429a5f660be6cdea1 | MATLAB | 6,386 | 183 |
clear
% close all
Monkey = ['Monkey1']; % ['Monkey1' or 'Monkey2']
Base = ['PER_ON'];
%------------------------------------------
Align = [{'PER_ON_long'}];
for al = 1:length(Align)
switch Monkey
case 'Monkey1'
load(['TEST_SpettroXCHANNELS_SD_base_' Base '_' Align{al} '_B2b.mat'])
sta... |
4b3e098cd29169eb2b8349922112fe75761856d34752706a5c6080242ad18724 | MATLAB | 6,386 | 181 | function [bels, logZ, origBels] = dgmInferQuery(dgm, queries, varargin)
%% Compute sum_H p(Q, H | V) for each Q in queries
%
%% Inputs
%
% dgm - a struct as created by dgmCreate
% queries - a query, (i.e. a list of variables) or a cell array of queries
%
%% Optional named inputs
%
% doPrune - [false] if true, ... |
bf24b193adfee671c02c0a367d773787cdbe0d8130f8d671b6a258fd7d362fc4 | MATLAB | 6,387 | 191 | function VisHarmonizationResults(Data_beforeHarmonization, Data_afterHarmonization, SiteLabel, savepath)
% Draw harmonization results comparing data before and after harmonization
%
% Inputs:
% Data_beforeHarmonization - Data matrix before harmonization
% Data_afterHarmonization - Data matrix after harmonization
%... |
ff9aeb40669520b57c89928c2f8c4a6daac06c2b4fb87971a1187969020ba7fe | MATLAB | 6,387 | 163 | % Five-point stencil on the unit square, constant-coefficient Poisson equation,
% Dirichlet-Neumann boundary conditions.
%
% This is basically the same as FD_SQUARE1 but with Dirichlet boundary
% conditions along the top and bottom sides of the domain, and Neumann boundary
% conditions along the left and right sides. T... |
6a315ca5add51987ca38892d4c66373686f110248376e5e7b64c4b0a26082bb3 | MATLAB | 6,389 | 230 | function [F,Vx,Vy,Vz] = tomosegmemtv( varargin )
% TOMOSEGMEMTV Centreline detection of plane ridges, membranes (Window 64 bits version 0.2)
% INPUT:
% I - Input tomogram (foreground dark), all of its dimension must be greater than 3
% s - Scale factor
% t - Membrane thickness factor
% v -... |
d925c9866e6ae3fc4cb609b0c24f81b8ebd658b49b2769ebda552bf005f784d8 | MATLAB | 6,389 | 186 | function varargout = w_ThrdMotion(varargin)
% W_THRDMOTION MATLAB code for w_ThrdMotion.fig
% W_THRDMOTION, by itself, creates a new W_THRDMOTION or raises the existing
% singleton*.
%
% H = W_THRDMOTION returns the handle to a new W_THRDMOTION or the handle to
% the existing singleton*.
%
%... |
af4d6c2508d8e47adb002f8865247f4c893ffce40d8c5711d20dbc9261bf7b42 | MATLAB | 6,390 | 150 |
function run_format_settings(figure_handle,varargin)
%varargin - settings that are not for the main figure
% match_ax, match_Xax, match_Yax: match limits of multiple axes. Can choose both, or only X or Y
% ...any other type of figure that doesn't run with the main settings
%%%% Load settings
form = formatting_settin... |
34c8811bc3e4acb5111efa27b205bd30deeae790a37fe92baf370d8873d6769d | MATLAB | 6,395 | 214 | function windowlevel(hImage, hCaller)
%WINDOWLEVEL Interactive Window/Level adjustment.
% WINDOWLEVEL(HIMAGE, HCALLER) activates window/level interactivity on
% the target image. Clicking and dragging the mouse on the target image
% changes the image's window values. Dragging the mouse horizontally from
% lef... |
083267f935fe9d221b60731a69ee19fa72e38c92c91871e8a41fb0d0c90b1511 | MATLAB | 6,398 | 221 | clc;
clear all;
%%read tractography file that is in vtk polydata
Name=strcat('ThalamicRadiationR.vtk');
fid = fopen(Name,'r');
C= textscan(fid,'%f %f %f %f %f %f %f %f %f','HeaderLines', 5);
unordered_coords = [C{1,1},C{1,2},C{1,3},C{1,4},C{1,5},C{1,6},C{1,7},C{1,8},C{1,9}];
ID = 1;
row = 1;
Coords_ID = zeros(length(... |
d0f5a4caae1ca322716aaca4949db6377699b997206c3ecee21f9e5b921e75bf | MATLAB | 6,400 | 135 | function [dCA1_PET] = dCA1_PET_atlas(PET_scan,MRI_atlas)
save_imgs = 0;
%% Slices
% Column 1 - left
regions = cell(12,2);
regions{1,1} = [98 49;103 50;106 53;109 59;111 65;111 71;106 79;104 73;105 66;103 58;101 53]; %slice=114
regions{2,1} = [97 48;102 48;106 52;109 57;111 64;111 71;106 79;103 73;105 66;103 58;... |
5ec068136786fdbcce26a2ea12bea18aba010d6890f45a02705966907e40259b | MATLAB | 6,402 | 160 | function [xvals_ofmeanfit_dT,yvals_ofmeanfit_dT,...
xvals_ofmeanfit_dS,yvals_ofmeanfit_dS,...
xvals_ofmeanfit_dT_allmice,yvals_ofmeanfit_dT_allmice,...
xvals_ofmeanfit_dS_allmice,yvals_ofmeanfit_dS_allmice,...
F_equation_dT] = calc_stability(data, metric, showplots, fig_numb)
if nargin<4 | isempt... |
fd08c883e202a1d90b055e064fcc36e9375d82857e9095bd22d0815217d807e3 | MATLAB | 6,402 | 219 | function A = convnfft(A, B, shape, dims, options)
% CONVNFFT FFT-BASED N-dimensional convolution.
% C = CONVNFFT(A, B) performs the N-dimensional convolution of
% matrices A and B. If nak = size(A,k) and nbk = size(B,k), then
% size(C,k) = max([nak+nbk-1,nak,nbk]);
%
% C = CONVNFFT(A, B, SHAPE) controls... |
a06d73e32df32783fadd0e43c4db76546a56a02000c4c78947f7fe1dc69fc07f | MATLAB | 6,404 | 230 | function [ newevents avglongestprobe avgendtotal convergefrac ] = ...
wlProc_doEvAnnealAllWave_MT( ...
oldevents, samprate, wavedata, ...
comparefunc, maxprobes, maxtotal)
% function [ newevents avglongestprobe avgendtotal convergefrac ] = ...
% wlProc_doEvAnnealAllWave_MT( ...
% oldevents, samprate, w... |
5dbd750db3ae7d35e85d77a96721361161b70b33aae68536c84c1c4acc027798 | MATLAB | 6,406 | 179 | function str = VBA_spm_file(str,varargin)
% Character array (or cell array of strings) handling facility
% FORMAT str = spm_file(str,option)
% str - character array, or cell array of strings
% option - string of requested item - one among:
% {'path', 'cpath', 'fpath', 'basename', 'ext', 'filenam... |
7e3471aa13c7342bb2b06b55b797a469abf259f5bbcfee24bf7962bb2bbceb87 | MATLAB | 6,406 | 138 | function perm_id = rotate_parcellation(coord_l, coord_r, nrot)
%
% Usage:
% perm_id = rotate_parcellation(coord_l, coord_r, nrot)
%
% Description:
% Rotate parcellation (authors: @frantisekvasa, @saratheriver)
%
% Inputs:
% coord_l (double array) - Coordinates of left hemisphere regions on the sphere, size = [m x... |
ae0c90a0251dc4a1bc3a528d31ebfecf78655f471d7e9a2460c18a386f7a83aa | MATLAB | 6,408 | 225 | function [xbest, fx, num_eval, info]=...
subplex(func,x,opt1,blank,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10)
% SUBPLEX -
% SUBPLEX uses the subplex method to solve unconstrained
% optimization problems. The method is well suited for
% optimizing objective functions that are noisy or are
% discontinuous at the solution.... |
423a9912de143a3820e339b630e33a949226cf664fd62f27e7ed0779a498e2d7 | MATLAB | 6,409 | 149 | function ft_plot_axes(object, varargin)
% FT_PLOT_AXES adds three axes of 150 mm and a 10 mm sphere at the origin to the
% present 3-D figure. The axes and sphere are scaled according to the units of the
% geometrical object that is passed to this function. Furthermore, when possible,
% the axes labels will represent ... |
92fdd252d4fde8508ee4825f92bc18b6c041a3e05bf525acac260b8356a79701 | MATLAB | 6,409 | 176 | % Seven-point stencil on the unit cube, constant-coefficient Helmholtz equation,
% Dirichlet boundary conditions.
%
% This is the same as FD_CUBE3 but using HIFDE3X.
%
% Inputs (defaults are used if not provided or set empty):
%
% - N: number of discretization points in each dimension (default: N = 32)
% - K: waven... |
7bc778d24b8302af57d45f56145b36440c698d0ad7770138ee07cb59e3bba8c8 | MATLAB | 6,410 | 107 | % GEN_MASS_MATRIX_TR_CUDA Builds sparse matrices representation of
% time-resolved diffusion transport equation within FEM mesh in 2D
% (triangles) or 3D (tetrahedrons). Parallelized for multithreading with
% NVidia CUDA. Uses all available power of the strongest NVidia GPU
% installed. This function is limited... |
0b24bfa18bde39410de5f1d26f27d3d40155978f412ad2ca32c792f5dff36346 | MATLAB | 6,417 | 149 | function ft_plot_axes(object, varargin)
% FT_PLOT_AXES adds three axes of 150 mm and a 10 mm sphere at the origin to the
% present 3-D figure. The axes and sphere are scaled according to the units of the
% geometrical object that is passed to this function. Furthermore, when possible,
% the axes labels will represent ... |
c9f0a5e7f232f8c16a7ce68c59119ee0178ab383eb7bc1e7ad327596c7143397 | MATLAB | 6,418 | 183 | function varargout = interp_ungridded(pos_from, pos_to, varargin)
% INTERP_UNGRIDDED computes an interpolation matrix for two
% clouds of 3-D points
%
% Use as
% [val] = interp_ungridded(pos_from, pos_to, 'data', valin, ...)
% where
% pos_from Nx3 matrix with the vertex positions
% pos_to Mx3 matrix with the... |
fe6a7c5904b5ed6f3c7cca7fa842f4bb9b04c5f10bd389bc3be03beec474c244 | MATLAB | 6,418 | 183 | %TENSOR Class for dense tensors.
%
%TENSOR Methods:
% and - Logical AND (&) for tensors.
% collapse - Collapse tensor along specified dimensions.
% contract - Contract tensor along two dimensions (array trace).
% ctranspose - is not defined for tensors.
% disp - Command window display of... |
4cce6f27afbafc27d40df88daf659f571d3618049f67fa4491924571423ac1f0 | MATLAB | 6,426 | 178 | function Results = restructure_pin_record(Results)
%% Restructure raw record of pin releases from stochastic simulations
%
% Syntax: Results = restructure_pin_record(Results)
%
% Inputs:
% Results::struct Raw results of stochastic simulations
%
% Outputs:
% Results::struct Simulation results with restructur... |
7df5d989fee1e3729d212042062587fda23588abb16af9cc993dcc2461edcaa2 | MATLAB | 6,426 | 114 | function [r_overall, p_overall, t_overall, r_bytask, p_bytask, taskActualMatrix, taskPredMatrix, r_bysubj, r_avgfirst_bytask, r_avgfirst_mean] = actflowmapping(taskActMatrix, connMatrix)
%actflowmapping(taskActVector, connMatrix)
%
%Input variables:
%taskActMatrix - A regionXtaskXsubject matrix with activation levels
... |
98f9b23124d0bdb888d111abbb7cbe92711e1ae4003443e591b94c6cd3ea7f22 | MATLAB | 6,427 | 174 | % Plot normalized ITPC TS by att w shaded error bars
%% Settings
titleVis = 0; % if title vis off, then will plot for appropriate manuscript size
showN = 1; % show n = X annotation
figFormat = 'svg'; % svg
plotErrorBars = 1; % turn off for subject-level plots
restrictYLim = 0; % turn on for group-level manuscript... |
a6d5878336f50da93df7b7ea445cfb64481f373bf4aa1f31736f56bda754952c | MATLAB | 6,428 | 253 | function [mesh_p mesh_e ext_bdy_nodes regions] = ...
mask2mesh(I,pixel_dim,edge_size,tri_area)
% [mesh_ele mesh_nodes bdy_nodes] = mask2mesh(I)
% Creates a 2D triangular mesh using the mask info defined in I
% I : input mask (either filename or a grascale image matrix
% pixel_dim : size of each... |
0470901cbfccdff4d3b736a0ecb509e35ce17b76b242fc3d91442423241a6513 | MATLAB | 6,429 | 207 | function T = shypoct(x,occ,lvlmax,ext)
% SHYPOCT Build hyperoctree.
%
% T = SHYPOCT(X,OCC) builds a hyperoctree T over a set of points X such that
% each nonempty hypercube node in T is recursively subdivided until it
% contains at most OCC points. The tree T is structured as follows:
%
% NLVL - tree... |
e5f66410e350032616bc987f66358b260e069aab2a84a4847438ef39797c60a6 | MATLAB | 6,431 | 212 |
function [Leader_pos,Leader_score,ConvergenceCurve] = GEO(fobj,trdata,trlabel,tstdata,tstlabel)
lb = 0;
ub = 10;
dim = 50;
nvars=5;
options.PopulationSize =1;
options1.PopulationSize = (options.PopulationSize);
SearchAgents_no=options.PopulationSize;
options.MaxIterations =10;
options1.MaxIterations=opt... |
93b10d53d3139f2b6725c9721f7d829f3843f8e6f38d3ecd9afd294e560d8a82 | MATLAB | 6,432 | 224 | function ie_fmm3dbie_sqrtscaling_stor_load()
% IE_SPHERE An example usage of strong skeletonization, solving a
% second-kind integral equation (Helmholtz combined field potential) on a
% wiggly torus
%
% - OCC: The occupancy parameter, specifying the maximum number of
% points a node in the... |
cc4c92665e7433764a93671e3c3c7b25cee64cdceced9275484285c3fa57db96 | MATLAB | 6,433 | 189 | function mappedX = cfa(X, no_dims, no_analyzers, no_iterations)
%CFA Performs coordinated factor analysis on dataset X
%
% mappedX = cfa(X, no_dims, no_analyzers, no_iterations)
%
% Performs coordinated factor analysis on dataset X to reduce its dimensionality to
% no_dims dimensions. The variable no_analyzers deter... |
ef15b660bb607e9c8285cebb1bba18a86eaf55f40ab6f7572a7c9a7eb48583a7 | MATLAB | 6,433 | 177 | % Covariance matrix on the unit line, squared exponential kernel.
%
% This example considers the covariance matrix between equispaced points on the
% unit line with squared exponential covariance function. The matrix is square,
% real, positive definite, and Toeplitz.
%
% We remark on a few key departures from the PDE ... |
8ea308aec1af8a6b29abd2efdc4b1f0d461acd21dfba480bca56078dd31da2ee | MATLAB | 6,434 | 161 | function H = y_Call_spm_orthviews(BrainVolume,NMin,PMin,ClusterSize,ConnectivityCriterion,UnderlayFileName,ColorMap,NMax,PMax,H,Transparency,Position,BrainHeader)
% function H = y_Call_spm_orthviews(BrainVolume,NMin,PMin,ClusterSize,ConnectivityCriterion,UnderlayFileName,ColorMap,NMax,PMax,BrainHeader)
% Function to ca... |
8d2f083e4e912d80a7849f3e727ca2bf39a229f977f46fcb7cb438bc6b056d10 | MATLAB | 6,437 | 145 | function CBIG_KRR_generate_kernels_LITE(feature_mat, outdir, ker_param, similarity_mat)
% CBIG_KRR_generate_kernels_LITE( feature_mat, sub_fold, outdir, ker_param, similarity_mat )
%
% This function calculates the inner-loop and training-test kernels for
% kernel ridge regression.
%
% This is a lite version of CBIG... |
5819406453950361b6ae1a43a37c7d81952ec20826d31530b80cd2126d0c2ee0 | MATLAB | 6,445 | 196 |
function preprocess_session(basepath,varargin)
% Function for processing electrophysiology data in the SNLab adapted from
% preprocessSession.m ayalab/neurocode repo
%
% Dependencies
% - external packages: neurocode,KS2Wrapper
% - schafferlab/github/Kilosort
% - schafferlab/github/CellExplorer
% - schafferlab/... |
1f7fdcd9382a712c23dbdb20991a2f11b8ba9609c59337f67432e500d98cdc3d | MATLAB | 6,446 | 185 | function mesh = move_source(mesh,mus_eff)
% MOVE_SOURCE Moves MESH sources inside the MESH by 1 scattering distance.
%
% [MESH] = MOVE_SOURCE(MESH, MUS_EFF) Moves MESH sources
% (MESH.source.coord) inside the MESH by 1 scattering distance
% (1/MUS_EFF).
%
% See also MYTSEARCHN, MYTSEARCHN_FAST, LOAD_MESH, MO... |
d8d139f906bc960f615529f5ed4da1eb3a3e4f9c570e6df957d00592cb96bcd8 | MATLAB | 6,446 | 181 | % More efficient alternative to Density.FindClusters that ignores DBSCAN
% and does not incur the cost of transmitting large vector event cluster ids
% AUTHORSHIP
% Primary Developer: Stephen Meehan <swmeehan@stanford.edu>
% Math Lead & Secondary Developer: Connor Meehan <connor.gw.meehan@gmail.com>
% Bi... |
557b91a7eac7b2bb6544b79f41166dabaed784842e11d025aee9576c9c4cf19a | MATLAB | 6,447 | 235 | %mmf writer
function [nkeyframes,nframes]=mmfwriter(inputfile,outputfile,firstframe,lastframe)
KEYFRAMEINTERVAL = 180;
obj=VideoReader(inputfile);
foutput=fopen(outputfile,'wb');
%load text
thisPath = mfilename('fullpath');
[parentDir] = fileparts(thisPath);
textfilename = fullfile(parentDir,'text.text');
ftexto=fope... |
a497693412361ca133edad11e6dfbf25c90ab1d3f731136833e4115ccd17dee9 | MATLAB | 6,448 | 139 | function CBIG_MSHBM_generate_profiles(seed_mesh,targ_mesh,out_dir,sub,sess,split_flag)
% CBIG_MSHBM_generate_profiles(seed_mesh,targ_mesh,out_dir,sub,sess,split_flag)
% This function will generate functional connectivity profiles for a
% specific subject in a specific session. A split flag can be passed in if
% the u... |
ae61c57e5e73626c3f12505d02b5dff1b4356f7e8ed9b3ff21d5d8e002441f2a | MATLAB | 6,448 | 61 | function domex_nirfast_meshing()
% Routine to compile the meshing mex files in a batch.
% Should only be run on a machine that has mex set up properly.
% It should be called whenever meshing mex C/C++ files are updated.
% A normal user is unlikely to run this script!
% Written by Hamid Ghadyani June, 2010
mypwd = pwd;... |
563f3a4633b8a768dd6abea9b2f325608364cbd3e601ecfdaf149fb826c6ec9b | MATLAB | 6,449 | 202 | function handles = barweb1(barvalues, errors, width, groupnames, bw_title, bw_xlabel, bw_ylabel, bw_colormap, gridstatus, bw_legend, error_sides, legend_type)
%
% Usage: handles = barweb(barvalues, errors, width, groupnames, bw_title, bw_xlabel, bw_ylabel, bw_colormap, gridstatus, bw_legend, error_sides, legend_typ... |
3471b4ad0694e7b59b55aca6ffbc6cc91086f9169734a22cec0802a0a34637a1 | MATLAB | 6,450 | 137 | % icadefs() - function to read in a set of EEGLAB system-wide (i.e. lab-wide)
% or working directory-wide constants and preferences. Change the
% way these are defined in the master icadefs.m file (usually
% in dir eeglab/functions/sigprocfunc) or make a custom copy of
% ... |
33a8bc68890a72756922a53b66243ecb128ec252a42e73ce8038799e9dcebeb8 | MATLAB | 6,451 | 146 | %% Set up list of models to evaluate
for j = 1:1
%% Figure set 1: potential on skin surface
% Make figure for no-adapt case
solnNoAdapt = load(fullfile(patient_path,'dipoles', dipole_name, ...
strcat(patno,'_',model_name,'_',dipole_name, ...
'_output_charge_solution')));
potNoAdapt = load(fullf... |
681c8723472022b58066dacf36c283067c42cb221a7dc04a1e13cc0237eec95b | MATLAB | 6,451 | 199 | % First-kind integral equation on the unit square, Laplace single-layer.
%
% This example solves the Poisson equation on the unit square by using a single-
% layer volume potential, which yields a first-kind volume integral equation.
% The problem is discretized on a uniform grid, with simple point-to-point
% quadratur... |
b3a6b97d3ffba6ac88990ca99227ca8d218df43d94c4868a9de25e2297e9723b | MATLAB | 6,453 | 191 |
%%
% Plot significance of the population through time with the specified
% threshold value (0.05 by default.) multiple plots allowed.
args=opts.PlotFCN{plotFCNidx,3};
[args,PValField]=ProcVarargin(args,'PVal',[]);
[args,SigThresh]=ProcVarargin(args,'SigThresh',0.05);
%%
[args,ylimVals]=ProcVarargin(arg... |
fe4e292e80daf53fd361979a711666c3ea6202adbadd564b044b69c0828a2330 | MATLAB | 6,455 | 169 | function [embedding, method, head, tail, graph_data] = ...
simplicial_set_embedding(data, graph, n_components, initial_alpha, ...
a, b, gamma, varargin)
%SIMPLICIAL_SET_EMBEDDING Perform a fuzzy simplicial set embedding, using a
% specified initialisation method and then minimizing the fuzzy set cross
% entropy... |
5c3f9b6e8b37d1496b073ca24170e0d0e208e9eea46242a07dd010f93bb9ba43 | MATLAB | 6,456 | 150 | function [averageRscr,averageRandomRscr,totalNumFramesRemaining,totalNumFrames, ...
subjHarmMeanFrames,subjMeanSamplingVar,subjNumRuns,subjRunsVar,subjMeanRunsNoSamplingVar,subjHarmMeanFramesMinus3] = ...
new_getSubjectScrubbedROIpairCorrelations(subjExtractedTimeSeries,useGSR,lpfFDcutoff,lpfDVcutoff,nu... |
593d028cff22a6ce13b3fc09fa65d28719027d87069da0a5b048db4606ed768a | MATLAB | 6,457 | 190 | %% createXtStateMap
%Given a trialwise time series data structure, and a state-mapping method,
%output a signalLevel mapping for discretization; append to cell
%
% Used as a modular capacity to map state. xtData can then be converted
%using the statemapping with the MATLAB 'discretize' function
%
% PARAMETERS:
% xtD... |
cdf457d2400efeee73f70ab9f30a0bc488637c0eb517998cbacd32973b782274 | MATLAB | 6,462 | 219 | function Dvec = movingslope(vec,supportlength,modelorder,dt)
% movingslope: estimate local slope for a sequence of points, using a sliding window
% usage: Dvec = movingslope(vec)
% usage: Dvec = movingslope(vec,supportlength)
% usage: Dvec = movingslope(vec,supportlength,modelorder)
% usage: Dvec = movingslope(vec,supp... |
1fddf04a59b6c646102c391164041799d14a7c9b08c4ab8364ea07ed77568124 | MATLAB | 6,463 | 218 | addpath C:\code\spm12\
addpath C:\code\wjn_toolbox
%%
clear all
close all, clc
dt = readtable('decodingtimes.csv');
color_OFF = [55 110 180]./255;
color_ON = [113 188 173]./255;
color_DOT = [255 244 0]./255;
ioff = ci('OFF',dt.Medication);
ion = ci('ON',dt.Medication);
subs_off = dt.Subject(ioff);
subs_on = dt.Subject... |
1d8962492ed868f2227d2682d31f074e67687ad37ee44c968d4b9d0a11a1d311 | MATLAB | 6,466 | 148 | %% Apply the estimated parametric maps to perform linear site/scanner effect removal
%% Average parametric maps to represent the site effects
% this section is assumed all individual parametric maps were stored in the
% same folder and labeled with site indicators. Modify the code to fit to
% your directory.
% ... |
9da29f31bec8bcf83db919095b2c0b10ee10077db24c4e8b40f269ce04a8d6b8 | MATLAB | 6,466 | 224 | function [hdr, nameFlag] = read_buffer_offline_header(headerfile)
% function [hdr, nameFlag] = read_buffer_offline_header(headerfile)
%
% This function reads a FCDC buffer header from a binary file or text file
%
% On return, nameFlag has one of the following values:
% 0 = No labels were generated (fMRI etc.)
% 1 ... |
c4e00dd0b9c4777a9683641978d4d5a717016014bfa226647b1e684535d18b35 | MATLAB | 6,466 | 199 | % DELCODE-SAME, Figure "ApoE genotypes"
% _
% original paper: Soch*, Richter* et al., HBM, 2022
% Figure S3: Analysis of FADE scores as a function of ApoE genotype
%
% DELCODE paper: Soch et al., medRxiv, 2023
% Figure S4: Comparison of ApoE genotypes to population distribution
%
% written by Joram Soch <Joram.Soch... |
046656004e8ac1829a16f910791395a699ef3d31d6501102f6ad12008cab2812 | MATLAB | 6,467 | 155 | function [pbt_regions, dbt_regions] = GetHandSegments(plot_segments)
if nargin == 0
plot_segments = false;
end
orig_size = [1200, 1050];
% Palm segments
[a,b,~] = fileparts(mfilename('fullpath'));
palm_boundary_template = imread(fullfile(a, '..', 'ReferenceImages','BoundaryMapPalm.png'))... |
4debe65e6cfe5a5dad32cda919f4f2355f31f961092afe47d8c3df83b12e06e3 | MATLAB | 6,469 | 178 | % This is a demo for a source-analysis toolbox;
% you need names your EEG-electrodes and some functional
% result like a potential at a time point, a CSP-pattern,
% a cross-spectrum, etc.
%
% you can
% 1. view field and cross-spectra;
% 2. make a forward calculation
% 3. make inverse calculations (dipole fits,MUSIC,... |
83f8d0450c03eec31f16753457be35d30ac549f551645e83ca92d315127c173b | MATLAB | 6,471 | 204 | classdef ParameterVisualizationAutoParams < ParameterVisualization
properties
% If true, a prop for this pvObj is currently selected, and we are
% successfully initted/displaying something.
initSuccessful = false;
autoParamsData = struct;
hHist = [];
hParams = gobjects(1,0);
hParamsTe... |
bbe23e5a753b635cc3fa8b659fd1bdc08f195a88bbc0e41876a559e4b1fa688b | MATLAB | 6,471 | 171 | function varargout = w_TimeCourse(varargin)
% W_TIMECOURSE MATLAB code for w_TimeCourse.fig
% W_TIMECOURSE, by itself, creates a new W_TIMECOURSE or raises the existing
% singleton*.
%
% H = W_TIMECOURSE returns the handle to a new W_TIMECOURSE or the handle to
% the existing singleton*.
%
% W_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.