sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
04763b737890de8181ea41f6e0c242450ab94490b5289427341c810f29d5c44f | MATLAB | 1,790 | 75 | % op_addScans.m
% Jamie Near, McGill University 2014.
%
% USAGE:
% out=op_addScans(in1,in2,subtract);
%
% DESCRIPTION:
% Add or subtract two scans together.
%
% INPUTS:
% in1 = First spectrum to add (in matlab structure format)
% in2 = Second spectrum to add (also in matlab structure format).
% subtrac... |
6d6f3662ec045a8520ada18c629e7786781e5a020c98b3e573f8a8e522d24757 | MATLAB | 1,790 | 59 | %% [r2s,t2s,m0] = Wrapper_R2s_Trapezoidal(magn,mask,matrixSize,voxelSize,algorParam,headerAndExtraData)
%
% Input
% --------------
% localField : local field map (tissue fields), in Hz
% mask : signal mask
% matrixSize : size of the input image
% voxelSize : spatial resolution of each dimension of th... |
ccfa62b48e4e2a5c39babd8e4b764fd2d4e8b26559a9197f1924512dfa915a3f | MATLAB | 1,790 | 59 | function avg_resp = averageResponse(dataPath, tensorInfo, timeBin, zarg)
%INPUTS:
% dataPath: path to ephys SU structs
% tensor info: table containing the filename, cellID, and TCA cluster for
% each cell
% timeBin: bin of time over which to compute average responses
% zarg: option to z-score or use raw ... |
ec851475896381a34ef647c3d99f82df03a0e75623967ce38fd6f0cd349758a9 | MATLAB | 1,790 | 47 | function dataType = tapas_uniqc_get_data_type_from_n_voxels(nVoxels)
% Specifies memory-efficient data type for saving from number of voxels
% TODO: incorporate dynamic range of data to be saved as well! add option
% for user to specify data type and bit depth?
%
% dataType = tapas_uniqc_get_data_type_from_n_voxels(nVo... |
3335cd5eebf0dc69f70232b3b7c8016f9ce1ce33826560191b8629d3d5c7f19b | MATLAB | 1,792 | 47 | function [slope intercept] = findFlipCorrectionSlopeGroup(myelin, transmit, template)
lowguess = -1;
highguess = 5;
searchratio = 1 - 2 / (sqrt(5) + 1); % 1 - inverse of golden ratio
currange = highguess - lowguess;
points = [lowguess, lowguess + searchratio * currange, highguess - searchratio * cur... |
397bef55df8527846d5a713869c648b003f5eb05e0284cf893baeb2fe090d7f1 | MATLAB | 1,792 | 69 | function fear_icaCCGnrem(basename,varargin)
load([basename '.basicMetaData.mat']);
fprintf('start %s\n%s loading data for %s \n', mfilename, datestr(now), basicMetaData.SessionName)
%%
param.filename=[basename '-reacCCG.png'];
%%
param=parseParameters(param,varargin);
load([basename '-icaReacCCG_nrem.mat'])
%%
pair... |
aefe1652406b9d66ebcd518a488f9791f5a12b69527473a77ae352b6596a98bd | MATLAB | 1,792 | 58 | % Replace XXXX by XXXXX for better documentation in MATLAB
% allFiles = dir('*.m')
% for iFile = 1:length(allFiles)
% replace_in_all_files(allFiles(iFile).name);
% disp(allFiles(iFile).name);
% end
function replace_in_all_files(fileName)
fid = fopen(fileName, 'r');
if fid == -1
error('File not found');
end
... |
d15657e742b96b23b06b2d89cb453863344270e9a63af96197faca6346c71c65 | MATLAB | 1,792 | 35 | %{
# basic information about resonant microscope scans, raster correction
-> preprocess.Prepare
---
nframes_requested : int # number of volumes (from header)
nframes : int # frames recorded
px_width : smallint ... |
664a4bc24424a99ea091336d555f5479c04ecce0997110af0d7ca2f147d0d924 | MATLAB | 1,793 | 50 | function [N,binEdges] = BF_SimpleBinner(xData,numBins)
% BF_SimpleBinner Generate a histogram from equally spaced bins.
% An alternative to the more opaque method of Matlab's internal histcounts function.
%
%---INPUTS:
% xData, a data vector.
% numBins, the number of bins.
%---OUTPUTS:
% N, the counts
% binEdges, the e... |
0190deab8db53776b9285474e2b471d1353482e07749ed1fac7463624e785e9d | MATLAB | 1,794 | 51 | function [results] = analysis01B(config)
% Runs analysis 01B: Train and evaluate the best neuromorphic inidividual
% that was optimised for performance (minLoss) on a number of train-test
% input sets, while varying the training time length.
% Parameters
% ----------
% config (struct) with fields:
% reservoirProperti... |
3d1ab037559d0534abd3d9bf02f055e13830b7ba23586026d57e94404583b41f | MATLAB | 1,794 | 52 | function grad = itab2grad(header_info)
% ITAB2GRAD converts the original Chieti ITAB header structure into
% a gradiometer definition that is compatible with FieldTrip forward
% and inverse computations
%
% See also CTF2GRAD, BTI2GRAD, FIF2GRAD, MNE2GRAD, YOKOGAWA2GRAD,
% FT_READ_SENS, FT_READ_HEADER
% Copyright (C) ... |
41961772bb08b685589a8a29387828f2be3860828223e2215240b2db72c573d2 | MATLAB | 1,794 | 52 | % Define global variables NET and DATA for testing (needed to provide some
% 'dummy' data to plot
global NET DATA
% Populate required fields of NET and DATA with some 'dummy' data (only
% fields used by ARTwarp_Plot_Net.m)
% reference contours [1,2,3,4,5]' and [1,0,0,0,0]'
weight = [1,1;2,0;3,0;4,0;5,0];
% number of ... |
515900288b30c03d6a049d660c5000d23a3bd2e42644ffad8750c00e92f2ad81 | MATLAB | 1,794 | 48 | function osp_onProc( ~, ~ ,gui)
%% osp_onProc
% Callback function on process button click.
%
%
% USAGE:
% osp_onProc( ~, ~ ,gui);
%
% INPUT: gui = gui class containing all handles and the MRSCont
%
% OUTPUT: Changes in gui parameters and MRSCont are written into the
% gui clas... |
727fe5d27a23f0f4a4dcf27701655f92035aaa1705257514c378dd9cfbc0f52e | MATLAB | 1,794 | 43 | function [chosenprob, chosenval, hits, notchosenprob, notchosenval] = parse_choices(S)
%PARSE_CHOICES determines if trial was rewarded, and probability and volume of reward
%
%inputs: S data structure with num flashes, num beeps, hits, etc.
%
%outputs: chosenprob: probability of reward in chosen port
% ... |
c12a990332dcef6d1605f819b4809957549a48a5306948328bafad746879fb64 | MATLAB | 1,794 | 59 | %% [r2s,t2s,m0] = Wrapper_R2s_Trapezoidal(magn,mask,matrixSize,voxelSize,algorParam,headerAndExtraData)
%
% Input
% --------------
% localField : local field map (tissue fields), in Hz
% mask : signal mask
% matrixSize : size of the input image
% voxelSize : spatial resolution of each dimension of th... |
f58c4b3ff30e73c3aeaaac8ab688b4e09aa659c1f9205a17373601a6a847d5b6 | MATLAB | 1,795 | 48 | function hr = tapas_physio_hr(cpulse, t)
% computes average heart rate at predefined times from time series of cardiac pulse events
%
% hr = tapas_physio_hr(cpulse, t)
%
% a sliding window of 6 seconds around the time points is used to
% determine heart rate variability, as suggested in
%
% Chang, Catie, John P. Cu... |
2136eb112c5cb36f46c8e8e3ff9a3b7a4d8055632d8cda12faa0aed8792899ee | MATLAB | 1,796 | 51 | function osp_FitTabChangeFcn(src,~,gui)
%% osp_FitTabChangeFcn
% This function is triggered when the fit tab is changed. It refreshes
% the figure.
%
%
% USAGE:
% osp_FitTabChangeFcn(src,~,gui);
%
% INPUT: src = handle of the fit tabs
% gui = gui class containing all handles and the M... |
e981c2799fd6e91ce55856fa67ea86bb4826ce87a04635ad9255c9256f78b83f | MATLAB | 1,796 | 55 | %% Parameters
nFrames = 500;
imgHeight = 512;
imgWidth = 796;
stack = zeros(imgHeight, imgWidth, nFrames, 'uint16'); % Preallocate image stack
%% Create Final Text Image
% Create a blank image for text insertion.
baseImg = zeros(imgHeight, imgWidth, 'uint8');
% Define the text string.
textStr = 'WELCOME TO CL... |
4efd86055cb3b911a6d583929abf9e9f19e8ae0df1601898b92ef5720f99f70a | MATLAB | 1,797 | 67 | function [s1] = scatJit(vec, jitFactor, col, circleSize,color)
% Takes a vector and plots it as a jittered scatter around value col
% Adam Claridge-Chang 20120411. Improved to modify jitter based on the
% histogram
% Adam Claridge-Chang 20120413 Further edited to use the bin
% information to spread out the data evenl... |
596e2388e53c1d553df7fffa6347f49068755a441792449bce6251837614f2c8 | MATLAB | 1,797 | 62 | function this = set_save_path(this, pathSave, update)
% sets save path recursively for all saveable objects within MrSeries
% can also update save path if MrSeries folder is renamed (subfolders are
% kept, only top folder name changed)
%
% Y = MrSeries()
% Y.set_save_path(inputs)
%
% This is a method of class MrSer... |
c799acdaa833757c145fd5786850f243243ec7b629ca6349a6ea14ac12e8d6f5 | MATLAB | 1,797 | 52 | % Define global variables NET and DATA for testing (needed to provide some
% 'dummy' data to plot
global NET DATA
% Populate required fields of NET and DATA with some 'dummy' data (only
% fields used by ARTwarp_Plot_Net2.m)
% reference contours [1,2,3,4,5]' and [1,0,0,0,0]'
weight = [1,1;2,0;3,0;4,0;5,0];
% number of... |
f618af7a0389249ed3d6a9df9d9b70d9015d2d48177e1d5b8907081d2ff2dd75 | MATLAB | 1,797 | 61 | %% h = sepia_handle_panel_bkgRemoval_VSHARPSTI(hParent,h,position)
%
% Input
% --------------
% hParent : parent handle of this panel
% h : global structure contains all handles
% position : position of this panel
%
% Output
% --------------
% h : global structure contains all new and... |
5ad01459ee0c204b811320419d39e83e196ebe03d62d675963f2b8c2adc9a251 | MATLAB | 1,798 | 43 | function [myelin] = REMYELINATION_WITH_OLIGO(local_threshold,myelin,funcs)
reshaped_myelin = reshape(myelin.state, myelin.oligo_dim^2, myelin.oligo_counter);
indicate_destroyed_myelin = reshaped_myelin == 0;
total_damage_to_oligo = sum(indicate_destroyed_myelin);
% matrix where cols hold damage specific to each oli... |
71cece226639dd6d7112b4ba0fdaaa731b0878c384c7ea5d49c2b78c7e1b8dd7 | MATLAB | 1,798 | 80 | function [f,hdl,pts] = fcn_boxpts(x,lab,cmap,samenum,w)
% clear all
% close all
% clc
% load boxdata.mat
% x = mu;
if ~exist('samenum','var') | isempty(samenum)
samenum = 0;
end
h = hist(lab,1:max(lab));
if ~exist('w','var') | isempty(samenum)
w = 1.5;
end
sz = size(x);
if sz(2) > 1
lab = repmat(1:sz(2)... |
e059241ea14f84658db9e56aeed5df4eb6d47baa0820ca5be6b78b564bd2235f | MATLAB | 1,798 | 52 | function [coef, t, n] = nancorr(A, B)
%NANCORR - Pearson correlation coefficient
%
% coef = NANCORR(A, B) is equivalent to
% coef = corr(A, B, 'rows','pairwise'),
% but NANCORR works much faster.
%
% [coef, t, n] = NANCORR(A, B)
% INPUT:
% A, B - input matrices, single or double, with equal... |
f40dbb7b5e451d0804308df72e4b81a0a89390dd44fa4552cedce3ea92db856e | MATLAB | 1,798 | 54 | %% SessionInfoExtractor
% Analyze multiple session Tank folders and print information.
%% Select Session Tanks
global CURRENT_DIR
if ~isempty(CURRENT_DIR)
targetdir = uigetdir(CURRENT_DIR);
else
targetdir = uigetdir();
end
if targetdir == 0
error('SessionInfoExtractor : User Cancelled');
end
%% Analyze
[P... |
5d78c80e6773f01cf708d766eea417edc3663d94e263e9502994efe15dd167f3 | MATLAB | 1,799 | 67 | function [s1] = scatJit(vec, jitFactor, col, circleSize, color)
% Takes a vector and plots it as a jittered scatter around value col
% Adam Claridge-Chang 20120411. Improved to modify jitter based on the
% histogram
% Adam Claridge-Chang 20120413 Further edited to use the bin
% information to spread out the data even... |
40516d44335bb53163a3528a975f4e847b78a75e6536a2e1bef9c152a3a48eaa | MATLAB | 1,800 | 59 | %% [r2s,t2s,m0] = Wrapper_R2s_Trapezoidal(magn,mask,matrixSize,voxelSize,algorParam,headerAndExtraData)
%
% Input
% --------------
% localField : local field map (tissue fields), in Hz
% mask : signal mask
% matrixSize : size of the input image
% voxelSize : spatial resolution of each dimension of th... |
677048a3cbd58689235473da4a4c53281ba6d5c420e3e90830fb9a6c24ee02ab | MATLAB | 1,800 | 49 | function mouseSingleSensor(src, evt)
% function mouseHandlerVideo(src, evt)
%
% Is triggered when the mouse is clicked in a Single Unit figure. Reads
% the subplot clicked. On clicking the video, it is played or paused. On
% clicking the Single unit plot, the current frame is moved to the clicked
% x-position
... |
d0a4d08342d7cf676b6c3ff9e93221be6c2c58919a7f6ebbc1371e2b1348c2cf | MATLAB | 1,800 | 47 | function reconPosePlot(output, M, trialIdx, frames, offsets)
% Plot the skeletons for original and reconstructed data
% Params
trialNumber = output.outcomes(trialIdx).trialNumber;
if output.outcomes(trialIdx).LR == 1
color = [0,0,1];
else
color = [1,0,0];
end
M.plotParams.linkLineWidth = 0.5;
M.plotParams.mark... |
7dbd9280a66304bc92bccd45b6542389936535a86cbbc5d0cb9356148907eb5a | MATLAB | 1,801 | 48 | function [varargout] = likExp(link, hyp, varargin)
% likExp Exponential likelihood function for strictly positive data y>0.
%
% Report number of hyperparameters
% s = likExp ()
% s = likExp (link)
%
% Prediction mode
% lp = likExp (link, hyp, y, mu)
% [lp, ymu, ys2] = likExp (link, hyp, y, mu, s2)
%
% ... |
3173e9339ce6294595e033088be4f95ffb4dc435f85f3e63089332e45b518519 | MATLAB | 1,802 | 61 | %
clear all
% query the user for the spreadsheet, and load the data
[datasetFilename, datasetPath, fileSelected] = uigetfile('*.xlsx', 'Select Data File to analyse','C:\Projects\MarieCurie\Shared Whistle types\Analysis');
if (~fileSelected); return; end;
cd (datasetPath);
[~,~,rawData]=xlsread(datasetFilename);
[numRo... |
972658258e93e0304f453f2a0e529af43158bffd25a58b136fd5a09bfc8b4a26 | MATLAB | 1,802 | 49 | % osp_extract_three_plane_image.m
% Helge Zoellner, Johns Hopkins University 2021.
%
% USAGE:
% [three_plane_image] = osp_extract_three_plane_image(ImageFile, MaskFile);
%
% DESCRIPTION:
% Creates a SPM volume containing a voxel mask with the same dimensions
% as the SPM volume containing a structural image. The voxel ... |
e506fcf029efe3a16851481c9264ff5c8139fe9223634383ef71af25aebe38ef | MATLAB | 1,802 | 74 |
function intervals = ToIntervals(x,in)
%ToIntervals - Convert logical vector to a list of intervals.
%
% USAGE
%
% intervals = ToIntervals(x,in)
%
% x values, e.g. timestamps
% in logical vector (1 = x value is inside, 0 = x value is outside)
%
% NOTE
%
% Values can also be omit... |
01b7af742b13e3ba34865b61188fca52c6447d357d69c2e725f72eb593ff7e2c | MATLAB | 1,803 | 59 | %% get_set_qsm_xQSM(h,mode,input)
%
% Input
% --------------
% h : structure contains all handles of SEPIA
% mode : 'set' - extract information from GUI to config file
% 'get' - extract information from config file to GUI
% input : if mode is 'set' then input should be fid
%... |
09fca9706e60541f8505e5d73ebe57e3be4759de587b7b6a4f982046046391be | MATLAB | 1,803 | 57 | function [A, B, C, D, tau, kappa, epsilon] = theta2abcd(theta, idx, R, L )
% Transform DCM parameters from vectorized to structured format
%
% This is a protected method of the tapas_Huge class. It cannot be called
% from outside the class.
%
% Author: Yu Yao (yao@biomed.ee.ethz.ch)
% Copyright (C) 2019 Translationa... |
52f175c49cc702ba125dd02eb3dcee594f436cb298874015c50ba11aaa80386b | MATLAB | 1,803 | 53 | function colorTint = tint(varargin)
%TINT Create tint of a color or colormap
%
% TINT(color,factor) takes rgb color (n-by-3, values between 0 and 1) or
% colormap and factor (scalar, between 0 and 1, 0 = original, 1 = white)
% and returns the tint (same size as color)
%
% TINT(color) takes rgb color (n... |
712a6165dd3809c16de4805590ab10b0a992c4533d64b42294ac4ba513ba9ff7 | MATLAB | 1,804 | 45 | % function checking if a specific file is a script or a function
% Copyright (C) 2006 Arnaud Delorme
%
% This file is part of EEGLAB, see http://www.eeglab.org
% for the documentation and details.
%
% Redistribution and use in source and binary forms, with or without
% modification, are permitted provided that the fol... |
b2719ecb66367b9326e253956973be6a005e9e40e976d3197300dd192e5ec4bf | MATLAB | 1,804 | 51 | function outargs = hlp_lookup_symbol(x,context)
% Internal. Look up a symbol from the current ult_block / workspace scope.
% Data = hlp_lookup_symbol(Symbol,Context)
%
% More precisely, perform a lookup for a symbol in the current (dynamic) scope formed by (possibly nested) utl_block(s)
% returns a cell array of all th... |
bea1ab6630e111ff74a47c9a1513c8ef2e3d07c14232265e299213ef43801800 | MATLAB | 1,804 | 50 | function [ output_args ] = findAssemblyPatterns( activityPatterns, pars)
%FINDASSEMBLYPATTERNS( activityPatterns )
%
% INPUT:
% activityPatterns [1x? cell]: cell array of binary activity patterns
%
% EXAMPLE:
% findAssemblyPatterns( num2cell( [ sort( randi( [0,1] , 20 , 40 ) , 2 , 'ascend' ) ; sort( randi( [0,1... |
d34de3c75ff194a5ce6d026fb8c19f42cc9544464e5a954d27d07ffcb4b4bc57 | MATLAB | 1,804 | 55 | %% [RDF] = Wrapper_BFR_SHARP(totalField,mask,matrixSize,voxelSize,algorParam, headerAndExtraData)
%
% Input
% --------------
% totalField : total field map (background + tissue fields), in Hz
% mask : signal mask
% matrixSize : size of the input image
% voxelSize : spatial resolution of each dimensio... |
97e04c60053e92c85df48c30ea5f07c2f2159f2fa651942397b9d473c7b0dfbf | MATLAB | 1,805 | 59 | function [params] = get_paramItem(paramGrid,ind)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% get_paramItem get the parameter(or combination of parameters) that is
% in ind'th in the parameter grid.
%
% Arguments:
% paramGrid = Parameter grid structure in which each properties are
% ... |
cdf19f71fedcad6d3414c0373eac41e1de094e8478f5af1019bf2ddeefa7161b | MATLAB | 1,805 | 63 | function eta = solve_along_line(M, point, x, y, g, Hy, sigma)
% Minimize the function h(eta) = f(x + eta*y) where
% f(s) = <s, H[s]> + <g, s> + sigma * ||s||^3.
%
% Inputs: A manifold M, a point on the manifold, vectors x, y, g, and H[y]
% on the tangent space T_(point)M, and a constant sigma.
%
% Outputs: ... |
3149302fe139417fa39fbe194480a31433cc67ce287a3401e30df9fa7fdb3867 | MATLAB | 1,806 | 64 | function rez = cleaning_clusters(rez,DATA)
<<<<<<< HEAD
M_clust = length(unique(rez.st(:,end)));
dims = [1 40];
del = [];
opts.Resize = 'on';
opts.WindowStyle= 'normal';
ops.Interpreter = 'none';
Ncycle = rez.ops.Ncycle;
ChC = rez.ops.ChC; % set to 10
SpkThr = rez.ops.SpkThr; % -150;
Ncc_Thr = rez.ops.Ncc_Th... |
6972f299536c03918351e7ededfa03f89573e1b9865158d69962685ccf16dee7 | MATLAB | 1,806 | 89 | function Dynamics = mfunc_GetDynamics(BasinNumber, Nmin)
% Get Dynamics
Num = length(BasinNumber);
% Frequency of staying each basin
Freq = zeros(1, Nmin);
for i=1:Nmin
tmp = (BasinNumber == i);
Freq(i) = sum(double(tmp)) / Num;
end
% Direct transition between basin
Dtrans = zeros(Nmin, Nmin);
for i=1:Nmin
... |
6c0318bb1ad5ee75120a46d4c3a214003f3f570dd759460d156e1ed02f288ae9 | MATLAB | 1,806 | 77 | function [M_z_a] = BMsolution_3(npools, concentrate, offset, T1, T2, K1, K2,M0, Exchangerate, Exchangerate_verse,w_x,w11,step_size, T2sArr, freqArr, lineshape)
[~, mm] = min(abs(T2sArr - T2(2)));
w1 = w11;
Matrix = cell(3);
% Matr = cell(3);
A1 = -diag(K2);
A1(1, 2:end) = Exchangerate(2:end);
A1(2:end, 1) = Exch... |
eeb278d647d9d0f66998230fc194105a15d5e280817b39004058d6e2896c6d1f | MATLAB | 1,806 | 54 | function [outputStruct, unusedArg] = get_struct(this, varargin)
% Returns the current affineTransformation as a struct or creates struct
% from input.
%
% Y = MrAffineTransformation()
% YasStruct = Y.get_struct()
% Y.get_struct('shear', [0.5 0.1 -0.3])
%
% This is a method of class MrAffineTransformation.
%
% IN
... |
fa8ccad0935f0057f6f6793cb519aad559e04aaadb724de45f106ca0ef4b29ea | MATLAB | 1,806 | 61 | function ft_flush_data(filename, varargin)
% FT_FLUSH_DATA removes all data from the data queue
%
% Use as
% ft_flush_data(filename, ...)
%
% See also FT_FLUSH_HEADER, FT_FLUSH_EVENT
% Copyright (C) 2007-2010 Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% for the documen... |
1562b4de6fc2a1d51aa09edec8ff549c4f01200ae3bbc94b147442ee57110a72 | MATLAB | 1,807 | 65 | %% h = sepia_handle_panel_qsm_CFS(hParent,h,position)
%
% Input
% --------------
% hParent : parent handle of this panel
% h : global structure contains all handles
% position : position of this panel
%
% Output
% --------------
% h : global structure contains all new and other handle... |
65acdd868ace2865a9253e6a93d30161c3266c3110ad38edba50413c5689782f | MATLAB | 1,807 | 64 | %islmatrix - Test if parameter is a logical matrix (>= 2 columns).
%
% USAGE
%
% test = islmatrix(x)
%
% x parameter to test
%
% EXAMPLES
%
% % Test if x is a logical matrix
% islmatrix(x)
%
% % Special test: test if x is a 3-line logical matrix
% islmatrix(x,'#3')
%
% % Special test... |
126953ed600e6d31fa0e89752926ceaae9c83ea0365bb95f77ed516bbe204e5c | MATLAB | 1,809 | 60 | function [nstate] = tapas_sampler_mdlinear_gibbs_node(data, model, ...
inference, state, node)
%% Samples from a linear multivariate model with diagonal, parameters
% specific covariance.
%
% Input
%
% Output
%
% aponteeduardo@gmail.com
% copyright (C) 2016
%
nstate = state;
% Number of subjects and number of c... |
161c7be929682f75a6949a80458ee956c7a63d0d24c05da5513af954412b2ccf | MATLAB | 1,809 | 48 | function [slrt] = getSLRT(S)
% Calculates side led reaction time (side led on ~ side poke)
% Hs 2022/11
%
%INPUTS:
% S = screened sessions from get_data saved in
% server/ProcessedRatData/S_Structs folder.
%OUTPUTS:
% slrt = cell for each session containing the side led reaction time for each trial.
slrt = ce... |
28acc2b4c559676c390c80ac194bbe1e5390dd9198e2485b3188ae7d685fad8c | MATLAB | 1,810 | 65 | function TrialVector = miniGenTrialVectors(vecPosition)
% Function outputs trial vectors (U, product of crossover).
global filename numFact numDose numComb sheetname mutCon crossCon
global XdoseRangeR
idx = false;
% Generate a matrix R that contains r1, r2, r3 for the mutation of the
% target vector (... |
709ad25bdd9e78921c5d2c8384edb78ebebbbdb40af1c2a978569b6eb1342793 | MATLAB | 1,810 | 58 | % fit_createMetabList.m
% Georg Oeltzschner, Johns Hopkins University 2019.
%
% USAGE:
% metabList = fit_createMetabList;
%
% DESCRIPTION:
% Creates a list of metabolite basis functions that are to be included in
% a fit.
%
% OUTPUTS:
% metabList = structure including flags (1 = included, 0 = excluded) for
% ... |
e65c46a205b8460c87c19d1db258733b51afd04cbd2f6dc7f9ab2c5bc2cc37d6 | MATLAB | 1,810 | 63 | function c = tapas_softmax_wld_config
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Contains the configuration for the softmax observation model for multinomial responses with phasic
% volatility exp(mu3) as the decision temperature and parameters accounting fo... |
ca226c4b4fc86efa0b219110849233509df00fa85b57389f218c19414d651d16 | MATLAB | 1,811 | 64 |
%{
MID WHOLE TASK
Higher in HC - .46
- 0.04 = VMN ROIs, 0.42 = no VMN ROI
Higher in MD - .54
- 0.30 = VMN ROIs, 0.24 = no VMN ROI
REWARD ANTICIPATION TRIALS
Higher in HC - 0.54
- 0.05 VMN ROIs, 0.49 no VMN ROI
Higher in MD - .46
- 0.25 VMN ROIs, 0.21 no VMN
CUE REACTIVITY WHOLE TASK
Higher in HC -... |
0de3ccb67c88e3cf34df3788868182af669014461722f8151a41b16f2cd6fb91 | MATLAB | 1,812 | 50 | function outputImage = std(this, applicationDimension)
% Computes std along specified dimension, uses Matlab std function
%
% Y = MrImage()
% Y.std(applicationDimension)
%
% This is a method of class MrImage.
%
% IN
% applicationDimension image dimension along which operation is
% per... |
ad54a07d8f792366cd6a24c30b40b0898f5547c6c495a49b96ed962312d360bf | MATLAB | 1,812 | 78 | function [Ez, D] = sero_srr_fit2signalError(m, TR, B, W, S)
% function Ez = sero_srr_fit2signalError(m, TR, B, W, S)
%
% m are the estimated high resolution parameters nz x 4, where nz is the
% number of high resolution positions along z
% TR is the TR matrix, n x nz, where n is the number of shots
% B is the b-value v... |
03fe884348c294af5fc7b3ab6bf7dd38bbbc570a64a3792be084efc7c178e7a7 | MATLAB | 1,813 | 61 | function y = vl_nnnormalizelp(x,dzdy,varargin)
%VL_NNNORMALIZELP CNN Lp normalization
% Y = VL_NNNORMALIZELP(X) normalizes in Lp norm each column of
% features in the array X, along its third dimension:
%
% Y(i,j,k) = X(i,j,k) / sum_q (X(i,j,q).^p + epsilon)^(1/p)
%
% [Y,N] = VL_NNNORMALIZELP(X) returns th... |
bdfa8507ce0133ef02b53baa313c4b9e58c7aa70fa071025cb25633df4157588 | MATLAB | 1,813 | 64 | function [logp, yhat, res] = tapas_softmax(r, infStates, ptrans)
% Calculates the log-probability of responses under the softmax model
%
% --------------------------------------------------------------------------------------------------
% Copyright (C) 2013-2019 Christoph Mathys, TNU, UZH & ETHZ
%
% This file is part ... |
5285a9a3b12f58275becc40b281f34aad62923454e6a561a1c7b0c182b93a96c | MATLAB | 1,814 | 43 | % WARNDLG2 - same as warndlg for EEGLAB
%
% Author: Arnaud Delorme, CNL / Salk Institute, 12 August 2002
%
% See also: INPUTDLG2, QUESTDLG2
% Copyright (C) Arnaud Delorme, CNL / Salk Institute, arno@salk.edu
%
% This file is part of EEGLAB, see http://www.eeglab.org
% for the documentation and details.
%
% Redistribut... |
7dd9dbac4e2748b6c17f83e8325bd65d34cfec93d1003f17b41ba5993c7ca524 | MATLAB | 1,814 | 55 | function otherImage = rot90(this, K)
% (Multiple of) 90 deg image rotation; mimicks rot90 in matlab functionality
%
% Y = MrDataNd()
% Y.rot90(K)
%
% This is a method of class MrDataNd.
%
% IN
% K multiple of 90 degrees used for counterclockwise rotation
% i.e. K = 0,1,2 (counterclockwise rotation)
%... |
c002ab948350b5db217de9557a702ed39d264a5f2a8eb805c8437d8dcbcf7003 | MATLAB | 1,814 | 75 | function [opts,b2s]=surfing_afni_opts_subvol(I,mn,mx)
% Options for loading minimal sub-volume with AFNI's BrikLoad
%
% [OPTS,ALL2FEW]=SURFING_AFNI_OPTS_SUBVOL(I,MN,MX)
% INPUTS:
% I AFNI Info struct (from BrikLoad), or 1x3 volume dimensions
% MN,MX List of minimum and maximum sub indices in x,y,z axes,
%... |
4651a7583ff285eaa9c4f4789236cd1d80297ec1d34c3df88cc37a9a2e3bc060 | MATLAB | 1,815 | 62 | function cmp = MS_complexity(x,n,binHow)
% Calculate the Lempel-Ziv complexity of the n-bit encoding of x.
%
% cmp is the normalised complexity, that is the number of distinct
% symbol sequences in x, divided by the expected number of distinct
% symbols for a noise sequence.
%
% Algorithm is implemented in complexitybs... |
9b7bf393aaa24fb840f8358e10ef4661c3c51504dcd8a93c05b7c897c697b892 | MATLAB | 1,816 | 42 | %% sepia_configuration_SWISMWI
%
% Description: a script contains all the SWI/SMWI method names and related function names
%
% Kwok-shing Chan @ DCCN
% k.chan@donders.ru.nl
% Date created: 2 August 2022
% Date modified:
%
% DO NOT change the variable name
% DO NOT change the order of the entities, add a new one at the... |
94e08324c562c12d2f74c4819ab231de0973ed7100fa2860c679f2c9a3ff606f | MATLAB | 1,817 | 45 | % Example 01 - thresholded t-map overlaid on an anatomical image
% Define directories
example_dir = fileparts(mfilename('fullpath'));
data_dir = fullfile(example_dir,'data');
sd_dir = fileparts(example_dir);
% Make sure directory containing slice display functions is on path
addpath(sd_dir);
% Get custom col... |
aff8cfa85025ab5b9ecbe1e6fe421c2e6dfaa77f83083cf10c1e5201a1c23e66 | MATLAB | 1,817 | 46 | function hSkeleton = drawSkeleton(hA, data, config, hSkeleton)
% data is arranged in a 3D array with the first dimension being the number
% of unique skeletons to plot, the second being the XY or XYZ values,
% and the third being the number of markers to create the skeleton out of
% Get the skeleton links we want to p... |
0eec7febc9215d30ee18ff91d794da75b045fdf9f5b0ae3715fc2beac481d3bd | MATLAB | 1,818 | 41 | % This script converts the tracked points from Universal Probe Finder into
% insertion trajectories which can be read in by the IBL alignment GUI.
% Set bregma
vecBregma = [540, 44, 570];
% Load in probe file
[strProbeFile, strProbePath] = uigetfile('.mat', 'Open probe_ccf file');
sLoad = load(fullfile(strProbePath, ... |
24be22a4b3aff383774cce7eba2ffa705fb989c72c3376f002d80ac46075c343 | MATLAB | 1,818 | 60 | function settings = DBSettings
%DBSettings - Get default settings for databases.
%
% This is an 'internal' function used by FMAToolbox. You should not need
% to use it, unless you are developping new functions for this toolbox.
% Copyright (C) 2023 by Michaël Zugaro
%
% This program is free software; you can redis... |
2c2b124f6a6e1a177ef7066341f9a5371a9d59bc44e998e54d1417fe906961c5 | MATLAB | 1,818 | 66 | %% h = sepia_handle_panel_qsm_CFS(hParent,h,position)
%
% Input
% --------------
% hParent : parent handle of this panel
% h : global structure contains all handles
% position : position of this panel
%
% Output
% --------------
% h : global structure contains all new and other handle... |
8db6fa664e459455e2882cdaa44b141e144bba0460278a9c816ec999c64f7040 | MATLAB | 1,819 | 73 | function [wtByPCatchRat, wtByPCatchMdl] = wtByPCatch(codedir,datadir)
%UNTITLED17 Summary of this function goes here
% Detailed explanation goes here
%% Set up paths
s = pathsep;
pathStr = [s, path, s];
onPath = contains(pathStr,...
codedir, 'IgnoreCase', ispc);
if ~onPath
addpath(genpath(codedir))
end
%%
... |
3b17e4c6aa934afa4a3770de0f64b60099e5b9cd9eba1c845e7ffb9f76ed4257 | MATLAB | 1,820 | 54 | function [movie,offsety_resolved,offsetx_resolved] = alginWithinTrial(movie,reference)
A = reference;
% save('reference_image.mat','A');
counter = 1;
for i = 1:1:(size(movie,3))
B = mean(movie(:,:,i),3); % circshift(movie(:,:,1),[-3 +15]);
result_conv =fftshift(real(ifft2(conj(fft2(A)).*fft2(B))));
[y,... |
916bcc2e6134a424d92117406832a68a2caf7fc4ad3d4b17e2b5b5b9da5b46cb | MATLAB | 1,820 | 94 | %Para hacer el clustering automatico. LC
%Genera una grafica con el DIindex para todos los edos de los diferentes
%algoritmos.
function [C_edos]=clusterLC(LLE_Z,edos_max)
Z=LLE_Z;
col=size(Z,2);
Zb(:,1)=Z(:,col-1);
Zb(:,2)=Z(:,col);
Z=Zb;
%edos_max=10; %El numero de elementos diferentes es el tope para el maximo
cle... |
9327a685be182766661791c9c1f4232278089955cfea0bdbf50030f657792133 | MATLAB | 1,820 | 63 | function [stim_new] = remove_covariate(stim,covname)
%removes a covariate from an existing stimulus struct
%inputs:
% stim: old stim structure for testing/training data
% covname: name of covariate/kernel to be removed
%
%
%
%outputs: stim_new. new, updated stim struct
stim_new = stim; %initialize
%important sizi... |
955ef9006ba40c3018c87ff7e08b778fceab374a8ea6d4e1c8d011e3c3c66943 | MATLAB | 1,820 | 59 | %% [r2s,t2s,m0] = Wrapper_R2s_Trapezoidal(magn,mask,matrixSize,voxelSize,algorParam,headerAndExtraData)
%
% Input
% --------------
% localField : local field map (tissue fields), in Hz
% mask : signal mask
% matrixSize : size of the input image
% voxelSize : spatial resolution of each dimension of th... |
ddb99d17b0eca2af266f39c34b09d723042d8c0545cb03cabc04ee9fd6c64937 | MATLAB | 1,820 | 71 | % op_ISIScombine.m
% Jamie Near, McGill University 2014.
%
% USAGE:
% out=op_ISIScombine(in,addInd);
%
% DESCRIPTION:
% Combine dimensions corresponding to ISIS on/off acquisitions to produce
% fully localized MRS volumes. Mostly used for MEGA-SPECIAL data to
% combine the ISIS subspectra but not the Edit-on/edit-of... |
2955b240999ce13d73ae6580c5e02ac9681c567d1a16c027441d5ee8edc96dc2 | MATLAB | 1,821 | 56 | function [ events, infos ] = nmri_read_event_mff( xmlfile, subject )
%UNTITLED4 Summary of this function goes here
% Detailed explanation goes here
if ~exist(xmlfile,'file')
error('XMLFile not found')
end
if ~exist('subject','var') || ~isfield(subject,'hdr') || ~isfield(subject,'raw_dataset') || ~exist(subject.raw... |
2f56fc9b0c1732e72056bbd7c6ff1a536acfa7d094cfe3bd0ad6f940c85f9f1f | MATLAB | 1,821 | 70 | function Qexp = getCommunicability(W,g,nQexp)
%
% call:
%
% Qexp = getCommunicability(W,g,nQexp)
%
% Compute the communicability matrix Qexp from
% the structural network defined by matrix W.
%
% INPUT
%
% W : n-by-n matrix (cab be weighted, unweighted, directed or undirected)
% g ... |
70d6d5ca02d80867f0f32c0a097e3fa1b8305049131e54b74e6f3e63feff3d1d | MATLAB | 1,821 | 43 | function[] = discorectangle(w, xycenter, r,facecolor, opacity)
%% Draws a discorectangle.
% Inputs:
% w = width of the discorectangle
% xycenter = 1x2 array containing x,y coordinates of the center of the
% discorectangle
% r = radius of the circle that defines the arch of the semicircular
% portion... |
7bf95ceaad1b1e5c1c2c1003c3d18f9d98ea066cdf076bedfb59a60ff63c83ba | MATLAB | 1,821 | 55 | function m = my_cell2mat(c)
% simplified version of matlab's cell2mat for use in codegen.
% before using it, you must compare the result of this function with that
% of matlab's cell2mat!
%
%CELL2MAT Convert the contents of a cell array into a single matrix.
% M = CELL2MAT(C) converts a multidimensional cell array w... |
551067286ac1ccb52af4c162b1c2b1cba8547d7fcce78294b6189fa85d54ed8f | MATLAB | 1,822 | 64 | function outputImage = rdivide(this, otherImage, doRemoveDivideByZero)
% Divides data of this image by otherImage and writes output in new image
%
% NOTE: If voxel dimensions of 2nd image do not match - or a scalar is
% given as 2nd argument - data in the 2nd argument is automatically
% replicated to match this image g... |
b91cbf7717156a7444d035e98a1f14cd26b308f7c8b2a0f36499695309cb0120 | MATLAB | 1,822 | 53 | function colorShade = shade(varargin)
%SHADE Create shade of a color or colormap
%
% SHADE(color,factor) takes rgb color (n-by-3, values between 0 and 1) or
% colormap and factor (scalar, between 0 and 1, 0 = black, 1 = original)
% and returns the shade (same size as color)
%
% SHADE(color) takes rgb c... |
356db99eb884a17e0c56915627ab43af2421a5c1219533aa9f77bcbb8c1da561 | MATLAB | 1,823 | 58 | % returns number of arguments (nargout) for method-call to dimInfo to avoid
% subsref-error
%
% Y = MrDimInfo()
% function n = numArgumentsFromSubscript(Y, struct, indexingContext)
%
% This is a method of class MrDimInfo.
%
% Details on issue and solution:
% https://stackoverflow.com/questions/36714192/how-to-ove... |
a7c326e73f6fe55fdc67ee69991a0d5c97031a190fb88c022c0e15629c28807d | MATLAB | 1,823 | 108 |
% You can nest Panels as much as you like.
%
% (a) Create a grid of panels.
% (b) Plot into three of the sub-panels.
% (c) Create another grid in the fourth.
% (d) Plot into each of these.
%% (a)
% create a panel in gcf.
%
% "p" is called the "root panel", which is the special panel
% whose parent is the figure wi... |
19205b985d8c5ea633024b3f856b9b6dad054ea65cf86fe2b1f449eeb077578e | MATLAB | 1,825 | 48 | function [Kappa_MF, Kappa_MB] = generateExampleKappas(A)
%UNTITLED15 Summary of this function goes here
% Detailed explanation goes here
rng(24) % Set random seed for reproducability
% Generate rewards
% Block structure goes mixed, low, mixed, high, mixed
r = [randsample(2:6, 40, true),...
randsample(2:4, 40, t... |
86a55fe9ffc6905003cb966ee5099fb1a309bbee621d0ba9f6092d5558bc53fb | MATLAB | 1,825 | 63 | function [model] = tapas_sem_multiv_model(data, ptheta, pars)
%% Set up the model.
%
% Input
% data -- Data
% ptheta -- Definition of the model
% pars -- Parameters structure.
% Output
% model -- Model structre.
%
%
% aponteeduardo@gmail.com
% copyright (C) 2016
... |
36dfb624eacb7d3bb5a095f35fe6e5f52e0b9aa04c3abff056e063d5a3e1364c | MATLAB | 1,826 | 46 | function M = factorygpuhelper(M)
% Returns a manifold struct to optimize over unit-norm vectors or matrices.
%
% function M = factorygpuhelper(M)
%
% Helper tool to add GPU support to factories. The input is a factory M
% created by one of Manopt's factories. The output is the same factory,
% with gather() and gpuArray... |
e5d666f292304a4de5502e5786959bedc1fa452ce6fc9da966e50dc7235766d4 | MATLAB | 1,826 | 62 | function fh = tapas_physio_plot_raw_physdata_siemens_hcp(t, c, r, acq_codes, ...
stringTitle)
% plots cardiac data as extracted from Human Connectome Phys log file
% (=preprocessed Siemens log file)
%
% fh = tapas_physio_plot_raw_physdata_siemens_hcp(t, c, r, acq_codes, ...
% stringTitle)
%
% IN
%
% OUT... |
2c96c9bcf9a4cd868f8c9545977a675609f328e8a7aff52820d00ac205727b30 | MATLAB | 1,827 | 73 | %% z-correct
close all
clear all
frames_tmp = sbxgrabframe('Z:\Scanbox\Data\NDNF\NDNF_06\070124_NDNF_06\070124_NDNF_06_000_000\070124_NDNF_06_000_000', 1, 1000);
frames_tmp = squeeze(frames_tmp);
load('Z:\BCI\Data\NDNF_Opto\NDNF_06\070124_NDNF_06\Baseline_noopto\baselineMask_1.mat')
% frames_rando = sbxgrabframe('Z:... |
9520848a4d3c5ae4f54976234441d414a5a1a329c281eddfb30258c785fcca3c | MATLAB | 1,827 | 50 | % FASTIF - fast if function.
%
% Usage:
% >> res = fastif(test, s1, s2);
%
% Input:
% test - logical test with result 0 or 1
% s1 - result if 1
% s2 - result if 0
%
% Output:
% res - s1 or s2 depending on the value of the test
%
% Author: Arnaud Delorme, CNL / Salk Institute, 2001
% Copyright (C)... |
b4a730004fc773d6c3d37c13807057e3f26d3b9f9a4fa61c48ae6e6d3209044b | MATLAB | 1,827 | 60 | function validate_parameters(params, options)
% VALIDATE_PARAMETERS - Check parameter consistency and requirements
%
% H1 Line: Validate simulation parameters and options
%
% Syntax:
% validate_parameters(params, options)
%
% Description:
% Checks that all required parameters are present and consistent.
% Throws ... |
ed72a26e44664769ffcc3f51586549dc10e53b572579c11ce40cb7b03f9ae767 | MATLAB | 1,827 | 62 | function [roi_points, intens] = clicky(movie_in, refimg);
% function [roi_points, intens] = clicky(movie_in, refimg);
% movie_in: input movie.
% refimg: optional image (black and white or color) on which to click to
% select ROIs.
% Click to define an ROI, right click to complete. Plots the intensity
% trace averaged ... |
b6bb7af885de9eb79b0349aa9fba5eece124fdc9f6588967eef95380ad62c9e3 | MATLAB | 1,828 | 61 | clear ;
%% set paths
% spm
warning('off');
addpath(genpath('/Users/shahzad/Documents/MATLAB/spm12'));
% cosmo
cosmo = '~/Documents/MATLAB/CoSMoMVPA';
addpath(genpath(cosmo));
cosmo_warning('once');
% libsvm
libsvm = '~/Documents/MATLAB/libsvm';
addpath(genpath(libsvm));
% verify it worked.
cosmo_check_external('libsv... |
323250896abb494c76a63ee403e833a88a2602a2827dd5d6c1a4044a3719406e | MATLAB | 1,829 | 62 | function [corr_stats]=corrstat(data1,data2,cov)
if(~isempty(cov))
N = length(data1);
whichstats={'rsquare','tstat','mse','r'};
% %linear
stats_linear1= regstats(data1,[data2 cov],'linear',whichstats);
beta1 = stats_linear1.tstat.beta;
data_fitted1 = beta1(1)+beta1(2)*data2+stats_linear1.r;
stats_linear2 =... |
f2fe737583a010577e36414361685e1b7fb43dd87c5fa6faf1ea4cece4d7c417 | MATLAB | 1,829 | 58 | function e = MS_nlpe(y,de,tau,theilerWin);
% MS_nlpe
%
% Compute the normalised "drop-one-out" constant interpolation nonlinear
% prediction error for embedding dimension de and lag tau or for embedding
% strategy v (v>0)
%
% [[BF: edited to output residuals rather than mean squared error]]
%
% Michael Small
% michael.... |
5776a81760e7d52c5c29149c592019da550a5fc05332e567fe889d16892164ca | MATLAB | 1,830 | 47 | % EEGLAB_WARNING - generate warning disabling backtrace
%
% Usage: >> eeglab_warning(msg);
%
% Inputs: msg, a string of character.
%
% Author: Arnaud Delorme, SCCN, INC, UCSD, 2024-
%
% see also: EEGLAB
% Copyright (C) 2024 Arnaud Delorme, UCSD
%
% This file is part of EEGLAB, see http://www.eeglab.org
% for the docu... |
a2a058cbb0c9f26ace78eec2f6e5f3dfac5f821c520c393d578364ba8f9c6a4f | MATLAB | 1,830 | 62 | %% h = sepia_handle_panel_bkgRemoval_iHARPERELLA(hParent,h,position)
%
% Input
% --------------
% hParent : parent handle of this panel
% h : global structure contains all handles
% position : position of this panel
%
% Output
% --------------
% h : global structure contains all new a... |
c8eed53b98067cc52fd9767317788ad644a46139e896cfe4d52096d8eec7e3f7 | MATLAB | 1,830 | 37 | % DISPLAY - display an EEG data class underlying structure
%
% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008
% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD
%
% This file is part of EEGLAB, see http://www.eeglab.org
% for the documentation and details.
%
% Redistribution and use in source and binary forms, w... |
fa9739114f97fca246390a63ff08c7e586cce78e3b44227ee62d0d6e5ace3383 | MATLAB | 1,831 | 76 | function [ms, amp, ratlist] = ...
get_avgFlatency(datadir, region, sensor, datatype, minmaxtype, tf)
% Get latency (ms) to first peak/trough after event onset
if nargin<5
tf = 0.5;
end
basedir = fullfile(datadir, 'data-published\PhotometryDataAligned');
[region, sensor] = standardizeInputs(region, sensor);
dat... |
a34351d1b215e0335497dc0680747ae1ed0ee0c907469d7ea446a246c333481d | MATLAB | 1,833 | 54 | function [D] = mahal_trialwise_twoclass(data,label,foldvar,timelist,sigmawin)
% [D] = mahal_trialwise_twoclass(data,label,foldvar,timelist,sigmawin)
%assign stimulus variable for decoding
sortvar = label;
labels = unique(label);
trl_ind = 1:size(sortvar,1);
nbin = 2;
D = zeros(size(data,1),nbin,size(d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.