sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
d504c5e281553fdd7a1b8e5a7ca3c27065c188e005aac1cec1dcb3862f50590c | MATLAB | 2,221 | 77 | function area = fitNeuronalVariances(area_title,area,plotallfits)
minReps = 3;
for n = 1:size(area.allresp,1)
% grab mean, variance, and repeats
these_means = area.experiments{n}.dat(:,2);
these_vars = area.experiments{n}.dat(:,3);
these_reps = area.experiments{n}.dat(:,4);
% only use disparitie... |
5088d300081ff89dceac89e3e70aaf6cbc212bcaf353cf17fc35ae9aaa46f747 | MATLAB | 2,222 | 80 | %sim_onepulse_delay.m
%Robin Simpson and Jamie Near, 2014.
%
% USAGE:
% out=sim_onepulse(n,sw,Bfield,linewidth,sys,delay)
%
% DESCRIPTION:
% This function simulates a pulse-acquire experiment with an ideal
% (instantaneous) excitation pulse and an assumed lorentzian lineshape. A
% delay is included before the ADC on... |
25349860d8f57c12deb67c7097cbe70941c6c4a9b519bba0217e138a22a33786 | MATLAB | 2,225 | 60 | function f = LK_PlotOverlayOfPlaceFields_20231012(dt)
%
% LK_PlotOverlayOfPlaceFields_20231012 plots the overlay of all place
% fields.
%
% Lukas Kunz, 2023
% arena radius for plotting the boundary
arenaR = 5000;
% create figure
f = figure('units', 'centimeters', 'position', [2, 2, 6, 6], 'Color', [1, 1, 1]);
% dis... |
5c437ef7c9d2131c11ae0826c25a634bc56607d0db9fcd41ae8ae4b408deae3b | MATLAB | 2,225 | 63 | function plotPCAExpVarianceAndTwoPCs(pcVectors, variances, pcaCoords, groupInds, figDir, nameSuffix)
hFig = createPrintFig(14 * [1 1]);
nSubPlots = 4;
hSubAx = createSquarishSubplotGrid(nSubPlots, [0.1 0.12]);
varColors = brewermap(2, 'OrRd');
axes(hSubAx(1));
bar(cumsum(variances), 'EdgeColor', 'none', 'Face... |
7447808da4029437bef5a722a6e1aaee98474865498f491882b08ed4ecb1f82d | MATLAB | 2,226 | 60 | function model = addPenaltiesToModel(model, B, TM, TG, UCyto, UMito, dontPenalize, TMT)
% addPenaltiesToModel
%
% Adds EAMCA maintenance costs to the model
%
% Input:
%
% model The model to modify
%
% B Base cost - maintenance cost per protein unit without transportation or utilizat... |
04cb072589e7dd971ffe89b68a0f82fd1be66292046b966a70be18b10c501eaa | MATLAB | 2,228 | 81 | function sff = sff_triangulate360(sff)
%SFF_TRIANGULATE360
%
% Raphael Sarfati, 05/2022
% triangulate
[worldPoints,err] = triangulate360(sff.trg.matchedAlpha1t,sff.trg.matchedAlpha2t,sff.clb.stereo360Params);
% rescale and translate
worldPoints = worldPoints*sff.prm.world.horzMtr + sff.prm.world.vertMtr;... |
e92a1f52f0b873f66c3b154f3813f02f55bdcbf60bc5f673807f64f1de879614 | MATLAB | 2,231 | 85 | % LEN_TREE Length values of tree segments.
% (trees package)
%
% len = len_tree (intree, options)
% --------------------------------
%
% Returns the length of all tree segments using the X, Y and Z coordinates
% and the adjacency matrix [in um].
%
% Input
% -----
% - intree ::integer: index of tree in trees or str... |
036586d29c50659366290507051425403d98ee658755a828f92c7d5a0500a2a7 | MATLAB | 2,232 | 57 | function out = LK_RippleDetection_ExtractData_20220319(mycfg, myeeg)
%
% LK_RippleDetection_ExtractData_20220319 extracts LFP data around ripples.
%
% Use as: out = LK_RippleDetection_ExtractData_20220319(mycfg, myeeg);
%
% Input #1 is a structure with multiple parameter settings.
%
% Input #2 is a fieldtrip-like struc... |
19081f29acc8bebd45588f192394481fc57e13749320e0fa4793be21a2b1eca1 | MATLAB | 2,232 | 76 | function countDown2_osx(w,startSecs,rect,fixSize)
% function countDown2_osx(w,startSecs,rect,fixSize)
%
% startSecs is the (integer) number of seconds for the entire countdown sequence
% startScan is the (real) number of seconds remaining in the countdown when scanner
% is to be started
%
% Purpose: Counts down from... |
a60efb25bfcf65daee3fd458adb4e0099e9176bc0d4bacfd249f7502670ddb18 | MATLAB | 2,232 | 54 | function stimC = returnStimConfigStructure(obj)
% Return a structure that can be written as a stim config file based on the current plotted data
%
% zapit.gui.stimConfig.controller.returnStimConfigStructure
%
% Purpose
% Extract data from plotted points and return these as a structure that can b... |
9ad9b3ddc1bfbbd3fe63e679a1b5b8a7b56ab755645ae5124fc7bcdcdaef7cd4 | MATLAB | 2,233 | 61 | function foundit = check4File(filename, format)
%
% foundit = check4File(filename, [format='.mat'])
%
% AUTHOR: Boynton
% PURPOSE:
% Check for a file with the specified extension in the current working
% directory, or relative to the current directory.
% This is a special case of exist.
%
% Modified 08.20.98 WP/BW
... |
b2c16a5f28b3ede8e023c96c6b9d455f6cc6b25df662fb47a3beefc7b7b83f95 | MATLAB | 2,234 | 64 | function varargout = finite(val, varargin)
%finite - Check that all elements are finite numbers
%
% finite(val) checks that all elements of val are finite numbers. If
% they are, nothing else happens; if they are not, the function throws an
% exception from the calling function.
%
% finite(val, 'VarName') incl... |
fcbefe64ffb554ed8c96d46e97bf39c81df34dcaa8a6ff514a4f539d4f545f06 | MATLAB | 2,235 | 72 | function plot_video(self, objPI, varargin)
% Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al.
%
% 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... |
79726cfb8fccede828042412fbdffaf528fcf458b1a1ab08feb09184474d69fb | MATLAB | 2,238 | 63 | function varargout = real_num(val, varargin)
%real_num - Check that all elements are real numbers
%
% real_num(val) checks that all elements of val are real numbers. If
% they are, nothing else happens; if they are not, the function throws an
% exception from the calling function.
%
% real_num(val, 'VarName') ... |
156bdc6d8c00507a69ab34d360070042387200355dc0c6bd907ab0effe5ee5ed | MATLAB | 2,241 | 70 | function varargout = lv(val, varargin)
%lv - Check that the value is a vector that can be converted to logical
%
% lv(val) checks that val is a vector that can be converted to logical.
% If it is, nothing else happens; if it is not, the function throws an
% exception from the calling function.
%
% lv(val, 'VarN... |
d6143107ccad9ab2c05db5e068c15cd19cfa9974cc5bf3ae779f66ba6bc4c17c | MATLAB | 2,241 | 65 | function varargout = equal(val1, val2, varargin)
%equal - Check that two variables are equal
%
% equal(val1, val2) checks that val1 and val2 are equal. If they are,
% nothing else happens; if they are not, the function throws an exception
% from the calling function.
%
% equal(val1, val2, 'VarName1', 'VarName2'... |
04bbea2743962f6778cc0137cdb2127925f38cfa76e3739a0eb66bea1ab691ac | MATLAB | 2,242 | 84 | function y = nanstd(x,flag,dim)
% FORMAT: Y = NANSTD(X,FLAG,DIM)
%
% Standard deviation ignoring NaNs
%
% This function enhances the functionality of NANSTD as distributed in
% the MATLAB Statistics Toolbox and is meant as a replacement (hence the
% identical name).
%
% NANSTD(X) calculates the standa... |
348e39b1c6716b51e4cc5c11dc71002219cab56668080745def60115bdc39f87 | MATLAB | 2,242 | 65 | function [Xc,Z]= airPLS(X,lambda,order,wep,p,itermax)
% Baseline correction using adaptive iteratively reweighted Penalized Least Squares;
% Input
% X:row matrix of spectra or chromatogram (size m*n, m is sample and n is variable)
% lambda: lambda is an adjustable parameter, it can be adjusted by u... |
a5c95cf7b6a08885f66aa4bd44b8a0c2a90d72016a9c7c06809ddd4712d0334f | MATLAB | 2,242 | 65 | function varargout = scalar(val, varargin)
%scalar - Check that the value is scalar
%
% scalar(val) checks that val is scalar. If it is, nothing else happens;
% if it is not, the function throws an exception from the calling
% function.
%
% scalar(val, 'VarName') includes VarName in the exception message.
%
% ... |
9f8456ee3cbb6c2f8c189ecf2e3eb1ee2072609146944960e8af48d1221165e1 | MATLAB | 2,245 | 68 | %decc_plotFig3
% Related to Viswanathan, Stein, Nieder, PLOS Biol, 2024
% PV 2024
load('DECCdataFig3.mat')
% Figure parameters
lcolor = [0.0 0.4 0.5; 0.6 0.3 0.0; 0.1 0 0.5; 0.2 0.2 0.2; 0.2 0.2 0.2; 0.2 0.2 0.2];
fstr = ['N1';'N2';'De';'SP';'Rl';'Ac'];
dur = 3700;
kern = 50;
ts = dur/kern; %no. of time steps
lpos = ... |
71e65507e391c9cbf98018187839e826468819a79edc7b2940cffcc2eeaf8be8 | MATLAB | 2,247 | 91 | function out = plotPointingError(data,im)
% Testing code for plotting nicely the beam pointing error
%
% Example
%
% Run at the CLI:
% [R,C] = hZP.generateScannerCalibrationPoints;
% [out,im] = hZP.measurePointingAccuracy([C,R]);
% plotPointingError(out,im) % Second optional
%
... |
9b03351c37c04a8097e08a2731baf63de10ce82fdfc54e9f3ad6456513e7e725 | MATLAB | 2,248 | 59 | %% power curve
clc;clear;close all;
%%
% This code plots power curve
% T-test, vary sample sizes
% effect size
Cohensd = 0.5;
% SD for normal distribution that governs the correlations of
% non-covariate-related edges
sigma0 = 1;
FWER_threshold = 0.05;
% Number of repetitions
M_rep = 100;
% Number of permu... |
d8c6fa9df7b9256943b0e1cd9bdc17f39706acbd366fa4deca2cbf70c56f4ac4 | MATLAB | 2,248 | 65 | function varargout = vector(val, varargin)
%vector - Check that the value is a vector
%
% vector(val) checks that val is a vector. If it is, nothing else
% happens; if it is not, the function throws an exception from the
% calling function.
%
% vector(val, 'VarName') includes VarName in the exception message.
... |
64fe12f067ea3ba57a10854ef92eb305a4da3d2e538ba56228fbfdc060ecfd29 | MATLAB | 2,256 | 64 | function varargout = single_row(val, varargin)
%single_row - Check that the value has a single row
%
% single_row(val) checks that val has a single row. If it does, nothing
% else happens; if it is not, the function throws an exception from the
% calling function.
%
% single_row(val, 'VarName') includes VarNam... |
8dee23a0b516d92e2dfa5284f04a68ccbd59b8301dcede339ddb6449faacef9d | MATLAB | 2,257 | 120 | function df = st_reconstruct(DT,center,computeST)
if isempty(DT)
return;
end
if notDefined('center')
center = 0;
end
if notDefined('computeST')
computeST = 0;
end
windowSize = 5;
df = tableArrayFormat(DT);
%%
df.sRF = cell(height(df),1);
df.tRF = cell(height(df),1);
sRF =cell(height(df),1);
tRF =cell... |
bcc6052445cfb4a6d1bce41067e5654e42b3eefb69cb167c09aff1c1a4930609 | MATLAB | 2,257 | 104 | function sff = sff_clean(sff)
%SFF_CLEAN
%
sff.gp1.cln = ffClean(sff.gp1,sff.prm);
sff.gp2.cln = ffClean(sff.gp2,sff.prm);
end
function ffo = ffClean(ffi,prm)
% clean detected flashes by removing clusters
%% pass and keep raw data
%ffo = ffi;
ffo.n = ffi.n;
ffo.xyt = ffi.xyt;
ffo.aeit = ff... |
dc05a32a66ce0bcfead1620c56f68649276b04e4d9e24f24dfd8fb48fafa90bc | MATLAB | 2,257 | 66 | function [ bwMaskStack, roiStruct ] = SelectROIs_Freehand( imagingStruct, fileNameSuffix )
% takes an input image I and returns a ROIstruct out. the ROIs
% are chosen by freehand user input using the roipoly function. this is for
% manual selection
figure;
figHandle = PlotImagingStruct( imagingStruct );
nRows = diff( ... |
d0cdfb8c442c565bd4020459b4837e7562d24675f44d824d79bd80eab4776afe | MATLAB | 2,263 | 61 | classdef (ConstructOnLoad) ED_ProcessNow < event.EventData
%ED_ProcessNow - Event Data for Config.ProcessNow event
%
% ED_ProcessNow public properties:
% objPI - The ProcessedImg object to be processed
% calcName - The Calc, within the ProcessedImg, to be processed
%
% ED_ProcessNow public methods:... |
7f395e65e8eca4726bf34df46ca38e2048685688622fb7e3c060311446a57f1f | MATLAB | 2,264 | 57 | %% power curve
clc;clear;close all;
%%
% This code plots power curve
% T-test, vary sample sizes
% Number subjects
n = 50;
% SD for normal distribution that governs the correlations of
% non-covariate-related edges
sigma0 = 1;
FWER_threshold = 0.05;
% Number of repetitions
M_rep = 100;
% Number of permutat... |
c10f57f8aad6f807cd09938ce484e34ca5eabd27a05a77bbbbc4a54cea3fac57 | MATLAB | 2,269 | 63 | function varargout = positive(val, varargin)
%positive - Check that all elements are positive numbers (greater than zero)
%
% positive(val) checks that all elements of val are greater than zero.
% If they are, nothing else happens; if they are not, the function throws
% an exception from the calling function.
%
%... |
0baf250efb2d2978e52e494ed6d5a47d6fd1bfa4ee2609df275df22eee4924ac | MATLAB | 2,270 | 71 | function varargout = single_row_char(val, varargin)
%single_row_char - Check that the value is a single row character array
%
% single_row_char(val) checks that val is a single row character array.
% If it is, nothing else happens; if it is not, the function throws an
% exception from the calling function.
%
% ... |
da557c56696f95b841ed50a964115b9e91fa92987577cdea8f34fe6ce2d3dca2 | MATLAB | 2,272 | 66 | function [P,spin,E,EE] = ising_exact_probability(N,H,J,K,beta)
% FUNZIONE ACCESSORIA: serve solo per calcolare le probabilità, per tutto
% il resto usare ising_exact
% ising_analytic Analytic solution for the 2-D Ising model in squared lattice
% with high-order interactions
% Input
% N ... |
a7acdc6f7bdabacea842bc994eb715b6c2e97e91e2f3b1bb3672affe397f18d2 | MATLAB | 2,274 | 106 |
clear
close all force
warning on
imSize = [733, 977];
load('a0_0_bhv2trialStrct.mat');
NIm{1} = [7
9
11
22
25
27
28
38
39
40
41
42
43
44
47
49
52
53
55
56
57
59
60
];
NIm{1} = [7
11
25
27
38
39
40
47
49
53
56
60
];
for iN = 1:numel(NIm)
NIm{iN} = [NIm{iN};NIm{i... |
f6d7d94e6dcb40ef05484c086856e2ddcc15d3d73fd79298f22e7343990a75ac | MATLAB | 2,275 | 73 | function [bestD, randD, bestN, bestang]=bruteDecode(rp,stimtype)
%this function does brute force identification of optimal decoding using a
%plane to separate responses to multiple trials of two different stimuli
% input: 'rp' is a (num trials)x(num neurons) matrix. Each matrix entry
% is one spike count respons... |
217ea6443a76570d64e4170372e65b7b9ff0c445d4ce5bdf55dace0626985af2 | MATLAB | 2,278 | 65 | function [trialmat trialmat2 avg_snr] = sim_trials_tf2(lf, hf, num_trials, Fs, num_sec, noise_ratio, amp_ratio)
% function [trialmat trialmat2 avg_snr] = sim_trials_tf2(lf, hf, num_trials, Fs, num_sec, noise_ratio, amp_ratio)
%
% This function creates 2 matrices of simulated trial data (trials stored as columns)
% whic... |
f0fa3a74ffe2038d9c807cafe9468e0e245c2fbdaf237ccb67d460b5eae68941 | MATLAB | 2,278 | 44 | function harmonizeGUIstate(obj,~,~)
% Ensure a new action requested by the user respects the current state of the GUI
%
% function zapit.pointer.harmonizeGUIstate
%
% Purpose
% Ensure that the GUI transitions smoothly regardless of what buttons the user clicks.
% For example, if a check galv... |
23e730cc8b58a13665a826c7d1e655009a9d72bc1bb09e5b09050326d7d0fd35 | MATLAB | 2,279 | 67 | function snr=savefor_Figure7(sub)
subnum=sub;
frequency=1:60;
condition=2;
blocknum = 12;
channum=64;
home_path=[pwd,'\temporary data\Downsdata\'];
filename=[home_path,'Downsdata_64_',num2str(subnum),'.mat'];
load(filename)
Downsdata;
bpdatah1=[];
for ii=1:blocknum
for cond=1:condition
for ... |
ff39674b4d98fb5666870a40b0ac6d94012d2e4078307c610af087b9fbf49b46 | MATLAB | 2,280 | 63 |
% clc;clear
parent = 'D:\Work\2019_Phd\NeuScan\Projects\Fear\fMRI\Pipeline\SVR\Onset\no_shock\new\within_subject\';
datapath = 'D:\Work\2019_Phd\NeuScan\Projects\Fear\fMRI\Pipeline\SVR\Onset\no_shock\new\within_subject\mat_n44\';
outputdir = 'D:\Work\2019_Phd\NeuScan\Projects\Fear\fMRI\Pipeline\SVR\Onset\no_shock... |
146db2c2a4c8628053653bba408146374faec3e575f9234f748851c206fb503f | MATLAB | 2,283 | 62 | classdef Test_downsample < matlab.unittest.TestCase
% Test_downsample Summary of this class goes here
% Detailed explanation goes here
% ================================================================== %
methods (Test)
function testNoChange(self)
%... |
361959fa8649be9dd6a3929e043e720af57098ade948c3b774ea0508459adb59 | MATLAB | 2,283 | 100 | function st_recon_stprf_ecc(DT,params,roiList,eccBand,plotDir)
saveName = sprintf('%s_recon.mat',eccBand);
if isfile(fullfile(fileparts(plotDir),'figures',saveName))
return;
end
if ~isfile(fullfile(fileparts(plotDir),'figures',saveName))
params.roiName2 = 'all';
df = tableRemove(DT,params);
df = defau... |
8119ab41f4d97745e270ae3a824186f540d11407e97681b6ef1dc2c1938a2792 | MATLAB | 2,283 | 66 | % ex function deciall2 (use for 12bit sampling (RC format))
% resampling program --- requires signal processing toolbox
% Hajime Hirase ... no warranty ..(sorry) (1999)
% function downsample(inname,outname,numchannel,resampl,offset)
% this function passes anti aliasing low pass filter first
% to the data and then sampl... |
8560f66f7c89b786eb520c880d0aa86ea2d8c461fe6d17acd7a390c4590be418 | MATLAB | 2,284 | 46 | function f = LK_PlotNeuronalActivityDuringRipples_20231005(dt)
%
% LK_PlotNeuronalActivityDuringRipples_20231005 plots neuronal firing rates
% during hippocampal ripples.
%
% Lukas Kunz, 2023
% create figure
f = figure('units', 'centimeters', 'position', [5, 5, 6, 6], 'Color', [1, 1, 1]);
% subpanel for ripple
ax1 = ... |
6df671bc537ae19836bd60fb3cb91f4a8f664339a83f47b625d4b41e2ba70445 | MATLAB | 2,285 | 93 | function plotChanSamples(obj, conditionToPlot)
% Plots the voltage waveforms that will be send to the DAQ
%
% zapit.stimConfig.plotChanSamples
%
% Purpose
% Makes diagnostic plots of of the scanner waveforms.
%
% Inputs
% none
%
% Outputs
% none
%
% Maja Skretowsk... |
9a5c872491137eb83e66b0f848b3739ff70837a547f2d6dde39504b49362fa12 | MATLAB | 2,285 | 82 | % this code will read all the gaze files from the trials and covernt them
% to the image coordinate.
clear
close all force
warning on
imSize = [733, 977];
pix2deg = 34.910;
hWB = waitbar(0,'checking the trials ...');
%load tirals info
load('a0_0_bhv2trialStrct.mat');
I = arrayfun(@(x) isfield(x.analyze,mfilename),... |
31990345c2b0c99a1f03d318ecda2422c78a2f2bbc23d0bd6bf5050ed9fd2e70 | MATLAB | 2,292 | 58 | function figureS2(dataFolder)
if(nargin<1)
error('Path to data required as input argument. Data can be downloaded from link in README file.');
end
load(fullfile(dataFolder,'simulations','synthetic_spikes','simulations_synapse_dipole_orientation.mat'));
dMag = squeeze(max(vecnorm(dipoles,2,2)... |
ac8c57e77331b171145268bcf9ab76d3f33233c5d31eb39c2bb83ba231de04b4 | MATLAB | 2,292 | 57 | function fluor = GetFluor3D(sbxInfo, sbxPath, varargin) % mouse, exptDate expt, run
% Get data from registered 3D calcium imaging experiments
IP = inputParser;
addRequired( IP, 'sbxInfo', @isstruct )
addParameter( IP, 'path', '', @ischar)
addParameter( IP, 'chan', 'green', @ischar)
addParameter( IP, 'save', tru... |
ccbb2af05bcf1c70c37cbb0491df48217dace0d2fd7fbed049344a7523f9c488 | MATLAB | 2,292 | 93 | % BO_TREE Branch order values in a tree.
% (trees package)
%
% BO = BO_tree (intree, options)
% ------------------------------
%
% Returns the branch order of all nodes referring to the first node as
% the root of the tree. This value starts at 0 and increases after every
% branch point.
%
% Input
% -----
% - intre... |
da1bf59945a0eda4d4b82eb1c24708a5c7e8788f60423852825ccf3a18985b94 | MATLAB | 2,292 | 56 | function [cope,varcope,tstat,F,Fdof] = ols(data,des,tc,Ftests)
% [COPE,VARCOPE,TSTAT,F,Fdof]=ols(DATA,DES,TC,Ftests)
% DATA IS T x V (time x # outcome variables)
% DES IS T x EV (design matrix)
% TC IS NCONTRASTS x EV (contrast matrix): Use eye() for unspecific contrasts
% Ftests IS CELL ARRAY, NFTESTS*1; each cell co... |
319c2c424fd0d838a9a789cb6ea450ebf91445963cf78b17c76743c81bdc1162 | MATLAB | 2,295 | 68 | function varargout = plot_signals(self, objPI, varargin)
%
% Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al.
%
% 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 v... |
e6d23e0448eac1d024ffdab7492e721b9a2a9f38b3f96c8d23a580bb9cce3e3d | MATLAB | 2,297 | 81 | % Batten, Bang, Kopell et al (2024) Dopamine and serotonin in human
% substantia nigra track social context and value signals during economic
% exchange
%
% Figure S1
%
% Visualization of in-vitro evaluation of signal prediction model
%
% Written in MATLAB 2023a
%
% Dan Bang danbang@cfin.au.dk & Seth R. Batte... |
86b31b9f7d40679cdd77895c7711d0d47c9f631a431b5a6ad776f4056a9e9090 | MATLAB | 2,307 | 43 | function f = LK_PlotCrossCorrelations_20231005(dt)
%
% LK_PlotCrossCorrelations_20231005 plots cross-correlations between
% hippocampal ripples and other ripples.
%
% Lukas Kunz, 2023
% figure showing cross-correlations
f = figure('units', 'centimeters', 'position', [5, 5, 6, 6], 'Color', [1, 1, 1]);
% HC ripples
axe... |
c8cfc85c38a86634f427d4abbb72708d29897e2686c1a3903bbca40423bccc35 | MATLAB | 2,307 | 65 | function list = getDisplaysList;
% Return a list of the display parameters saved in the VISTADISP
% repository.
%
% list = getDisplayList;
%
% BACKGROUND: The VISTADISP exptTools toolbox saves information about
% displays relevant to different stimulus computer/display combinations.
% These settings are especially impo... |
84a3820ab5226f9fbc4f449a34da423f7c7c1bbd211f6203aa73a73973fe4d4e | MATLAB | 2,309 | 71 | function varargout = scalar_logical_able(val, varargin)
%scalar_logical_able - Check that the value is convertible to scalar boolean
%
% scalar_logical_able(val) checks that val is convertible to a scalar
% logical. If it is, nothing else happens; if it is not, the function
% throws an exception from the calling ... |
33614699c779de6a43859c00f9b7b2664eb2769e315abed719846a2abc976fa6 | MATLAB | 2,310 | 74 | %% S2 Fig
% Jiaxin Gao
% Zhejiang University
% email: jiaxin_gao@zju.edu.cn
%% MEG bar plot (1 Hz)
clear
clc
load('.\FigS2_data.mat')
phy_coh1 = FigS2_Data.phy_coh1;
phy_coh2 = FigS2_Data.phy_coh2;
phy_coh_shuffle1 = FigS2_Data.phy_coh_shuffle1;
phy_coh_shuffle2 = FigS2_Data.phy_coh_shuffle2;
fs =... |
d045590eb7b8b525d2ff520971f9aac032af0abacd818974ddb746446beb27f9 | MATLAB | 2,313 | 67 | function [p] = permutation_test(x, y, nIter)
% [p] = permutation_test(x, y, nIter)
%
% Simply permutation version of a one-sided (x > y) paired-samples t-test.
%
% INPUTS:
% x, y = numeric vectors of equal length that will be used for
% permutation. Hypothesis x > y is tested.
% nIter =... |
322275b306b45640d0509d73c4b47c3d8d0824cf626cad65b7de2696c31e64eb | MATLAB | 2,319 | 61 | function [pixelShift, estSNR, xCorr] = loop_function(...
funCalcXCorr, windowsBig, nOverlap, windowLines, ...
nWindowsSmall, funCalcPixelShift, isParallel, ...
iWinBig, nWinTotal, fnPB, strMsg)
% Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al.
%
% This program is free software: you c... |
9ba1ca9b75b2050770d161dfe18f72814bee822ffd06db53b43d06d4970373a5 | MATLAB | 2,319 | 90 | % IDPAR_TREE Index to direct parent node in a tree.
% (trees package)
%
% idpar = idpar_tree (intree, options)
% ------------------------------------
%
% Returns the index to the direct parent node of each individual node in
% the tree.
%
% Input
% -----
% - intree ::integer: index of tree in trees or structu... |
2997c81a2890a510cefd4ff64be27e360194b2a925247229492277a6bd751770 | MATLAB | 2,321 | 55 | function configOut = get_config(self)
%get_config - Return the Configs from this object
%
% CONFIGS = get_config(OBJ) returns a list of the config objects
% associated with each child. CONFIGS is a cell array of size
% [1, nChildren]. If the ImgGroup object is non-scalar, CONFIGS will
% be a cell array of le... |
1432d9839d508609b9181df1c3f876c54065bc721a15d59c476bce99bd39c8f7 | MATLAB | 2,325 | 60 | %% power curve
clc;clear;close all;
%%
% This code plots power curve
% T-test, vary sample sizes
% Number subjects
n = 50;
% SD for normal distribution that governs the correlations of
% non-covariate-related edges
sigma0 = 1;
FWER_threshold = 0.05;
% Number of repetitions
M_rep = 100;
% Number of permutat... |
71547c6dcd0232eae512a2a92a7688b99554502ec7b64ab58df916d2cc0cef24 | MATLAB | 2,325 | 60 | %RunElectodesClassificationMatlabFunc
clear all
matlabImpute = true;
imputeIters=20;
%NumTreesVec = [10,20,40,80];
NumTreesVec = [80];
substractMouseMean = true;
%LeaveOut = 'Stimuli';
%LeaveOutVec = {'Stimuli','Session','mouse'};
LeaveOutVec = {'mouse'};
%ElectodesClassificationMatlabFunc(unifyContextClasses... |
3f2c86e9469ec956f84677ac622ad9bc500c9b7ebc135463f31160681a0767f5 | MATLAB | 2,328 | 63 | function chNames = get_ch_name(self, chNums)
%get_ch_name - Get channel names from channel numbers
%
% CHNAMES = get_ch_name(OBJ, CHNUMS) returns a cell array of
% channel names from the Metadata object corresponding to the supplied
% channel numbers.
%
% CHNUMS must be a numeric array containing only positive ... |
5514006830d23bddb46a16058b71e706045f6e8f994d878d7691b8a1c0dc20c6 | MATLAB | 2,329 | 1 | function [status, time0] = StartScan2(pulseLength);
% StartScan - Starts the MR scanner by sending a pulse
% [status, time0] = StartScan(pulseLength);
% when error ocurred status will be non-zero
% time0 is the time (GetSecs) when the onset of the pulse
% started, used for syncing s... |
a601cde4c5654ea67ff395b232cf2d99909a1816b218a065cba37d34515f3f12 | MATLAB | 2,329 | 88 | function [out] = EEGfMRIPav_cbm_mod02_osap(parameters, subj)
% Standard Q-learning model with delta learning rule and Go bias.
% ----------------------------------------------------------------------- %
%% Retrieve parameters:
% 1) Feedback sensitivity:
nd_rho = parameters(1); % normally-distributed rho
rho ... |
b43bd01edb13eab470853a1e6851dca3a14086eeaa9ff19091b11b86ead30c8f | MATLAB | 2,329 | 66 | function removeOverlays(obj,overlayToRemove)
% Remove overlaid line plot data from the camera image
%
% function removeOverlays(obj,overlayToRemove)
%
% Purpose
% The camera image could have overlaid line plot data, such as the current estimated laser
% position, the calibration locations fo... |
1008dc7c2ed67bc7813a5f6bcee2961ddf8575088b37cd30eac63e2daab758c8 | MATLAB | 2,331 | 62 | function result = extractSvdComponent(inputImage, TR, opts)
%EXTRACTSVDCOMPONENT Extract respiratory-dominant image component by SVD.
arguments
inputImage
TR (1,1) double {mustBePositive}
opts.interpolationFactor (1,1) double {mustBeInteger, mustBePositive} = 1
opts.nComponents (1,1) double {mustBeInte... |
f90b10aae67f176acf29857e4ee27b6a3fde8ec2441074ed8bcda7bdfc3b97ae | MATLAB | 2,332 | 131 |
clear
close all force
warning on
hWB = waitbar(0,'checking the trials ...');
hWB1 = waitbar(0,'checking the trials ...');
%load tirals info
load('a0_0_bhv2trialStrct.mat');
I = arrayfun(@(x) isfield(x.analyze,mfilename), dataTrl);
if any(I)
I(I) = arrayfun(@(x) x.analyze.(mfilename) , dataTrl(I));
end
NTrial =... |
9addee35342abfb7c999c16352941715a5062bf6645836dea590b2a306a27900 | MATLAB | 2,334 | 80 | clear;clc;
close all
subs=30;
condition=2;
frequency=60;
load([pwd,'\temporary data\Sub_score.mat']);
Sub_score;% 30*2*60*3
aver_sub=squeeze(mean(Sub_score,4));
load([pwd,'\temporary data\fbtrca.mat']);
fbtrca_ac; %30*2*60
score=[];
for sub=1:subs
for cond=1:condition
for freq=1:frequency... |
dd2e850912a070cf40fc4a8766fb7626c7ad1be57243499928e5bb76d9991d71 | MATLAB | 2,337 | 81 | clear
close all force
warning on
imSize = [733, 977];
imSizeCent = fix([733, 977]/2);
y1 = imSizeCent(1)+(-130:70);
x1 = imSizeCent(2)+(-120:0);
y2 = imSizeCent(1)+(-130:70);
x2 = imSizeCent(2)+(0:120);
y1 = imSizeCent(1)+(-140:0);
x1 = imSizeCent(2)+(-120:0);
y2 = imSizeCent(1)+(-140:0);
x2 = imSizeCent(2)+(0:120)... |
8ec7aa5e38055726d323918f233042aed700d8a139899d1af6cf4c2409835925 | MATLAB | 2,338 | 65 | function varargout = same_size(x1, x2, varargin)
%same_size - Check that two variables are the same size
%
% same_size(x1, x2) checks that x1 and x2 are the same size. If they
% are, nothing else happens; if they are not, the function throws an
% exception from the calling function.
%
% same_size(x1, x2, 'VarN... |
cbc20e676db57d2fdb37cd5d51a52a02293b63ab9af1a8db14159fd8e405f9ab | MATLAB | 2,338 | 60 | %% power curve
clc;clear;close all;
%%
% This code plots power curve
% T-test, vary sample sizes
% Number subjects
n = 50;
% SD for normal distribution that governs the correlations of
% non-covariate-related edges
sigma0 = 1;
FWER_threshold = 0.05;
% Number of repetitions
M_rep = 100;
% Number of permutat... |
7e8073d7e692583d9116147ae31d24ffbb8bd8f7caba6fbadd91bc64561ea579 | MATLAB | 2,339 | 56 | function [ spike_rate_mat_neuron_by_angle ] = plot_polar_tuning_curve( spike_rate_mat_neuron_by_angle, valid_head_direction_neurons )
number_of_angle_bins = size(spike_rate_mat_neuron_by_angle, 2);
CENTER_OF_ANGLE_BINS = [0.5 * (2 * pi) / number_of_angle_bins:...
(2 * pi) / number_o... |
cfabe41267a0d8986593a3d79d98d44140928a5508b17fbd430c4b87c4346528 | MATLAB | 2,341 | 45 | function P_value = permutation_test_reg(Wm, X, Wp, CID, Clist, M, func, threshold_GT)
% This function performs a permutation test to evaluate the significance of
% a statistic derived from regression between a matrix Wm and a vector X,
% against permuted data. It uses a specified threshold to calculate t... |
7a2f7ef952a4ca177f8282e190fea87f531212aea34a8c9dad1a1a9cfeaee8df | MATLAB | 2,342 | 91 | % ROOTANGLE_TREE Angle values between tree segments and line to root.
% (trees package)
%
% rootangle = rootangle_tree (intree, options)
% --------------------------------
%
% Returns for each node the angle between its segment and the straight line
% to the root.
%
% Input
% -----
% - intree ::integer: index of t... |
987d4f63d9bfc88d2b8574d7cfef70117ecbca14e4d4af5faef436b87485ba1d | MATLAB | 2,342 | 82 | function [loglik] = EEGfMRIPav_cbm_mod03(parameters,subj)
% Standard Q-learning model with delta learning rule and with Go bias and
% Pavlovian response bias.
% ----------------------------------------------------------------------- %
%% Retrieve parameters:
% 1) Feedback sensitivity:
nd_rho = parameters(1); % ... |
3fffbe886eed7141203e7feacdc3a8afee25d7328769df7a0a78f1dfd5d61280 | MATLAB | 2,347 | 118 | %first column = channel number on probe. Convention is ch. 1 is at top left of PCB
%and number wrap around in counter-clockwise fashion.
%second column = x coordinate, horizontal distance to reference electrode in microns. Convention is
%for reference electrode to be at bottom left corner of array when array
%points... |
2a98cdce259bebffbd54541134d3c20f7453455f501bb441e7fb25bbf715fea5 | MATLAB | 2,350 | 118 | %first column = channel number on probe. Convention is ch. 1 is at top left of PCB
%and number wrap around in counter-clockwise fashion.
%second column = x coordinate, horizontal distance to reference electrode in microns. Convention is
%for reference electrode to be at bottom left corner of array when array
%points... |
3e6704043ef301cc577154298aa23764fb44b3c845496217792e5b0c92c33a81 | MATLAB | 2,350 | 119 | %first column = channel number on probe. Convention is ch. 1 is at top left of PCB
%and number wrap around in counter-clockwise fashion.
%second column = x coordinate, horizontal distance to reference electrode in microns. Convention is
%for reference electrode to be at bottom left corner of array when array
%points... |
949cb733b003330caad5cba187a0725c2e0b3084900612dfd999aaf8f16daaa3 | MATLAB | 2,350 | 85 | % BF_TREE Estimates the balancing factor of a tree.
% (trees package)
%
% [bf, k] = bf_tree (input, options)
% ----------------------------------
%
% Returns the centripetal bias k of a tree, vector of root angles, or cell
% array of trees under the assumption that the root angles follow a
% modified von Mises distri... |
03d4c4692a88804e71d84ef2adf3600ffdf8dcaae88ff44eece1d95354d69463 | MATLAB | 2,351 | 86 | function cell_sig = CellsortApplyFilter(imgSeq, ica_segments, fLims, movm, subtractmean)
% cell_sig = CellsortApplyFilter(imgSeq, ica_segments, fLims, movm, subtractmean)
%
%CellsortApplyFilter
% Read in movie data and output signals corresponding to specified spatial
% filters
%
% Inputs:
% imgSeq - Image stack, m... |
1b0756fc1a91c21c1ee08130128eb95d87af4cebf474cab16b6cc8e53c02d470 | MATLAB | 2,352 | 79 | function lambda = LedoitWolfEstimate(X, form)
% Calculates the Ledoit-Wolf estimate for the shrinkage parameter used in
% the estimation of covariance matrices.
%
% Usage: lambda = LedoitWolfEstimate(X)
%
% X - [samples x features] matrix of training samples
% form - 'primal' uses the standard formul... |
ab65840692dc572760a14943eb2c2670552dc4917aad6bb7cbdf838238188343 | MATLAB | 2,353 | 119 | %first column = channel number on probe. Convention is ch. 1 is at top left of PCB
%and number wrap around in counter-clockwise fashion.
%second column = x coordinate, horizontal distance to reference electrode in microns. Convention is
%for reference electrode to be at bottom left corner of array when array
%points... |
bf8632ff1e06c8a73eb5afb6b24ab4d0941c00a872da503c73f9884aba0e0660 | MATLAB | 2,353 | 92 | % op_combinesubspecs.m
% Jamie Near, McGill University 2014.
%
% USAGE:
% out=op_combinesubspecs(in,mode);
%
% DESCRIPTION:
% Combine the subspectra in an acquisition either by addition or
% subtraction.
%
% INPUTS:
% in = input data in matlab structure format.
% mode = -"diff" adds the subspectra togeth... |
6cfa8af0bb698888795380658fa7882138f37582e5c89e250234ca661826011f | MATLAB | 2,354 | 83 | % sim_spinecho_xN.m
% Robin Simpson and Jamie Near, 2014.
%
% USAGE:
% out = sim_spinecho(n,sw,Bfield,linewidth,sys,tau,Nechoes)
%
% DESCRIPTION:
% This function simulates a multi-echo spin-echo experiment with 'Nechoes' instantaneous RF pulses.
%
% INPUTS:
% n = number of points in fid/spectrum
%... |
bcb84a196b9b17fc33a9895c25e8a56ae7bde5adf2aa17fb8802a873d9f1c44a | MATLAB | 2,356 | 69 | function ShowMessage(msg, screenNum, speak);
% Show a simple text message to the user, prompting them to press the
% button to continue.
%
% ShowMessage(msg, [screenNum=max( Screen('Screens') )], [speak=1]);
%
% This code was created for the purpose of prompting a subject in the
% middle of a series of runs as to wh... |
9eec9a70cf0ae120991e47b9c8adf4ced03200f88fdc615f23193122524cb1e0 | MATLAB | 2,357 | 68 | function varargout = logical_able(val, varargin)
%logical_able - Check that all elements are convertible to logical
%
% logical_able(val) checks that all elements of val are convertible to
% logical. If they are, nothing else happens; if they are not, the
% function throws an exception from the calling function.... |
422fddea4f7b533a31b4c5bdc7dab6018d11e4d0b3167b719602516c0f6e1c8a | MATLAB | 2,358 | 79 | function varargout = plot_signals(self, objPI, varargin)
% Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al.
%
% 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 ve... |
6574e12b0926809fa3fdd859b45f62d1aa87fa4118e17a14a561c87b6a7c7400 | MATLAB | 2,360 | 86 | % DIST_TREE Index to tree nodes at um path distance away from root.
% (trees package)
%
% dist = dist_tree (intree, l, options)
% -------------------------------------
%
% Returns a binary output with the nodes which are in path distance l
% from the root. If l is a vector dist is a matrix.
%
% Input
% -----
% - in... |
ee7232fafb256b5bee6aebe6308efdbf1fe6553e15a799c5a48fce6e7c31ae49 | MATLAB | 2,361 | 119 | %first column = channel number on probe. Convention is ch. 1 is at top left of PCB
%and number wrap around in counter-clockwise fashion.
%second column = x coordinate, horizontal distance to reference electrode in microns. Convention is
%for reference electrode to be at bottom left corner of array when array
%points... |
f65caa9d21b944ed274008c31b2ba0b5eb84d6caf19358ea368437f81ff5189b | MATLAB | 2,363 | 59 | function sshfrommatlabinstall(args)
%SSHFROMMATLABINSTALL(DOWNLOAD) provides installation instructions for SSHFROMMATLAB
%
% DOWNLOAD, provide this optional argument to download the appropriate
% garymed-ssh2 java library files
%
% This file will now add the java library to matlab's dynamic java path.
%
% I... |
bcb9042b14411129e46834a7cbffff035a1bd0c88aa436f8ae603436e71b2e70 | MATLAB | 2,364 | 119 | %first column = channel number on probe. Convention is ch. 1 is at top left of PCB
%and number wrap around in counter-clockwise fashion.
%second column = x coordinate, horizontal distance to reference electrode in microns. Convention is
%for reference electrode to be at bottom left corner of array when array
%points... |
0e17257d92b6b45fb1dc1b10bd047fec4c8594b58942e081e0025c0f4879748f | MATLAB | 2,365 | 55 | function [W_DSD_greedy, Clist, Node_Seq, removing_node] = OQC_greedyA(Wp_DSD, func)
% OQC_GREEDYA implements a greedy algorithm to extract a dense subgraph.
% This function is based on the approach described in the "Denser than Dense" paper.
% It extracts one dense subgraph from the given weighted adjacency matrix.
... |
2b6be61f41a822926e8483297c2e6bb058b5a2d5291d508dc0830b2e17e5ce07 | MATLAB | 2,367 | 88 | %% mvgc_kpss (EXPERIMENTAL)
%
% KPSS unit root stationarity test
%
% <matlab:open('mvgc_kpss.m') code>
%
%% Syntax
%
% [ksstat,cval] = mvgc_kpss(X,alpha,q)
%
%% Arguments
%
% See also <mvgchelp.html#4 Common variable names and data structures>.
%
% _input_
%
% X multi-trial time series ... |
bf3c3bd5b29c20f7b2f374b4cfef95b073f3845cb8c7eb1050774e92b5553e44 | MATLAB | 2,367 | 68 |
function [cost, rout_eff, st_cap, R, vol] = wiring_metrics3d_wscp (trees,expscp)
% Calculate R (arbor radius), connectivity repertoire aka storage capacity, routing efficiency and cost
% last two are with the same formula as 2D trees
% R^2 = (1/L^2)sum(i=1, K){sum(j=1 j=!i, K){dli*dlj*(ri-rj)^2}}
% S ~= S0+(L/a... |
f6fa5b5baf68af97ea39114d67771eb035db653fab9b9fa6ec51247784c485f1 | MATLAB | 2,369 | 103 | % ELIM0_TREE Eliminates zero-length segments in a tree.
% (trees package)
%
% tree = elim0_tree (intree, options)
% -----------------------------------
%
% Deletes points which define a 0-length segment (except first segment of
% course). Updates regions.
%
% Input
% -----
% - intree ::integer: index of tree in t... |
4decc110d880674a3f60f701a68bc18578dd3cc9e7ab6fee8b234fd47e3a1689 | MATLAB | 2,373 | 118 | %first column = channel number on probe. Convention is ch. 1 is at top left of PCB
%and number wrap around in counter-clockwise fashion.
%second column = x coordinate, horizontal distance to reference electrode in microns. Convention is
%for reference electrode to be at bottom left corner of array when array
%points... |
7797670dbf319b86686c88c1839d17cb41397d4e323238ec1d3dba4ce1ba4178 | MATLAB | 2,376 | 118 | %first column = channel number on probe. Convention is ch. 1 is at top left of PCB
%and number wrap around in counter-clockwise fashion.
%second column = x coordinate, horizontal distance to reference electrode in microns. Convention is
%for reference electrode to be at bottom left corner of array when array
%points... |
42c10c51f03a3a51c2a9bb133adf40bc1571f0bc0c4cfdeb62a4550ad2a09182 | MATLAB | 2,379 | 131 | clear
close all force
load('a0_0_bhv2trialStrct.mat');
load('a0_3_2_findFaceAndEyeLocatoins.mat')
load('a0_11_2_timingInsideFace_baselineCorrected.mat', 'inFaceTimeSumCorrectedAll')
load('a0_11_insideFace.mat', 'inFaceTimeSumAll')
%inFaceTimeSumAll = inFaceTimeSumCorrectedAll;
%%
%individual
NIImage_Individual = ... |
26f6a81e5d0bdd562d480257f0af33306ec0e120c50e71bafdd49fb16e84d979 | MATLAB | 2,381 | 67 | %% power curve
clc;clear;close all;
%%
% Number subjects
n = 50;
% SD for normal distribution that governs the correlations of
% non-covariate-related edges
sigma0 = 1;
FWER_threshold = 0.05;
% Number of repetitions
M_rep = 100;
% Number of permutation tests in one repetition
M_perm = 100;
% Size of the en... |
cd9c1261a1880687b91a0af2e5a403850514368cfcb5f5793f9b3aeba919893e | MATLAB | 2,382 | 64 | function [All outVars] = CalcPVisRFromVis(All,opts,outVars)
%%
if nargin<3
noOutVarsFlag=1;
else
noOutVarsFlag =0;
end
try
recWinRange = opts.visRecWinRange;
catch
disp('Might not have the visRecWinRange using recWinRange Instead')
recWinRange =opts.recWinRange;%
end
visAlpha = opts.visAlpha;
numE... |
5d96d7faa1d613375d489ea0886bf58a52bd59b931bbeced84b4ddeaa09f742a | MATLAB | 2,383 | 74 | %% Other Preprocessing Utilities
% A number of other preprocessing utilities are included in the CHIPS
% toolbox. For example, it is possible to calculate a new channel using
% information from other channels (e.g. for FRET ratiometric sensors),
% to split images up into multiple smaller images, and to concatenate
% i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.