sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
3788238ec226c39bb7fbf94ab32f0a89ab0d10b4790bc37990c44fa2789f1384 | MATLAB | 3,544 | 94 | %decc_plotFig6
% Related to Viswanathan, Stein, Nieder, PLOS Biol, 2024
% PV 2024
load('DECCdataFig6.mat')
% Figure parameters
dotcolorN1 = [0.0 0.6 0.7; 0.0 0.4 0.5; 0.0 0.2 0.3;...
0.0 0.6 0.7; 0.0 0.4 0.5; 0.0 0.2 0.3];
dotcolorN2 = [0.8 0.5 0.0; 0.6 0.3 0.0; 0.4 0.1 0.0;...
0.8 0.5 0.0; 0.6 0.3 0.0; 0.4 0... |
b81967246d3b8ff3e4794135601dc17eb329f858618b94d8fc0e2b0c88bad4a9 | MATLAB | 3,544 | 100 | classdef Test_BioFormats < matlab.unittest.TestCase
%TEST_BIOFORMATS Summary of this class goes here
% Detailed explanation goes here
properties (Constant)
fnBFOMETIFF = 'cellscan_ome_tiff.ome.tif';
skipImport = true;
end
% ================================================... |
78d0b7479e567b484f4f9755a49356206a1e2127537f8ead4d42e7c90e65e8cd | MATLAB | 3,546 | 145 | function [modif] = createModif(exp)
switch exp
case{'1'}
% EXP 1: two spirals, little scaling
%
disp('Exp1')
% %chose your dataset
modif.X1_3D = 0;
modif.X2_3D = 0;
%
modif.additDim = 1; % number of replication of the dimensions
%
... |
460553ef0396f5a5aaa8683c719dcabdfa94a5644abb461c6e0f6b909493b478 | MATLAB | 3,549 | 185 | %% plotLocationConsistency
clear all; clc
%% Find location folders
p = pwd;
% Find all days
d = dir();
isub = [d(:).isdir]; %# returns logical vector
nameDays = {d(isub).name}';
nameDays(ismember(nameDays,{'.','..'})) = [];
% Find all locs
allLocs = {};
for ff = 1:length(nameDays)
cd(nam... |
c0c67e111849fcb1073c5f6897c57d2facc426dcd39a42755985d67d2f54dc3c | MATLAB | 3,554 | 72 | %% Figure 1A: Sample EMG/EEG trace
close all; clear all; clc;
load("Fig1A_SampleEEGEMG.mat");
Fs=800;
EEG1data=EEG1.values; EEG1data=EEG1data-mean(EEG1data);
EMGdata=EMG.values; EMGdata=EMGdata-mean(EMGdata);
EEGExample=notchFilt(EEG1data,Fs,50);
EEGExample=downsample(EEGExample,100);
EMGExample=downsample(E... |
8a7c460adfe3cacd443cf548ac933ef585086e200122c8a6110e8fb5dc209462 | MATLAB | 3,558 | 177 |
%%
clear; close all; clc
buffSt = 1;
buffEnd = 1;
timeCue = 6;
rewCue = 4;
punCue = 5;
nRoll = 50;
plotOn = 1;
d = dir('*T*.txt');
file = d(20).name;
if isfile([file(1:end-3) 'mat'])
load([file(1:end-3) 'mat'],'logData')
else
logData = readLog(file,10);
save([file(1:end-3) 'ma... |
d88133c1dee2d3e7ee5978c632d0a256425719b954b3d5cae7e5688b98413fc0 | MATLAB | 3,569 | 118 | function [combinedImg, nROIs, barLabel] = plot_ROI_img(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 S... |
b9b0d901025ed81ff6b2f5394a7e15c49a126ed98fe0d23dba1409370296132e | MATLAB | 3,570 | 105 | function multiTopoPlot(job, data, zlim, nRows, startTime, endTime, steps)
% multiTopoPlot(job, data, zlim, nRows, startTime, endTime, steps)
%
% Plots multiple topoplots based on start and end time in steps contrasting
% two conditions.
% Works for both ERP and TFR data.
%
% INPUTS:
% job = cell with... |
e23af9db487479a197bef2263439d4d0002683cf5cc7972c5f11b1a2a5e5ef06 | MATLAB | 3,576 | 71 | function neuron = t2n_setionconcentration(neuron,str)
% This function modifies the Nernst potential or the extra- and
% intracellular ion concentrations (which then leads to different Nernst
% potential) according to specific experiments in literature. The list can
% be extended.
%
% INPUTS
% neuron neuron structure... |
fc2b5ff7691dd66d70e59ee50eb338e777796bd18dc12dccde71a774e85379c3 | MATLAB | 3,581 | 103 | function [loglik] = EEGfMRIPav_cbm_mod05(parameters,subj)
% Standard Q-learning model with delta learning rule and with Go bias,
% Pavlovian response bias, and with instrumental learning bias.
% ----------------------------------------------------------------------- %
%% Retrieve parameters:
% 1) Feedback sensitivit... |
995d14f156cf8fc439af3e616a23e0af099c09466b28f11afcf91e3aff1f91a0 | MATLAB | 3,582 | 87 | classdef (Abstract) DAQ < handle
properties
hAO % Reference to object that provides access to the AO task
hAI % Reference to object that provides access to the AI task
hDO % Reference to object that provides access to the DO task
% The following are default parameters for the cl... |
880310773a4c45637052206b7767a51b34e47164973ed326edc6ddd0fd583878 | MATLAB | 3,584 | 76 | %==========================================================================
% This script performs simulations to explain the conversion between drop
% errors and memory-performance values.
%
% Lukas Kunz, 2023
%==========================================================================
% start
clear; clc; close all;
a... |
201866566420f8f579652420735cec10c1f9c61ab54b6ad1e470661d5901d93c | MATLAB | 3,592 | 158 | %io_loadspec_brukNMR.m
%Chathura Kumaragamage, McGill University 2016.
%Jamie Near, McGill University 2016.
%
% USAGE:
% [out,ref]=io_loadspec_brukNMR(filename);
%
% DESCRIPTION:
% Reads in Bruker MRS data (fid.raw, fid.ref).
%
% op_loadspec_bruk outputs the data in structure format, with fields corresponding to time
... |
0593733cd4cd911683081f207457e0b4a2e0b845fde9742dacd63eb58ae42e53 | MATLAB | 3,596 | 76 | % define the keyboard mapping
% change these to your personal preferences
%
% the TREES toolbox: edit, visualize and analyze neuronal trees
% Copyright (C) 2009 Hermann Cuntz
function cgui_tree_keys
global cgui
% ui_ related:
cgui.keys.ui = {};
cgui.keys.ui {1} = char (30); % (arrow up) change active ed... |
423fa8e50ab5d3ebf4a5c578a57a2479aa996a64067b7db7f4227f1682f99e8b | MATLAB | 3,597 | 69 | function fiber = MakeFibers(expt, fiber, ROI, varargin)
Nfiber = numel(fiber);
if nargin > 3
show = varargin{1};
else
show = false;
end
if show, figure('Units','normalized', 'OuterPosition', [0,0,1,1], 'Color','w', 'PaperOrientation','landscape'); end
for f = 1:Nfiber
fiber(f).Nroi = numel( fiber(f... |
be140ce8497537e2cc5f2d8ee9c876feaa35c4028983a89dfd29c298916ddb78 | MATLAB | 3,605 | 107 | %% Define the rounds
rounds_zoomed = [4,20,25,30];
rounds_norm = 1:30; rounds_norm(rounds_zoomed) = [];
DIRECTORY = '/Users/Goody/Neuro/ExSeq/exseq-pub/input/';
files = dir(fullfile(DIRECTORY,'*.tif'));
ZOOM_FACTOR = 1.5;
FIXED_STRING = 'fixed';
%% Load the data that we know represents two examples
zoomed_img = fullfi... |
9f09ab7689ac3dd3622a9ab82c8294d694374b7e92c381d80e6b6f8fa56e86c2 | MATLAB | 3,613 | 111 | function [out] = EEGfMRIPav_cbm_mod04_osap(parameters,subj)
% Standard Q-learning model with delta learning rule and Go bias and
% Pavlovian learning bias.
% ----------------------------------------------------------------------- %
%% Retrieve parameters:
% 1) Feedback sensitivity:
nd_rho = parameters(1); % nor... |
de62324cb51458d7b1c340a5211f3db0d624ca53d002415a7e44e3a754480221 | MATLAB | 3,613 | 89 | % the pattern separation toolbox: analyse spike train ensembles
% Copyright (C) 2022 Alexander D Bird
function [MI_obj] = MI_function(input,output,code,num_params,options)
%MI_FUNCTION Calculates the mutual information between the input and output ensembles
if nargin<3 || isempty(code)
code={'spatial','sp... |
20c661d2651e6049c5323e41ce689cd72284bbbc207b648aeaeff75fc6b96338 | MATLAB | 3,620 | 86 | %
clear all
matlabImpute = false;
imputeIters = 0;
NumTreesVec = [80];
substractMouseMean = false;
usedMouseId = [];
LeaveOut='trainOneMouse';
balanceClasses = true;
useStdMatrix = false;
LeaveOutVec = {'mouse'};
outFname = '.\AllResMouseAtA_Time10_1000Rand.csv';
averageAllBoutsFromSessionVec = [true];%[... |
8b619e1b403538686b4da03688f6f5dac74f4e9c21d7594fd7f034e2ad06ba4d | MATLAB | 3,622 | 125 | % LOADTIFS_STACK load a tif image stack file into a stack structure.
% (trees package)
%
% [stack, name, path] = loadtifs_stack (name, options)
% ----------------------------------------------------
%
% Loads an image stack from a tif file. As in "save_stack" the data stack
% is in the following form:
% stack.M::cell... |
e82e1c977926f812ff6f5687f97348f2e6be35d42a42e9204bb58aaf16b774e6 | MATLAB | 3,626 | 83 | function fig = t2n_FIplot(targetfolder_data,neuron,ostruct,targetfolder_results)
% This function uses the simulation data generated by t2n_currSteps and
% plots the spike frequency / number of APs at each current step.
%
% INPUTS
% targetfolder_data folder which was given to t2n_currSteps, where the
% ... |
33531ba8f04cc9505ebc13a179bd383ac1cc17a0014e003ef86f4eb032582f81 | MATLAB | 3,634 | 117 | % op_alignrcvrs.m
% Jamie Near, McGill University 2014.
%
% USAGE:
% [out,coilcombos]=op_alignrcvrs(in,point,mode,coilcombos);
%
% DESCRIPTION:
% phase align the receiver channels without combining them.
%
% INPTUS:
% in = input spectrum in matlab structure format.
% point = Index of point in time... |
e2070191a25790fe6c3d243a338dc830b35138c0a41819832ab1f893af89f35c | MATLAB | 3,634 | 77 | function strct = t2n_changemech(strct,change,mode)
% This function changes parameters in the T2N neuron mech structure
% according to argument "change".
%
% INPUTS
% strct neuron structure containing ion channel densities or
% alternatively only the mech field of the neuron structure
% change structu... |
5b4142c6d4be3543a323c23beff129a404a4c0a51c91d89eca8f1fe4eba383bd | MATLAB | 3,635 | 112 | function generateLaserCalibrationCurve(obj,minMax)
% Calibrate the laser: determine the relationship between output and control voltage
%
% function laserFit = zapit.pointer.generateLaserCalibrationCurve(minMax)
%
% Purpose
% Measure the relationship between control voltage laser output using an... |
601e453ba5122b9b254324089718f93bc9a5292e3af7a9168011ec76c4e1106d | MATLAB | 3,637 | 117 | function varargout = hardwareContinuousDigitalSquareWave(devID)
% function nidaqmx.AO.hardwareContinuousDigitalSquareWave(devID)
%
% Purpose
% Shows how to do hardware-timed digital outputs using the DAQmx .NET
% interface. This function sends out a 10 Hz square wave from P0/L0 and
% a 100 Hz ... |
f87a0fcfe35d1025331238b7e8b8dfcdb46d9c3fc9bfb6c4907375277c48b13f | MATLAB | 3,637 | 100 | classdef Test_CalcVelocityStreaks_params < matlab.unittest.TestCase
%Test_CalcVelocityStreaks Summary of this class goes here
% Detailed explanation goes here
% ================================================================== %
properties (TestParameter)
classCVS = utils.find_subcl... |
d5e32111d90725a4599dd12824d1d82c24a6c305c2d6186362b6d400c498a5f8 | MATLAB | 3,639 | 86 | %% Revised figure
% A - still frames of wave progress, with time shown, some fiber ROIs shown, and scalebar
X = 37; % DL75
% Generate movies of fibers during registered CSD bouts
movParam.dir = 'D:\MATLAB\LevyLab\Figures\BoutMovies\CSD\Fibers\'; % 'D:\MATLAB\LevyLab\Figures\CSD\Movies\';
mkdir(movParam.dir)
mov... |
baa01905f77df8364237b8d2a43f0bd668deb0fc68d7c6455dd15f0548f6c890 | MATLAB | 3,644 | 118 | % STRAHLER_TREE Strahler values in a tree.
% (trees package)
%
% strahler = strahler_tree (intree, options)
% ------------------------------------------
%
% returns the Strahler values for each node:
% - if the node is a terminal, its Strahler number is one.
% - if the node has one child with Strahler number i, and... |
8bafa55b8527bcb142f4f487ae1ca496af708eacf4f0228cb7ba3eee9ea47879 | MATLAB | 3,645 | 99 | function vargout=subplot_tight(m, n, p, margins, varargin)
%% subplot_tight
% A subplot function substitude with margins user tunabble parameter.
%
%% Syntax
% h=subplot_tight(m, n, p);
% h=subplot_tight(m, n, p, margins);
% h=subplot_tight(m, n, p, margins, subplotArgs...);
%
%% Description
% Our goal is to grant t... |
9df69ae7028fedf65a47bdb276b1f959b19f6682bd26aa44bf5c4f794b27ca5c | MATLAB | 3,646 | 83 | function EEGfMRIPav_0_markInterpolation(rootDir)
% Set directories based on root directory, add paths for Fieldtrip
%
% INPUT:
% rootDir = root directory relative to which paths are initialized
% (default '/project/3017042.02')
%
% OUTPUT:
% saves file 'channels2repair' to disk in dirs.data.
%
% EEG/fMRI ... |
68abd8b03e9c39193d16bee0ece6280894e191c12966bad04dbfe37b416e8990 | MATLAB | 3,649 | 122 | function [N,Z,M,A,XYZ] = tfce_surf_max(X,L,G)
% Sizes, local maxima and locations of excursion sets on a surface mesh
% FORMAT [N,Z,M,A,XYZ] = tfce_surf_max(X,L,G)
% X - a [nx1] array of stat values
% L - a [nx1] array of locations {in vertices}
% G - a patch structure
%
% N - a [px1] size o... |
cc2ac244d90e21da385a609481e4debb2434d7a8172c1784bdf942059471b406 | MATLAB | 3,653 | 86 | classdef (Abstract) CalcDiameter < Calc
%CalcDiameter - Superclass for CalcDiameter classes
%
% CalcDiameter is an abstract superclass that implements (or requires
% implementation in its subclasses via abstract methods or properties)
% most functionality related to CalcDiameter objects. Typically there is
% o... |
3f1dd3362e811f0c42a3610f08186881cef1eaaf136801440712f3f46ca9ee59 | MATLAB | 3,655 | 134 | function pointsToUse = crop_rows_cols(imgData, varargin)
%crop_rows_cols - Helper function to crop rows or columns
%
% This function is not intended to be called directly.
% Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al.
%
% This program is free software: you can redistribute it and/or modify... |
13965740ed79f3371fe16096ca8ccda394d5514830eb08669c6a83996d44e84f | MATLAB | 3,656 | 122 | function varargout = same_file(x1, x2, varargin)
%same_file - Check that two files are identical
%
% same_file(x1, x2) checks that x1 and x2 are identical text files. If
% they are, nothing else happens; if they are not, the function throws an
% exception from the calling function.
%
% same_file(x1, x2, 'VarNa... |
3b929c208fe4d2f58758e6fa04a1f695cf508052f4d1b25abdd35fe32a9b649e | MATLAB | 3,660 | 98 | function plot_imgs_sub(self, objPI, hAxes, 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 versio... |
a87919671c38b9f9b7ea3253838fb43cafadf09ea3babaa4a7f98377081175e5 | MATLAB | 3,660 | 102 | function RunIJ()
%RUNIMAGEJ Loads and opens ImageJ
%% This script sets up the classpath to Fiji and optionally starts MIJ
% Author: Jacques Pecreaux, Johannes Schindelin, Jean-Yves Tinevez
% GNU Octave compatibility added by Eric Barnhill, Jul 2016
% Edited by Arthur Sugden to force ImageJ to be ... |
c5e45d85eef584f083d5fb8d3421074160f3b5e97130dcd4e31ef2ca91d79d27 | MATLAB | 3,660 | 101 | % op_getcoilcombos_specReg.m
% Jamie Near, McGill University 2014.
%
% USAGE:
% coilcombos=op_getcoilcombos_specReg(file_or_struct,tmin,tmax,point);
%
% DESCRIPTION:
% This funciton finds the relative coil phases and amplitudes. Coil phases
% are found by fitting in the time domain. (In the original
% op_getcoilcomb... |
d443f0a48accaae334d170f32415b90a245006dfa46e3b09449a68c5785aacb8 | MATLAB | 3,673 | 139 | % XPLORE_TREE Tree exploration plots.
% (trees package)
%
% [HT, HP] = xplore_tree (intree, options, color, DD)
% ---------------------------------------------------
%
% Plots different 2D representative exploration plots for a tree.
%
% Input
% -----
% - intree ::integer: index of tree in trees or structured... |
7c2c498f815bdf0614d536dfc0dc832de44652cc503486cab89ef16ed16cdd8f | MATLAB | 3,674 | 181 | %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... |
14903f0585059b62b807b3287cf6cef7922672d3b51c473433ddc42b4d047f40 | MATLAB | 3,677 | 181 | %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... |
3cd2e451b116769d9c3b3bed29d17fa8908ffdc26d838dd8ba4e7b35bdad5aff | MATLAB | 3,677 | 83 | function [peak_mW, standardised_mW, stimDuration_ms] = laserPowerFromTrial(obj, trialIndex, standardised_mW, power_vector)
% Get laser power specified at a given trial. If necessary, scale by stim pulse duration
%
% function [peak_mW, standardised_mW] = zapit.stimConfig.laserPowerFromTrial(trialIndex)
... |
94563c3ac76b91658897ffca0748d7e52e456513c989eb04a8cf7fc02793ff1c | MATLAB | 3,677 | 115 | %%% parameter_sweep_1D_combinedPlot.m
%%% Omkar N. Athavale, May 2023
%%% Plot sweeps across k_xXXXX parameters from 0 - 1
% --- INPUTS ---
var_seq = 1:5; % variable index to sweep (max 2)
n = 51; % number of points to sweep (all variables same)
% --------------
non_sweeped_values = [0 0 0 0 0];
non_sweep = input('0: ... |
42a8ff5de43b3c131b5d15aedd808788fbeffdb6c20e061529bb2f165395d187 | MATLAB | 3,681 | 96 | function [p] = ft_connectivity_plm(input, varargin)
% FT_CONNECTIVITY_PLM computes the phase linearity measurement from a cell
% array of time-domain data, where each cell is an epoch. This function implements
% the metric described in Baselice et al. "Phase Linearity Measurement:
% a novel index for brain functional ... |
5dd11d450f88e2ddeb9934085d0472cf04743e348ff9065d107bf3d3a2344659 | MATLAB | 3,684 | 128 | function [ ...
AP_times, ...
AP_actual_sizes, ...
Latency, ...
AP_times_number, ...
hw_list, ...
max_second_derivatives, ...
RMP, ...
width, ...
width_start, ...
width_finish ...
] = parse_pub(data, duration, stimulus_artifacts, sweeps, filter)
thresh_AP = -50; %set threshold to... |
a4ce042c5477f5444b17d9d92a5535b404a30e8ece720efd1fbc9a33a1a7f553 | MATLAB | 3,686 | 86 | classdef (Abstract) CalcVelocity < Calc
%CalcVelocity - Superclass for CalcVelocity classes
%
% CalcVelocity is an abstract superclass that implements (or requires
% implementation in its subclasses via abstract methods or properties)
% most functionality related to CalcVelocity objects. Typically there is
% o... |
ea3960f7a38287c94e8667f72cb0429854d0d00308328aaafbf30d8cafaca334 | MATLAB | 3,686 | 119 | function [Gw,Gs,Gss]=geombinsurr_partial(W,D,frac,nbins,bintype)
% [Gw,Gs,Gss]=geombinsurr_partial(W,D,frac,nbins,[bintype])
%
% Surrogate random graphs that approximately preserve the relationship
% between weight and distance by first binning the edges by distance and
% then shuffling within the bins. Randomizes... |
faa0abc5ca8c7f1b33c112e5acd793a404af9a12790995510422510618087d06 | MATLAB | 3,686 | 129 | function [tStats] = ttestAllPairsEffectSize(data1,testName,nUnits,pair,MC,testIdxs)
% Performs all pairwise two-tailed Student's t-tests for a set of data.
% Outputs all statistics in a cell array. Can be used to manually generate
% correlation information for compliance with journal manuscript
% requirements. Can ... |
e1b77e54cef2aa9eb9ca044c330bb81f0a412bedc1690240c8813fd781f28214 | MATLAB | 3,687 | 141 | % Using previously generated spike trains from the "Simulations" subdirectory,
% this code reproduces panels A1, B1, A2, B2 in Fig.3 and plots
% corresponding spike correlation functions as those in Fig.4.
%
% The spike trains are generated in simulations of network dynamics
% implemented in simulateSp... |
9a46eca6efd6c21c6f6c0a9dbf6cebe3ff192e62f286fdf643aceba81693409c | MATLAB | 3,690 | 115 | %% Online Signal Averaging Example
%
% <html>
% Import strobe store gizmo data into Matlab using SynapseLive during the
% experiment <br>
% Plot the average waveform <br>
% Good for Evoked Potential visualization <br>
% </html>
%% Housekeeping
% Clear workspace and close existing figures. Add SDK directories... |
05f14082aedca66dba1a49e4d6e3747cd4c930152fa0184a56c90de06c78215e | MATLAB | 3,691 | 93 | % op_CSIApodize.m
%
% USAGE:
% MRSIStruct = op_CSIApodize(MRSIStruct, functionType='hamming', fwhm=[]);
%
% DESCRIPTION:
% Applies apodization/spatial smoothing to the MRSI data. 3 spatial smoothing
% fucntions can be used, hamming, cosine, and gaussian. Full width half maxium
% can be passed to determine the amount... |
23238a159505091bd4b41efb4be04868f01413247f9d921ac227f4f727bb25cb | MATLAB | 3,691 | 100 | function varargout = subGuiTest(varargin)
% SUBGUITEST MATLAB code for subGuiTest.fig
% SUBGUITEST, by itself, creates a new SUBGUITEST or raises the existing
% singleton*.
%
% H = SUBGUITEST returns the handle to a new SUBGUITEST or the handle to
% the existing singleton*.
%
% SUBGUITEST('CALL... |
50f634d92d55aacb62c7ee818cb366ac4551cec89cfb9dd48c08fd78b8a48258 | MATLAB | 3,691 | 133 | %% Do projection
% define a regular grid covering the domain of the data (arb scale)
[xxmat,yymat,zzmat] = meshgrid(-47.5:1:47.5,-47.5:1:47.5,-28:1:28);
order = ones(96,96,57);
n_timepoints = length(respcomp);
mb = 3;
n_exc = size(order,3)/mb;
xx0 = xxmat(:,:,1);
xx = xx0(:);
yy0 = yymat(:,:,1);
yy = yy0(:);
slicet... |
148c29ccae9970f43a146ae890a9cba266413f60b3703f36028373e0a34fb5c9 | MATLAB | 3,692 | 115 | %% Online Signal Averaging Example
%
% <html>
% Import strobe store gizmo data into Matlab using SynapseLive during the
% experiment <br>
% Plot the average waveform <br>
% Good for Evoked Potential visualization <br>
% </html>
%% Housekeeping
% Clear workspace and close existing figures. Add SDK directories... |
75eab898286881757596f713491e36cbfdb930fb87ab3e62374b381faa0efda3 | MATLAB | 3,692 | 113 | function varargout = less_than(val, num, allowEq, varargin)
%less_than - Check that a value is less than a number
%
% less_than(val) checks that all elements of val are less than 1. If
% they are, nothing else happens; if it is not, the function throws an
% exception from the calling function. val must be numer... |
44cd997fd563f42df69c63942e53c65398504b91da165a213e8c693e475b29ac | MATLAB | 3,696 | 106 | function varargout = writeWaveformsToDisk(obj,filePath)
% Write waveform matrices that are to be sent to DAQ to disk
%
% zapit.stimConfig.writeWaveformsToDisk(filePath)
%
% Purpose
% Save to disk the waveforms that are used to present stimuli in stereotaxic space.
% In other words, these are... |
d70e6263628c9b8985562d830338bfa4fb2d64548e283f556f7b99ec8b4b416a | MATLAB | 3,699 | 84 | function [currVec,out] = t2n_voltSteps(neuron,tree,vstepsModel,dur,holding_voltage,targetfolder_data)
% This function performs one or multiple voltage steps (in the squared
% pulse format, i.e. voltage step is surrounded by step to the baseline
% potential) in the cells given by "tree" and "neuron" and saves the
% res... |
d8b406e9f553a5fe7c3f1ffbee6a48ee91799448e01e2d709353397b944c430b | MATLAB | 3,702 | 108 | function varargout = calc_angle_radon(self, window, rangeTheta, ...
isDarkStreaks, pixelSize, lineTime, pixelTime, isOldToolbox, 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 ... |
631408385fa4c9fbcda3edbcd24f343d735db5f76f60e26cd553a3abb799aa1a | MATLAB | 3,714 | 95 | function result = run(cfg)
%RUN Run the MATLAB fMRI phase regressor pipeline.
pipelineTimer = tic;
cfg = fmriPhase.validateConfig(cfg);
fmriPhase.util.log(cfg, 'Starting fMRI phase regressor pipeline.');
if strlength(string(cfg.qsmSetup)) > 0
stepTimer = tic;
fmriPhase.util.log(cfg, 'Adding QSM toolbox paths.... |
82df470a288e703a30d1a7ecdea3a6d48cccea0a0c96fe3828d7966fccedf3e6 | MATLAB | 3,716 | 116 | %% Description
% The following script performs the cluster permutation statistical analysis
% for comparing condition-specific EEG data as desribed in
% https://doi.org/10.1101/2022.03.03.482861.
% Requires Fieldtrip toolbox (https://www.fieldtriptoolbox.org/)
% called by Run_ClusterAnalyses.m script to perform stati... |
4fbf64e3664cbc1d6fa1ed825d9e3f92339629115317460e674dd0f6e420523a | MATLAB | 3,723 | 109 | function [event, Nevent, eventRate, eventRaster] = DetectEvents(T, zData, magData, varargin) % expt,
% Parse inputs
IP = inputParser;
%addRequired( IP, 'expt', @isstruct )
addRequired( IP, 'T', @isnumeric )
addRequired( IP, 'zData', @isnumeric )
addOptional( IP, 'magData', [], @isnumeric )
addParameter( IP, 'mi... |
0f8d8ceca085c0c62c0894c58a31096c7bc6253fa9d738ba9c1461b931b2fe5a | MATLAB | 3,725 | 110 | %% BioFormats
% Store raw data from BioFormats images
%% Usage
% OBJ = BioFormats(FILENAME, CHS, CAL)
%% Arguments
% * |FILENAME| is the original filename (including the path) of this
% |BioFormats| object.
% * |CHS| is a scalar structure that contains information about the
% meaning of the image channels.
% * |CAL... |
4b6763ca9bb0479cc358121512ee359f7079ff169e94013d755488684650b73c | MATLAB | 3,726 | 127 | % mv_searchlight unit test
rng(42)
tol = 10e-10;
%% [2 classes] searchlight should identify the good features
% Generate data
nsamples = 200;
nfeatures = 40;
% Create Gaussian data with uncorrelated features
X = randn(nsamples, nfeatures);
clabel = zeros(nsamples, 1);
X(1:nsamples/2, :) = X(1:nsamples/2, :) + 5;
cla... |
b49b6c8fa311cb77a160ca84b5d98ff083b6d560ceda0123fff0054c4c6030fa | MATLAB | 3,730 | 113 | function varargout = greater_than(val, num, allowEq, varargin)
%greater_than - Check that a value is greater than a number
%
% greater_than(val) checks that all elements of val are greater than 1.
% If they are, nothing else happens; if it is not, the function throws an
% exception from the calling function. val... |
0a52111c3dd2eae17b26625cfdb7a14ad8b706cdeb715c86016b30e0c5e47a7e | MATLAB | 3,732 | 130 | function [roiImg, nROIs] = plot_ROI_layers(~, roiMask, 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, e... |
62ce9fe8a766f26c29465ff6d5ac01adc7cabcb1395e97c3f5bb3f1aa948fcac | MATLAB | 3,732 | 94 |
clear all
close all
averageAllBoutsFromSession = false;
substractMouseMean = true;
useStdMatrix = false;
rng(0)
load('AllBouts.mat');
for k=1:length(sessionNames)
sessionNames{k} = [sessionNames{k},'_MouseID',num2str(MouseIDs(k))];
end
if averageAllBoutsFromSession
[DataMatrix, Labels,MouseID... |
7180b0d0e060d60a5db803a17dd87b5670dfae6d3fe1da1a711ba498b80b27db | MATLAB | 3,736 | 166 | %%
clear all; close all; clc
d = dir('data_*');
nFile = length(d);
PR = [0.78,0.977];
outCol = [1 2 3 4];
outType = {'S-S','S-O','O-O','O-S'};
%%
dists = cell(nFile,4);
for f = 1:nFile
load(d(f).name)
if f==1 && strcmp(pwd,'D:\Novelty_Analysis\clusterMan\good')
pr = PR(1)... |
eab01b74c4c796970ec37d04a283161e85ea7ab38217eec1e39a368695552c09 | MATLAB | 3,739 | 60 | function [ full_neuron_firing_per_bin, angles, position ] = create_spike_count_and_angles_vector( period, T, G, Ang, Pos )
global BEHAVIORAL_SAMPLE_RATE NEURONAL_SAMPLE_RATE BEHAVIORAL_SAMPLES_PER_TEMPORAL_BIN SAMPLE_LIMIT;
number_of_neurons = max(G);
% Create edges of entire sws period
cluste... |
bb3f8aab69304d50fb1f9cc5f8376421da179c9c0789897d1f580e6ef803443d | MATLAB | 3,742 | 125 | % this code reads all the monkey logic data files and finds the monkey
% names, imagesets, and dates and stores them in a structure then save them
% in a0_0_bhv2trialStrct.mat .
clear
close all force
if false % this will create an empty a0_1_1_bhv2ImgStrct.mat
kahdflahjflaj
clear
dataTrl = [];
data... |
efeeda3dce673976b3f809b4ad0b61cd7e4d6fe443085fca04c2f3b438001f96 | MATLAB | 3,752 | 106 | function singleTopoPlot(job, data, zlim)
% singleTopoPlot(job, data, zlim)
%
% Plots one single topoplot based on job.sigTime contasting two conditions.
% Works for both ERP and TFR data.
%
% INPUTS:
% job = cell with relevant fields for plotting settings,
% required fields:
% .layout ... |
0f3f5a64f6cf20b4de79ec82d3219b44844d5ede77e8b4d59addc44695834444 | MATLAB | 3,757 | 78 | function AngPref = AngularPreference( Theta, Rad, OrthAng, varargin )
% Given a polar data set, quantify angular tuning using 2 methods:
%1) generate the resultant, then calculate the normalized magnitude
%2) find the maximum, along with the the orthogonal angle. Then compute index = (max-orthog)/(max+orthog)
Ang... |
28232d7e06389880bdcee53be95de116e899ad251b361562e436a08b5283f038 | MATLAB | 3,757 | 105 | function aperiodic_sensitivity(model_case)
baseFolder = '/lustre04/scratch/nbrake/data/simulations/mixed_input';
funPath = '/lustre04/scratch/nbrake/code/simulation_code';
addpath(funPath);
fid = fopen(fullfile(funPath,'mod_files','default_parameters.json'));
str = char(fread(fid,inf)');
fclose(fid);
pars = jsondecod... |
19b90e1df9d2a5fe1f08227dca6d58365e7b0f59a00ab01823b0df0b82079858 | MATLAB | 3,760 | 99 | % Step 1: Ditial aperture filtering
% Reference: A. Orth, etc.,Optical fiber bundles: Ultra-slim light field imaging probes
% Two images for full and small aperture will be saved
% last modified 2022-05-20
% by Peisheng Ding (peisheng.ding@mpi-halle.mpg.de, peisheng.ding@mail.utoronto.ca)
clc;
clear ;
close ... |
0843ff42b7d058a97dd6a22b4c8d8606b9504e003a0a476a74ae4880c0c8cee1 | MATLAB | 3,766 | 75 | function f = LK_PlotRipplePropertyPerPhase_20231030(dt)
%
% LK_PlotRipplePropertyPerPhase_20231030 plots a particular ripple property
% by trial phase.
%
% Lukas Kunz, 2023
%% create figure
f = figure('units', 'centimeters', 'position', [2, 2, 5, 6]);
axes('units', 'centimeters', 'position', [2.4, 1.4, 2, 3.5]);
hold ... |
aa0c5e956dc2bce9334c33ec1703572324bc0a98a862130db141890895b4625b | MATLAB | 3,766 | 146 | % Age and gender of all 15 mice
%7 females and 8 males. For bad learners, there are 2 males and 2 females
%
%below: the experiment start means the date of the last day in old env
% 1118 f (DOB 8/8/20, experiment start 12/24/20: 4.5 months) 138 days
%
% 0206 m (DOB 8/9/20, experiment 03/06/21: 7 months) 209... |
7f7d70809ad58c70e25e0d7f28b0d506040354a7ff8d75da845ba9008c3d556f | MATLAB | 3,767 | 97 | function [hb,he]=barScatter(data, errors, bw_xtick, bScatter, bSED, bColor, xpos)
% [hb,he]=barScatter(data, errors, bw_xtick, bScatter)
%
% barScatter takes either an m-by-n matrix of data to be plotted
% errorbars can be custom specified, or are computed as the SEM across n
% bScatter (true/false) indexes whether sc... |
798f7a596b1756ed56df4c30f94ec067b2e20c5b3c6bc0841ab5cc32f8be47f0 | MATLAB | 3,773 | 105 | function RunImageJ()
%RUNIMAGEJ Loads and opens ImageJ
%% This script sets up the classpath to Fiji and optionally starts MIJ
% Author: Jacques Pecreaux, Johannes Schindelin, Jean-Yves Tinevez
% GNU Octave compatibility added by Eric Barnhill, Jul 2016
% Edited by Arthur Sugden to force ImageJ to... |
e2e3a52d1c4b002b44dc49de4eb7793df1d8c6ab0801e03c0d6c3654b114e6ed | MATLAB | 3,777 | 136 | function [slices] = slicer_v5(sRH, sfrtmp, tlabv, cpi1, tv, stv, tinit, tsd)
% slicer_v2 takes the whole sequence and makes a cell array of slices which
% correspond to the individual humidities
% The cell array is returned to the parental code
D = diff(sRH);
CV = abs([D ; 0]) >= 15; % change vector, marks the posit... |
96315e3aaaba83540623e2de27cf664d59fca933b3b2913b3a6300c86b2681ce | MATLAB | 3,780 | 51 | load('Fig2andSupFig_RippleRateComparison')
sublist=[2:7];
ecd_nr_cond=[];ecd_rr_cond=[];ecd_nr_val=[];
rtv_nr_cond = []; rtv_rr_cond=[];
ecd_nr_cond_hA=[];ecd_nr_cond_lA=[];
ecd_nr_sim=[]; ecd_nr_sim_lA=[]; ecd_nr_sim_hA=[];
ecd_rr_sim=[]; ecd_rr_sim_lA=[]; ecd_rr_sim_hA=[];
rtv_nr_sim=[];
for nsub = subli... |
fbc315dc91c6c5d12a231f4e4333434227027ea4138254e230c1f35b1b188e55 | MATLAB | 3,782 | 115 | function [out] = EEGfMRIPav_cbm_mod05_osap(parameters, subj)
% Standard Q-learning model with delta learning rule and Go bias and
% Pavlovian response bias and Pavlovian learning bias.
% ----------------------------------------------------------------------- %
%% Retrieve parameters:
% 1) Feedback sensitivity:
nd_rh... |
fc96047c2c65f5e55ea0a9eb1bb5708b97bee8cc0c8a1d756e7b8f3c04419a84 | MATLAB | 3,785 | 117 |
load('a5_2_averagingHeatMaps21x28_diffSingleImages.mat');
load('a5_2_averagingHeatMaps21x28.mat');
%m = max(mVectorDiff_forEachImage,[],'all');
%mVectorDiff_forEachImage(1,1,:,:,:) = m;
%close all force
t = ({'No Inj.', 'FacePatchRight 10', 'FacePatchLeft 10', 'ControlRight 10', 'ControlLeft 10', 'FacePatchRight 5... |
dc921a381b3b61ffc46e809e0e177544b7ab494fab4d931bb49ac178b3f317dd | MATLAB | 3,787 | 139 | %This script is to evaluate the MU density baseline level to eventually
%bypass burst detection
ID='Gi17231';
%pre-SCI
timepoint='ctl';
temp=strcat(ID, '_', timepoint, '_trigMU.mat');
load(temp)
LTA_BSL_CTL=[];
RTA_BSL_CTL=[];
NBBIN=length(STIM_DATA_MU(1).mudLTA);
CENTR=NBBIN/2;
for i=1:length(STIM_D... |
6df22291df7d56aaa82db7f4d638a5d715a6c890245da0916d8dbeafd6fbab7e | MATLAB | 3,796 | 86 |
% clear;clc
% maindir = 'F:\ds003947-download\subjects';
% subdir = dir( maindir );
% for i = 1 : length( subdir )
% if( isequal( subdir( i ).name, '.' ) || isequal( subdir( i ).name, '..' ) || ~subdir( i ).isdir )
% continue;
% end
% subdirpath = dir( [maindir,filesep, subdir( i ).... |
d766e48fd4542188b3dbdfaa731c3d8a8a825dba3abd58cccb16faab6ef0c0ff | MATLAB | 3,800 | 107 | function [R,C] = generateScannerCalibrationPoints(obj, varargin)
% Generate the calibration points for the scanner calibration
%
% function [R,C] = zapit.pointer.generateScannerCalibrationPoints(param1,val1,...t)
%
% Purpose
% Generate the scanner calibration point locations
%
%
% In... |
8412ce5217eecf396442a7fd1a48facc2821a44e5a8419bed82f51cb2ae079c4 | MATLAB | 3,807 | 149 | function h = makePSFmontage(data)
% Testing code for making a PSF montage
%
% Example
%
% Run at the CLI:
% [R,C] = hZP.generateScannerCalibrationPoints;
% [out,im] = hZP.measurePointingAccuracy([C,R]);
% makePSFmontage(out)
%
%
% To plot data from the last calibration in ... |
b51589ac7b6a48db8940c4bce3b43bdf12c779484cf46d206704106c354f2d43 | MATLAB | 3,807 | 95 | %% Averaging Example
%
% <html>
% Import stream and epoc data into Matlab using TDTbin2mat <br>
% Plot the average waveform around the epoc event <br>
% Good for Evoked Potential detection
% </html>
%% Housekeeping
% Clear workspace and close existing figures. Add SDK directories to Matlab
% path.
close all... |
989814389ee2c31cf7602ed82a23f16d5849076833b27a29ea729fc1a0b2ca39 | MATLAB | 3,814 | 126 | %sim_Hamiltonian.m
%Robin Simpson and Jamie Near, 2014.
%Kimberly Chan added separate Hamiltonian for J-coupling only, for use
%during shaped rf pulses (sim_shapedRF.m).
%Dana Goerzen added spin system coherence order matrix field for simulation
%coherence selection.
%Brenden Kadota refactored basis, HAB, HABJon... |
8c04715ed438a6c96385c8acc733ba8e90dbd2c5b4b3ca76b64001a8d6f18e3c | MATLAB | 3,817 | 111 | function randjson(jsonDir,templateJson,nVoxels,expNames,stimFiles,StimSize,temporalSampleRate,RF,tParam1,tParam2,noiselevel)
% create json files with spatiotmpoeral parameters being specified
if length(expNames) ~= length(stimFiles)
error("expName and stimFile length must match")
end
J = loadjson(templateJso... |
d728a05b65e08550aec751529aea6ad23f16c7330bb2144fb29f20603c109fe4 | MATLAB | 3,819 | 95 | %% Averaging Example
%
% <html>
% Import stream and epoc data into Matlab using TDTbin2mat <br>
% Plot the average waveform around the epoc event <br>
% Good for Evoked Potential detection
% </html>
%% Housekeeping
% Clear workspace and close existing figures. Add SDK directories to Matlab
% path.
close all... |
d453c99272fc09db2fbcfc96afc5fc14f170cafa356f4a2f00c192a6067d51b1 | MATLAB | 3,826 | 125 | function [out] = EEGfMRIPav_cbm_mod01_modSim(parameters, subj)
% Standard Q-learning model with delta learning rule.
% ----------------------------------------------------------------------- %
%% Retrieve parameters:
% 1) Feedback sensitivity:
nd_rho = parameters(1); % normally-distributed rho
rho = exp... |
35fc140164f5e70d2bc477e8b44bd8762b29c0835ee4faf9ee77027548b4c407 | MATLAB | 3,828 | 147 | function [anovaStats] = anovaEffectSize(data1,data2,testName,nUnits,isDep)
% Performs repeated measure 2-Way ANOVA assuming sphericity. Outputs all
% statistics in a cell array. Can be used to manually generate ANOVA
% information for compliance with journal manuscript requirements.
%
% Inputs: (must have same num... |
a010505e91729955a630711c49cbc5452844950ab62e5a02137a3791ec23b4d8 | MATLAB | 3,829 | 126 | function varargout = exclude_frames(self, badFrames, varargin)
%exclude_frames - Excludes the specified frame(s) from the image
%
% exclude_frames(OBJ) excludes the first frame.
%
% exclude_frames(OBJ, BADFRAMES) excludes BADFRAMES.
%
% exclude_frames(..., 'attribute', value) specifies one or more
% attribute/v... |
6ad7d7ca55e68582d48fdf15d1d72336bc85085456ad29dab6991aee15ffbc8a | MATLAB | 3,830 | 98 | function [hb,he]=barScatter(data, errors, bw_xtick, bScatter, bSED, bColor, xpos)
% [hb,he]=barScatter(data, errors, bw_xtick, bScatter)
%
% barScatter takes either an m-by-n matrix of data to be plotted
% errorbars can be custom specified, or are computed as the SEM across n
% bScatter (true/false) indexes whether sc... |
27c91a0b7161caceff1edf77feeef8d902d702abb6beba2fe67514a419bb5326 | MATLAB | 3,831 | 77 | function [tcArray, responseIndArray, rSquareArray, fitParams, varargout] = getTuningCurveArrayFromTable(StimTable)
%% Show some raw data.
% Get the non-parametric tuning struct to show the tuning curves. Here
% somehow some flies saw stimuli that had more or less bar positions, but
% those flies had no good cells ... |
744c3089e38dfd753f42862f4dac5bcfb19576f9fc0f61b375ae505affb6dbab | MATLAB | 3,844 | 84 | classdef (Abstract) ConfigDetectSigs < Config
%ConfigDetectSigs - Parameters for signal detection
%
% The ConfigDetectSigs class is an abstract superclass that implements
% (or requires implementation in its subclasses via abstract methods or
% properties) all basic functionality related to the configuration
% ... |
0ecb8559570a559af3ec4a492ffc1ab8a28f33ec66ee2b83f9a17342e44e8da5 | MATLAB | 3,846 | 118 |
clear
close all force
warning on
imSize = [733, 977];
%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 = find(~I);
nTrial = numel(NTrial);
UMuscimol = unique([dataTrl.iM... |
90460f1c9d2116c069f75d02e5c06d46d9917b23fb45382d7eba7b9226ea5559 | MATLAB | 3,848 | 112 | function simulateFullModel(baseModel, outFilename, fracN, fracA, TNM, TNG, TAM, TAG, mobUtilN, mobUtilA, TMT, addExtraATP)
% simulateFullModel
%
% Generates a combined model from the params supplied and runs a simulation.
% The fluxes of glycolysis, mitochondrial respiration, and both are then extracted
% for both neur... |
f21cda7a054057a618399b557d12606240cb09f46c36b13b9ea6e8632aa88bb2 | MATLAB | 3,848 | 95 | function [windows, time, yPos] = split_into_windows(self, windowTime, ...
nOverlap)
%split_into_windows - Split the raw image data into windows
%
% [WINDOWS, TT, YY] = split_into_windows(OBJ, T_WINDOW, N_OVERLAP) splits
% the raw image data into a matrix WINDOWS, and also returns the time
% value (TT) and ve... |
55276f91ea0d683be06331609c04f7fd28e6f4a3edd98bedec896e1624716356 | MATLAB | 3,849 | 99 | function cf = train_liblinear(param,X,clabel)
% Trains a linear support vector machine or logistic regression using
% LIBLINEAR. For installation details and further information see
% https://github.com/cjlin1/liblinear and
% https://www.csie.ntu.edu.tw/~cjlin/liblinear/
%
% Usage:
% cf = train_liblinear(param,X,clabe... |
8827d971a9931ca089bae918368f28c649e53e6606e447295e3e60aafb8e0e3c | MATLAB | 3,852 | 103 | %% Read Continuous Multi-Channel Data Directly Into Matlab
%
% <html>
% Use SynapseAPI to read multi-channel data buffer into Matlab array <br>
% Online process the data in Matlab <br>
% Requires the StreamMC user gizmo <br>
% </html>
%% Configuration
close all; clear all; clc;
GIZMO_NAME = 'StreamMC1';
HIS... |
fea9b547144f99bc20c5c9be950de848f234d572baec8ca627725b9014eb12de | MATLAB | 3,852 | 94 | classdef DataMeasureROIsDummy < DataMeasureROIs
%DataMeasureROIsDummy - Data from basic ROI measurements
%
% The DataMeasureROIsDummy class is a data class that is designed to
% contain all the basic data output from CalcMeasureROIs.
%
% DataMeasureROIsDummy public properties inherited from Data:
% mask ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.