sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
d0bbfa6302e9a1e77deaa07ee7fb67634ca5abe4b54f2b69b6643dde3618f9c7 | MATLAB | 2,385 | 63 | function probMat = create_PI_markov(lineextract,refimage,maxdx,maxdy,j)
%PI=create_PI_markov(lineextract,refimage,maxdx,maxdy,j)
%take a reference image (REFIMAGE), a line of data to fit (LINEEXTRACT),
%maximum offsets to consider MAXDX, MAXDY, and the expected location of
%that line in y (J) (expected location in x is... |
d3948522e5c157e28f0734b161d54f4291972661818ebf0afb73a567db366129 | MATLAB | 2,391 | 83 | load(fullfile(dataFolder,'EEG_data','data_time_information.mat'));
t0 = timeInfo.infusion_onset-timeInfo.object_drop;
load(fullfile(dataFolder,'EEG_data','electrode2_Cz.mat'),'psd','freq','time');
% Compute Baseline spectrum
for i = 1:14
preInfusion(:,i) = nanmedian(psd(:,and(time>=t0(i)-10,time<t0(i)),i),2);
... |
8d54c8490b3d251f2db8d511c5ce9d7037ed0beb309d7dd8bbfed5358c033525 | MATLAB | 2,392 | 68 | %io_writelcmraw.m
%Jamie Near, McGill University 2014.
%
% USAGE:
% RF=io_writelcmraw(data_struct,outfile,metab);
%
% DESCRIPTION:
% Take a simulated metabolite basis spectrum in matlab structure format, and
% output it into LCModel RAW format to be used in an LCModel basis spectrum.
%
% INPUTS:
% data_struct = si... |
3d03e41143542ecab7ff34836cd8d3fcc6ddb37ca2d8da8d2490f83cbc5bd388 | MATLAB | 2,393 | 65 | function t2n_plotRaster(varargin)
% This function plots the raster plot of one or multiple spike trains that
% were obtained from an APCount, created manually or generated e.g. with
% t2n_poissonSpikeGen.
%
% INPUTS
% spikeMat logical matrix with Ones where a spike occurs
% alternatively it can be... |
0e7afa0a3cd3a2974d192e9b61df4d35d8bc2545570435c0450581f17ab26302 | MATLAB | 2,394 | 64 | %% reshape the predicted ratings from the 10x10 CV
% predicted_ratings_reshaped = nan(nsub*5, 1);
% avg=mean(predicted_ratings,2);
% predicted_ratings_reshaped(sub44_label) = avg; %avg=mean(predicted_ratings,2)
% predicted_ratings_reshaped = reshape(predicted_ratings_reshaped, [5,nsub])';
%
Rating1 = predicted_r... |
6a42eb5978fb0946ee60ad6e0193b3e693ff052bb63d55211e5ace4e0d045db7 | MATLAB | 2,397 | 72 | function [self, pixelWidth] = calc_diameter_fwhm(self, diamProfile, ...
lineRate, t0, doInvert)
% 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
... |
cda4d1997d00dd587386380f7f0490f26760354e5c131bf6f21aea70c0a52404 | MATLAB | 2,397 | 82 | function varargout = rfv(val, varargin)
%rfv - Check that the value is a real, finite vector
%
% rfv(val) checks that val is a real, finite, vector. If it is, nothing
% else happens; if it is not, the function throws an exception from the
% calling function.
%
% rfv(val, 'VarName') includes VarName in the excep... |
ab4de6b881aa3271d51baad038521fab936bd090b40ef95cd7d002887cce6b54 | MATLAB | 2,398 | 82 | function [isStart, numWorkers] = start_parallel()
%start_parallel - start a parallel pool
%
% isStart = start_parallel() is a utility function that tries to start a
% parallel pool and returns a logical value specifying whether it
% succeeded.
%
% [isStart, numWorkers] = start_parallel() also returns the number... |
eccbbe1009aa5a1c8ba256fa09f9e313a009b6c3e811a72f64f482e1e29841ae | MATLAB | 2,402 | 61 | % reshapeDimensions.m
%
% Permute dimensions based on the input of dims. Non inputted diimensions are appeneded to the end
% INPUT
% in: MRSI strucutre
% dims: dimension array
% OUTPUT
% out: output MRSI structure with permuted dims
% prev: Previous permutation to use to permute back to original
function [MRSIStruct, p... |
ac60a56e693e629ecce8f77a630dcae99b6838671faaa5b32e082c5ed0246742 | MATLAB | 2,409 | 90 | function hgfFig = DisplayMapTimeCourse(TimeCourse, cfg)
%% DisplayMapTimeCourse.m
%
% hgfFig = DisplayMapTimeCourse(TimeCourse, cfg)
%
% Plots response maps time course and ouputs the figure handle.
%
% Input TimeCourse requires the following fields:
% (dCond): one field for each specified by cfg.dConds.
% ... |
464fc1577b44e84a3508074bdfa2530c23033f6d19a90655ab578d7f1586ae08 | MATLAB | 2,410 | 92 | % LO_TREE Level order of all nodes of a tree.
% (trees package)
%
% LO = LO_tree (intree, options)
% ------------------------------
%
% Returns the summed topological path distance of all child branches to the
% root. The function is called level order and is useful to classify rooted
% trees into isomorphic classe... |
f102852c7f810c17c300c558a7c9e4fb6354a269642fc06fd32af0afb7de2506 | MATLAB | 2,411 | 80 | function [out,im] = measurePointingAccuracy(obj,pointsToTest)
% Run through a series of points and measure beam pointing accuracy
%
% [out,im] = zapit.pointer.measurePointingAccuracy(pointsToTest)
%
% Purpose
% Run the beam rapidly over a set of points and report pointing accuracy
%
% In... |
3a6beaa7341174defb216a4792ec79b62ca2b94843bf902a09a3a1e0026432ba | MATLAB | 2,412 | 59 | %RunElectodesClassificationMatlabFunc
clear all
matlabImpute = true;
imputeIters=20;
NumTreesVec = [80];
substractMouseMean = true;
LeaveOutVec = {'mouse'};
usedMouseId = [];
excludeClassesFromTrain=[]
excludeClassesFromAnalysis=[]
useStdMatrix = false;
outFname='.\LFPResV2_Pairs9_1000Rand_temp.csv'
ave... |
7e0e02bc785aed6bbc7a24ca5434029a3d6e5a92d2d1397138fddb0d5439a010 | MATLAB | 2,412 | 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... |
b36c2145822ce9e5350c5ce0c1c8b9dbbe97690757b692254154f38c355416e2 | MATLAB | 2,415 | 68 | function [All, outVars] = getEnsembleOSI(All, outVars)
clear meanEnsOSI meanEnsOri cmeanEnsOri ensCurve ensCurveSEM ensOSI ensPO
skipGreyScreen = 1;
for ind = 1:numel(All)
clear meanOSI meanOri cmeanOri curve2save curveSEM curve ensPO ensOSI
for h = 1:numel(All(ind).out.exp.holoTargets)
% ht = ho... |
f35331f52b36bcd32267838c8a10c349b07b425ff041616abbbe3bcf4386ec02 | MATLAB | 2,415 | 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... |
221b96d4f5f6efbad38cfe57fad04405c3f49d75fe3407cbd1847bdd5df7ecad | MATLAB | 2,418 | 88 | clear all
% Define PB and FB angles
thetaRight = -[67.5 112.5 157.5 157.5 -157.5 -112.5 -112.5 ...
-67.5 -22.5 -22.5 22.5 67.5];
thetaLeft = -[-67.5 -22.5 22.5 22.5 67.5 112.5 112.5 ...
157.5 -157.5 -157.5 -112.5 -67.5];
thetaFB = -((0:30:330) + 15);
% Parameters from data fit... |
9484bcf18d3096481628ee2c77e64dc2283c6d5fe28084a25ea9ea19e1420b80 | MATLAB | 2,421 | 74 | function output = withinSE(input)
% output = withinSE(input)
%
% Compute SEs following Cousineau (2005) and Morey (2008) over subjects
% separately for conditions and any other dimensions; correct for number of
% conditions at the end.
%
% INPUT:
% input = matrix of n (>= 2) dimensions;
% first dimension assumed ... |
e89a04adf23231e354ca72c4c563de6b609c92e6839d0e75f34e4c6544c5b859 | MATLAB | 2,422 | 138 |
clear
close all force
warning on
load('a0_0_bhv2trialStrct.mat');
imSize = [733, 977];
load a7_2_createAvergedNOTMorphedHeatMapsLoad.mat
hmAll2 = hmAll;
NIm = [...
1
3
15
16
21
22
32
33
34
43
46
54
58
61
62];
%%
iMonkey = 1;
for iN = 1:62
figure(iN);
clf
im = imread(['../Images/Set02/',dataExp.s... |
2a823782aecb38afcfa5bc5a6d226ed5f18857db9bd968e68e3cd4b108b1e3c6 | MATLAB | 2,426 | 68 | function [DataMatrix, Labels,MouseIDs,Days, sessionNames, areaNames] = GetDataMatrixAllBouts(dataFileName)
DataMatrix = [];
Labels = [];
sessionNames={};
curFname = dataFileName;%'C:\David\Phd2020\ElectordesClassification\Data.xlsx';
[~,sheets] = xlsfinfo(curFname);
if length(sheets)>1
disp([num2str(leng... |
e821d2202c187480f7cde6c53644250b9e643735b5b01ee479c70868fb8b6dbf | MATLAB | 2,428 | 66 | %% power curve
clc;clear;close all;
%%
% This code plots power curve
% 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 permutation tests in one repetitio... |
7f31ff7a4ecadb06899ed0a9bd244bfbee4a7653949bf7f75c2cd125b4e85d1d | MATLAB | 2,430 | 66 | function varargout = integer(val, varargin)
%integer - Check that all elements are integer numbers
%
% integer(val) checks that all elements of val are integers. If they
% are, nothing else happens; if they are not, the function throws an
% exception from the calling function. Integers stored in non integer
% ... |
4a382e7c71088a18ecb1531f85694622fd9f1eb6406c929fc3396d1824a1fd6e | MATLAB | 2,433 | 73 | function [f, peak_p, plateau_p] = calculate_metrics(t, x, t_range)
%%% calculate_metrics.m
%%% Omkar N. Athavale, May 2023
%%% Calculate the peak, plateau, and frequency metrics for a given signal
%%% Can be tension, Vm_ICC, or Vm_SMC
%%% INPUTS
%%% t: n x 1 array of n time steps in ms
%%% x: n x 1 array of quantity at... |
ab742d3960f05cad54c7cf34a71f53428533d2500bbff694dc4214fc972d29b5 | MATLAB | 2,433 | 66 | %% Preprocessing
clear all; close all; clc;
opts = delimitedTextImportOptions("NumVariables", 14);
% Specify range and delimiter
opts.DataLines = [2, Inf];
opts.Delimiter = ",";
% Specify column names and types
opts.VariableNames = ["Var1", "VarName2", "VarName3", "VarName4", "VarName5", "VarName6", "VarName7", "VarN... |
c332ecaa3852f4efe5421175e210ee2b504ee252df8db92cacf8d80604699ae6 | MATLAB | 2,433 | 70 | %% power curve
clc;clear;close all;
%%
% effect size
Cohensf2 = 0.15;
% 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 t... |
50f584dc05f1918e0973a4ed87d117eb61af91bf90b1683c29854e396e8a4c00 | MATLAB | 2,436 | 72 | function outStruct = extractAllParamsFromTable(StimTableCell, varargin)
switch nargin
case 1
threshold = 0;
rSquareThreshold = -20;
alignToOff = false;
alignToAll = false;
case 2
threshold = varargin{1};
rSquareThreshold = -20;
alignToOff =... |
52f42e8a05b479cee089fd3560f8764f7d7b97ae051c5efc074ed474fc1ac930 | MATLAB | 2,436 | 68 | function [DataMatrix, Labels,MouseIDs,Days, sessionNames] = GetOriginalDataMatrix(dataFileName)
DataMatrix = [];
Labels = [];
sessionNames={};
curFname = dataFileName;%'C:\David\Phd2020\ElectordesClassification\Data.xlsx';
[~,sheets] = xlsfinfo(curFname);
if length(sheets)>1
disp([num2str(length(sheets))... |
c348a7b0073343249abea7e78c4480eea15aaeeb45328dac8be24b72a76e1973 | MATLAB | 2,436 | 62 | classdef Test_DataDiameterFWHM < matlab.unittest.TestCase
%TEST_DATADIAMETERFWHM Summary of this class goes here
% Detailed explanation goes here
% ================================================================== %
properties (Constant)
time = [0 1 2]';
diamProfile = Test_D... |
f8720afc4a0325646e3b9cb51ec9bad118218bf3bd970161d5dd5821c3dbafb7 | MATLAB | 2,436 | 74 | function varargout = runAffineTransform(obj, targetBeamLocation, actualBeamLocation, diagnosticPlots)
% Run an affine transformation to calibrate scanners to camera
%
% zapit.pointer.runAffineTransform(targetBeamLocation, actualBeamLocation, diagnosticPlots)
%
% Purpose
% Runs an affine transfor... |
37306b5dbd72452d455abf5095ce55ef2a189cb6183efb6d3d9e5dc54ab39172 | MATLAB | 2,439 | 72 | loadParameters;
load(fullfile(params.punctaSubvolumeDir,'transcriptsv9_punctameannormed.mat'));
load(fullfile(params.rajlabDirectory,'transcripts_probfiltered.mat'));
% load(fullfile(params.punctaSubvolumeDir,'puncta_rois.mat'));
channel_mapping = [0,1,3,2];
%What round of sequencing is N-1P?
ALIGNMENT_START_IDX = 4... |
84b9789fa3e7aa56b91661e654b1b78dbdb155f24524ce2d0244f2394f70df83 | MATLAB | 2,443 | 81 | function[simsig simsigmod snr] = proc7(sigy1_freq, sigy2_freq, Fs, numsec, noise_ratio, amp_ratio, phshift)
%function[simsig simsigmod snr] = proc7(sigy1_freq, sigy2_freq, Fs, numsec, noise_ratio, amp_ratio, phshift)
%
%This function creates 2 signals, one (simsig) which contains a PAC wave plus the
%lower modulating f... |
3f8029501cddd5faf6d280b95e2b9185f0aacef574fb62d43a5ad31b6d941be4 | MATLAB | 2,444 | 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... |
8bb69f9965ca040cbab181a50eaa5c10b83d19a4535b1330ce9790bf03f7513f | MATLAB | 2,444 | 57 | %%==========================================================================
% This is the function part of codes for the neural utility model in Gao et al., 2021, The hidden cost of receiving favors: A theory of indebtedness
% This script should be used in combination with the main file:
% Neural_utility_model_main.m
... |
f99799d9521d47609b880ff8e49a81eb08168ee883b5cc6f91d9409e92c00dd8 | MATLAB | 2,444 | 68 | function MatData2Kwd(data,Output,Name,Fs,varargin)
%MatData2Kwd Function to convert matlab data to kwd. (Open Ephys GUI
% compatible file). Variable data must be a ch x samples matrix. For LFP
% signal models, generated in matlab and fluctuating from -1 to 1, we
% recommend a multiplication of 1000 for better visu... |
e61bc50365f8cb5e9d8ca0801a77323130fb5bfcb8929980512901592e8f474a | MATLAB | 2,447 | 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... |
6178722ee454a6ac1080f71502e301f9503d151d0d5d93496dac6e16d176ac2b | MATLAB | 2,452 | 129 | (* ::Package:: *)
(* ::Text:: *)
(*This Mathematica code is used to generate the "isoclass" lookup tables in the source file isoclasses.c. It is meant to be opened with the Mathematica front end and used as a notebook. However, it is written in plain-text "package" format in order to work well with version control, an... |
20469f1ea8fc4f7d35e4fdaaebda35cfdf5bc21e38b744f9da339210dd0dd548 | MATLAB | 2,453 | 82 | function [spec maxfreq specpeak f] = freq_spec(sig, Fs, plt, x_max)
% function [spec maxfreq specpeak] = freq_spec(sig, Fs, plt, x_max)
%
% This function plots the frequency spectrum (aka power spectrum)of a
% signal and returns the frequency with the largest power as 'maxfreq'
%
% INPUTS:
% sig - signal to b... |
32e15911651ac68c148336dd5855ae5bf63561dc1d0cd933fabd2cf297d99901 | MATLAB | 2,460 | 83 | % This script reads in the spiking data, processes, and fits tuning
% curves The fits used for the paper are stored with
% results[area]_final.mat, if it's re-run the outputs will be results[area].mat
% - areas: flag which cell population sample we want to fit
clear all; close all;
% you can select one or more... |
4647fef5d0813441cfc5ec4914b3cc869634091dce14d5d8c7c77533ec92d16a | MATLAB | 2,460 | 78 | function CalObj = load(varargin)
%load - Load a CalibrationPixelSize object
%
% CalibrationPixelSize.load() prompts to select a .mat file (which
% should have been produced by the CalibrationPixelSize.save method) and
% loads the CalibrationPixelSize object.
%
% CalibrationPixelSize.load(FILENAME) loads the giv... |
a24618795d1191b5d9b1b99bb9c2ce7d96cc80231bb9d3b4acc225b1ce2ca94f | MATLAB | 2,463 | 91 | % DIRECTION_TREE Direction vectors of all nodes from parents.
% (trees package)
%
% direction = direction_tree (intree, options)
% --------------------------------------------
%
% Returns the vectors between .
%
% Input
% -----
% - intree ::integer: index of tree in trees or structured tree
% alternatively,... |
4064c57bf25285dec2bc844aa044302e975c45ee2a6259409b906a3c2556e642 | MATLAB | 2,464 | 76 | function SavePar1(Par)
% SavePar1 saves a structure with these elements to the specified .par.n file :
%
% .FileName -> name of file
% .nChannels -> number of total channels in the whole file
% .nSelectedChannels -> number of channels for this electrode group
% .SampleTime -> time, in micros... |
4bc1e204cd91d8bfe921c7cc700aff0a38ea4c06552226c88ed461458f2c0a3a | MATLAB | 2,465 | 95 | function sff = sff_strk2traj(sff)
%SFF_STRK2TRAJ links streaks into trajectories
%
% Raphael Sarfati, 05/2022
sff.trj = strk2traj(sff.stk,sff.prm);
sff.xyztkj = sff.trj.j(:,[1 2 3 4 5 6]);
sff.xyztkj(:,4) = sff.xyztkj(:,4)./sff.prm.mov.frameRate; %time in seconds
end
%% engine
function traj = ... |
e4dd5cb7a8fcb8ddde79c25d419bbd63387f573394bf17c641052787a81c8788 | MATLAB | 2,468 | 91 | % GIFMAKER Simple movie on transparent background.
% (scheme package)
%
% gifmaker (action, name, Tsize, delaytime)
% -----------------------------------------
%
% Creates a transparent movie. Put this function in strategic places in
% your code to append frames one by one to a movie with transparent
% background (w... |
d89b0f2c948626bfdc5ed931011460aaf54e405944506316a1254f1532ece4bf | MATLAB | 2,470 | 81 | function sftpfrommatlab(userName,hostName,password,localfilename,remotefilename)
%sftpfrommatlab connects Matlab to a remote computer and uploads
%a file using the SFTP protocol
%
% STATUS = SFTPROMMATLAB(USERNAME,HOSTNAME,PASSWORD,LOCALFILENAME,REMOTEFILENAME)
%
% Inputs:
% USERNAME is the user name required for t... |
3b35a9757f84903504590e3fa5108e4017f0ee0c79325713e3e5ae06470ea23e | MATLAB | 2,471 | 82 | function flag = replace_in_file(fnIn, fnOut, strIn, strOut)
%replace_in_file - Replace text in a file with new text
%
% replace_in_file(FN_IN, FN_OUT, STR_IN, STR_OUT) replaces all instances
% of the string STR_IN in a file FN_IN with the new string STR_OUT, and
% writes the resulting output to a file FN_OUT. FN_... |
8bd0465d75694e8171e137373de67e056589cc2d0aaa7124e77756834a2b50d3 | MATLAB | 2,475 | 73 | function varargout = plot(self, objPI, varargin)
%plot - Plot a figure
%
% plot(OBJ, OBJ_PI) plots the default figure for the CalcDiameterXSect
% object OBJ using the ProcessedImg object OBJ_PI.
%
% plot(OBJ, OBJ_PI, AX, FIG_NAME) plots the figure on the specified axes
% handles AX, and the particular figure sp... |
222a6917684c00abae7431f165c46568bfce1982899466f02a6a2af73991c9ec | MATLAB | 2,476 | 74 | clear
clc
yvar = 'age'; %leave this alone
testStr = []; %'DIAN'; % change if you want to look at a specific study (i.e. ADNI)
mut = []; %change this if you only want to look at mutation=1 or 0
% load chosen model and training results
load nn_search5.mat
% load test data
load TestInfo_extra_new.mat
% get the data o... |
6b9da33970203dc58f40f6708342e5aef71779dcad8e2f6b2067f1ce657333b0 | MATLAB | 2,482 | 116 | %% visAll.m
clear all; close all; clc
good = 1;
bad = 2;
folders = cell(1,2);
folders{good} = {'210206','210208','210209','210413'};
folders{bad} = {'210207','210519-1','210519-2'};
dPrime = cell(1,2);
nTrial = cell(1,2);
for i = good:bad
for f = 1:length(folders{i})
load([folder... |
1f1cc5428b65f8b3cf743462289bf40a94aa8a41c4a267d8bfeae0815a701d1b | MATLAB | 2,484 | 91 | % QUADFIT_TREE Fit quadratic diameter taper to tree.
% (trees package)
%
% [P0, tree] = quadfit_tree (intree, options)
% -------------------------------------------
%
% To a given tree with diameter values fits a quadratic tapering according
% to "quaddiameter_tree". The output is a scaling and an offset value in P0... |
51f9f53488cd3bc40af6ecb32a2b7e754c706cb68ecd460f468ea2cbef143445 | MATLAB | 2,485 | 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... |
09ff11a6b1dd08131772776c341fc576047a1139b05ed59c4b22919d53f0e9fe | MATLAB | 2,488 | 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... |
58396af5e8bdd3c54c52e0f30b3c6cbaa87f339643f9a884740568b0c363818e | MATLAB | 2,491 | 66 | %decc_plotFigS3
% Related to Viswanathan, Stein, Nieder, PLOS Biol, 2024
% PV 2024
load('DECCdataFigS3.mat')
% Figure parameters
lcolor = zeros(3,3,2);
lcolor(:,:,1) = [0.0 0.2 0.3; 0.0 0.4 0.5; 0.0 0.6 0.7];
lcolor(:,:,2) = [0.4 0.1 0.0; 0.6 0.3 0.0; 0.8 0.5 0.0];
dotcolor = [ 0.2 0.2 0.2; 0.0 0.4 0.5; 0.6 0.3 0.0; ... |
01d951a3861e38335ae5b3f4e5cbb07f96965b5dd7c63fd7424d9d2e4f93a6e8 | MATLAB | 2,492 | 82 | % [ tree ] = dscam_tree( tree, iteration, options )
% mutate tree
%
% Input
% ----
% - tree ::tree: input tree
% - iterations ::number: N iterations
% Output
% ------
% - tree ::struct:: tree
%
function [ intree ] = dscam_tree( intree, iteration, options )
% default num iterations
if (narg... |
615e5d4336a4b023baefacc2774d799d6461156e24e2426b26d58bd7d0657a7b | MATLAB | 2,492 | 70 | function varargout = has_prop(objIn, propName, varargin)
%has_field - Check that the value is a property of an object
%
% has_prop(obj, 'PropName') checks that the object obj contains the field
% PropName. If it does, nothing else happens; if it does not, the
% function throws an exception from the calling functi... |
49e908b6ddfca8ebc62c9955dc1d3aa808c200ef161c6bcba683b7ad0d1d485b | MATLAB | 2,494 | 130 |
clear
close all force
warning on
load('a0_0_bhv2trialStrct.mat');
imSize = [733, 977];
load a7_2_createAvergedNOTMorphedHeatMapsLoad.mat
hmAll2 = hmAll;
NIm = [...
1
3
15
16
21
22
32
33
34
43
46
54
58
61
62];
%%
iMonkey = 1;
for iN = 1:62
clf
im = imread(['../Images/Set02/',dataExp.sImage{iN}]);
... |
a790d63a2930a83030d661cda33c6bedb1ec44d6eebe99cfbec9b4ebcd8bb407 | MATLAB | 2,496 | 75 | function varargout = combine_masks(self, varargin)
%combine_masks - Combine and replace masks in a CellScan array
%
% combine_masks(OBJ) combines masks from the CellScan object array OBJ
% and updates the calcFindROIs property to a new CalcFindROIsDummy object
% that contains the combined mask.
%
% combine_mas... |
a802ff5b2bd50c0c175e0358ca837e978770a889e805c6db78a0c51585d380b7 | MATLAB | 2,497 | 86 | loadExperimentParams;
% LOAD IMG VOLUME
filename = fullfile(params.INPUTDIR,sprintf('%sround%d_%s.tif',...
params.SAMPLE_NAME,params.MOVING_RUN,params.REGISTERCHANNEL));
img = load3DTif(filename);
% LOAD KEYS
output_keys_filename = fullfile(params.OUTPUTDIR,sprintf('globalkeys_%sround%d.mat',params.SAMPLE_NAME,... |
42e3bc1802918c7583d8592b6759c6e7ea4ee21a2286b10cbb99a9855f356f5c | MATLAB | 2,498 | 83 | % op_fourStepCombine.m
% Jamie Near, McGill University 2014.
%
% USAGE:
% out=op_fourStepCombine(in,mode);
%
% DESCRIPTION:
% Combine dimensions in datasets with 4 subspectra to produce
% a new dataset with only 2 subspecs. Common applications of this function
% are to combine the ISIS sub-spectra of the MEGA-SPECI... |
c7ceab0edd6d3e4a10b1e2efa04b1400310812ffe8283396a28efac7cba8f1d7 | MATLAB | 2,500 | 93 | function [out] = EEGfMRIPav_cbm_mod03_osap(parameters, subj)
% Standard Q-learning model with delta learning rule and Go bias and
% Pavlovian response bias.
% ----------------------------------------------------------------------- %
%% Retrieve parameters:
% 1) Feedback sensitivity:
nd_rho = parameters(1); % no... |
de4616043fa4515584ecfe85e0eb714df2ee1a0eb5cebe62fea18e86489445ea | MATLAB | 2,501 | 120 | % Fiber photometry data processing
%
% If you want to use this code, please cite our Jove paper:
% Martianova, E., Aronson, S., Proulx, C.D. Multi-Fiber Photometry to
% Record Neural Activity in Freely Moving Animal. J. Vis. Exp.
% (152), e60278, doi:10.3791/60278 (2019).
% Run section by section (Ctrl+Enter... |
e00074e7d41e12632070a0a44134325db9205e8be4484555b12fe70b6d552dc3 | MATLAB | 2,502 | 67 | %% 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... |
ee2805049dcb5fd257119668039e896f26a418c04e02f9632780e8cd1782df28 | MATLAB | 2,502 | 60 | function self = set_sizes(self, imgSize)
%set_sizes - Protected class method to set the image size properties
% 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 pub... |
e737c30ab1ce678c1a6afe18f7d9aa2556c38e1d78f4943f662f0cdd04ce1c10 | MATLAB | 2,509 | 93 | % IMLOAD_STACK load image into a 3D matrix.
% (trees package)
%
% [stack name path] = imload_stack (name, options)
% ------------------------------------------------
%
% Loads image from file.
%
% the stack structure as in "save_stack":
% stack has to be in the following form:
% stack.M ::cell-array of 3D-matrice... |
b655181fed087c9464554f4e76ea2b74a1d04cdb69f913e74f922feb23274d0c | MATLAB | 2,512 | 69 | %% 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... |
3bed9d952cedf0244f9f7ca9dff03423566de5cf5fd705191f3fcebbd86bfa6d | MATLAB | 2,515 | 82 | function windowCloseFunction
% Example - run user-defined function when the figure window is closed
%
% function windowCloseFunction
%
% Purpose
% Demo showing how to run a defined sub-function when the figure window is closed.
% This is basic object-oriented programming, since you are inter... |
310ab21a89d863f25c656d6c80d8c685423230aca98c04162711091149849cd2 | MATLAB | 2,516 | 78 |
function [net,y] = tryNN(Data0,y0,hiddenLayerSize,showPlot)
%setdemorandstream(491218382);
% Choose a Training Function
% For a list of all training functions type: help nntrain
% 'trainlm' is usually fastest.
% 'trainbr' takes longer but may be better for challenging problems.
% 'trains... |
ee71945846f5fc5231aa19a4856e75aa727222fbbcbf07d1a44f49f67089462c | MATLAB | 2,519 | 57 |
load('figure_9_data.mat');
% Plot corticothalamic information transfer as a function of
% normalized k-statistic (i.e. chaoticity estimates)
x = human_anesthesia_k ./ human_wake_k;
y = human_anesthesia_cort_to_thal ./ human_wake_cort_to_thal;
y2 = sign(y) .* (log(1 + abs(y) / (10^-2)));
figure('Position', [100 -100 6... |
f2a3b05ee511e59c650380d5437a24606be85931c9067bef7fbe19530402a216 | MATLAB | 2,519 | 68 | %op_CSIIntegrate.m
%Brenden Kadota, Sunnybrook 2021.
%
% USAGE:
% in=op_CSIintegrate(in);
%
% DESCRIPTION:
% Integrates the spectrum from ppmmin to ppmmax in all csi voxels.
%
% INPUTS:
% in = CSI FID-A data structure
% pmmmin = lower integration bounds
% ppmmax = upper integration bounds
% mode = mod... |
3f3b2ba519a561231855aa6208650af54f117fde3b3ffa25f86c267c5097b74f | MATLAB | 2,521 | 119 | %% This script plot histology bar graphs
% goodF condition
clear;clc;
load('raw_data.mat')
x = 1;
y1 = [goodF.Reelin,goodF.Cal,goodF.Gad];
if sum(y1)<1
goodF.Unknown = 1-sum(y1);
y = [goodF.Reelin,goodF.Cal,goodF.Gad,goodF.Unknown];
else
y = [goodF.Reelin,goodF.Cal,goodF.Gad];
end
b1 = bar(x,y... |
7e924bd6d25ca580a6781c4528f0597f88cc91e2b7138d5ffb3c69f17e39b80d | MATLAB | 2,525 | 76 | function varargout = plot(self, varargin)
%plot - Plot a figure
%
% plot(OBJ) plots the default figure for each element of OBJ.
%
% plot(OBJ, H_FIG, FIG_NAME) plots the figure on the specified figure
% handle(s) H_FIG, and the particular figure specified by FIG_NAME.
% FIG_NAME must be one of the following:
%
%... |
804c612a74c9989b7f4fd480515dfc44dd2f72aef9abd581afd649d40a720b56 | MATLAB | 2,525 | 70 | function varargout = has_field(structIn, fieldName, varargin)
%has_field - Check that the value is a field in a structure
%
% has_field(struct, 'FieldName') checks that the structure struct
% contains the field FieldName. If it does, nothing else happens; if it
% does not, the function throws an exception from th... |
cbc8fd285956bc85cd96f02e3748f90ef16085cd19e392b514086da9b79109bd | MATLAB | 2,525 | 101 | function hout=suptitle(str)
%SUPTITLE puts a title above all subplots.
%
% SUPTITLE('text') adds text to the top of the figure
% above all subplots (a "super title"). Use this function
% after all subplot commands.
%
% SUPTITLE is a helper function for yeastdemo.
% Copyright 2003-2010 The MathWorks, Inc.
... |
5aebfbc93e7b75527f7e490c40bc208f46dc2d4dc629919c855490230d4b4a41 | MATLAB | 2,530 | 74 | function [subj] = sim_subj()
% sim_subj()
%
% Initialize data for one "standard" subject for model simulations.
%
% INPUTS:
% none.
%
% OUTPUTS:
% subj = structure with the following fields:
% .stimuli = vector of integers, stimuli seen (1-16).
% .reqactions = vector of integers, required action given... |
280dec1669b691a2574baf36800742cfb6963724c271a30a4769b3a3abc85e01 | MATLAB | 2,531 | 89 | % this code will go throght the trials one by one and create a *.mat file
% for each and save the gaze.
clear
close all force
xSize = 28;
ySize = 21;
imgMargin = 1;
hWB = waitbar(0,'checking the trials ...');
%load tirals info
load('a0_0_bhv2trialStrct.mat');
I = arrayfun(@(x) isfield(x.analyze,mfilename), data... |
9c9dd7aa61519ede78bc445e6e24f5d7db0be16406174321b243aa8666c0e086 | MATLAB | 2,533 | 38 | function stimSetCellStr = getStimSetCellStr(stimSetInd)
% Generate all stimulus names used in a particular experiment.
switch stimSetInd
case 1 % (old)ONOFF+Bars
stimSetCellStr = ...
{'LocalCircle_ONOFF_2s_BG_4s_120deg_0degAz_0degEl_100_Con_0.5Lum_NonRand.txt', ...
'StandingStripe_1s_... |
b5dea79874a72614d23b970cce65728cf81f4b8b55d908bd6a6d368e350def82 | MATLAB | 2,533 | 77 | function [cubeFormData,labels] = riemannEpochs(eegData,h)
N=size(h.EVENT.TYP,1); % total no. of samples to train with
sampling=h.EVENT.SampleRate;
data_matrix=eegData;
position=h.EVENT.POS; % onset of the event
duration=h.EVENT.DUR;
type=h.EVENT.TYP;% time points for which events occured
... |
42f2b2b5934cd7b924d7ad26cb61e38a85a0bb7e7252671512fcaca734253dd9 | MATLAB | 2,535 | 57 | function rawImg = from_files(varargin)
%from_files - Create a RawImg object from a list of files
%
% OBJ = RawImg.from_files() prompts for all required information and
% creates a concrete RawImg subclass object.
%
% OBJ = RawImg.from_files(RAWIMGTYPE) creates an object of the class
% specified by RAWIMGTYPE. R... |
abb6decd8d2f32d2232558af98099ab907581a9ecaf3600bea6af8c7226480f5 | MATLAB | 2,539 | 77 | % the pattern separation toolbox: analyse spike train ensembles
% Copyright (C) 2022 Alexander D Bird
function [binned_spikes]=bin_outputs_delay(output,output_code,binsize_ms,delay,max_time,wordsize)
n_trial=size(output,1);
n_rep=size(output,2);
if nargin<4 || isempty(max_time)
max_time=0;
for ward=1:... |
def5981389e603b3ace7439708e070bf1598822931f2e64a5525c6866b40e1b3 | MATLAB | 2,539 | 81 | load(fullfile(dataFolder,'simulations','tau_sensitivity_spectra.mat'));
k = 6;
k0 = 50;
% Average together simulations with similar tau values and fit with Eq. 1
idcs2 = interp1(linspace(0,1,k),1:k,pars_unitsquare(3,:),'nearest','extrap');
p_tauE = splitapply(@(x) mean(x,2),psd,idcs2);
tau1 = zeros(k0,k);
tauE = zero... |
b8e1731851ff3d0771360482a23a8f5ee607915d477efc7221f0415b68a01c65 | MATLAB | 2,542 | 81 | function y = tapas_physio_read_physlogfiles_philips_matrix(fileNamePhyslog)
% reads out complete numerical matrix from SCANPHYSLOG-file
% Physlog file version 1: [nSamples,10]
% Physlog file version 2: [nSamples,11]
%
% IN
% fileNamePhyslog
% string, filename of SCANPHYSLOG-file
% OUT
% y [nSamples... |
2a69d46d4248bb7abfe641b3902f4e6da5fef1d3741e008adec252e9cbd17dbe | MATLAB | 2,546 | 73 | function [subInds] = subsampleCells(V1,V2,MT)
% Take full sample of V1/V2/MT cells and resample them so we're only
% looking at those well-described by Gabor tuning, those with RF centers
% within 10deg of fixation, and roughly all in the same visual field
% regions
%% Only keep neurons with R2 > 0.75
r2Inds.V1 = V1.... |
bdf615355a2d69901536020e0f218f03996ec0ac1fa173e6ed4cccfc1ba902f1 | MATLAB | 2,550 | 70 | %% power curve
clc;clear;close all;
%%
% This code plots power curve
% 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 permutation tests in one repetitio... |
c2c32a5d7180aff8a366b90ca72e244be49fbfff1aa2cbe8af2df66ae6dd1150 | MATLAB | 2,550 | 59 | %%==========================================================================
% This is the function part of codes for the reciprocity model proposed by Gao et al., 2021, The hidden cost of receiving favors: A theory of indebtedness
% This script should be used in combination with the main file:
% Reciprocity_model_main... |
6db9eca82f35bec3aaec033709ae8c42db8aa60cbf1f2f60204cb202200b6732 | MATLAB | 2,555 | 64 | % createVoxels.m
% creates an array of voxels based on MRSI data structure and maps back to the
% index of the data in that structure.
function vox = buildArrayOfVoxels(MRSIStruct)
% get index sizes
spatialSizes = getSizeFromDimensions(MRSIStruct, {'y', 'x', 'z'});
numberOfCoronalPoints = spatialSizes(1);
... |
eae31a73a8263f55d97f7276f101f97935d00889a12e86ad09584fff25ad302e | MATLAB | 2,561 | 80 | function [windows, ctrLines] = split_into_windows(imgLong, ...
nOverlap, windowLines)
%split_into_windows - Split an image into analysis windows
%
% 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... |
9149fc27fa53a44f9c202a44d384cd803e4bdeeb6217b12afdd6ed838cff4b0d | MATLAB | 2,562 | 71 | function drawnPixels = LK_DrawConnPixelsFromArea_20230304(A, n)
%
% LK_DrawConnPixelsFromArea_20230304 draws n connected pixels from within
% the area of ones of the 2D matrix A.
%
% It can be used to create surrogate place fields, for example.
%
% Use as: drawnPixels = LK_DrawConnPixelsFromArea_20230304(A, n)
%
% Inpu... |
0878b781bc664b6fea839ca4fbf261e253001b82144e030c2b23e785f18b334c | MATLAB | 2,566 | 58 | function buildListeners(obj)
% Build listeners
%
% zapit.gui.main.controller.buildListeners
%
% Purpose
% The listeners coordinate things like updating the displayed image from the camera,
% and updating the list of recently loaded files.
%
% Inputs
% none
%
% Outputs
... |
5383ac353339f86dd68ae5a1bc3c02bbcb9994aabc3da61a5c66e342457b3940 | MATLAB | 2,566 | 78 | function view = stCreateGrid(view,params)
% stGridFit - fit spatiotemporal retinotopic model along grid (coarse stage)
%
% the structure of the code follows rmGridFit
% 2020/12 Insub Kim:
if notDefined('view'), error('Need view struct'); end
if notDefined('params'), error('Need params'); end
%---------------------... |
82f497692556d92b359c535d5a95da05f0769061de5c2c6e9e591e79aa5239a4 | MATLAB | 2,567 | 64 | % Compute alpha regressor from EEG source activity
%
% USAGE:
% alpha_reg = compute_alpha_regressor(source_activity, regionsMap, HRF_resEEG)
%
% INPUTS:
% source_activity - [68 x 259184] matrix containing EEG source activity for
% 68 regions and 259184 time points (200 Hz sampling rate)
% ... |
85ddb81e071d2fff3bb0347f61ff1379af32be586dee961ff3ab806be1414d62 | MATLAB | 2,567 | 86 | function varargout = val_util(action, varargin)
% Helpers for the validation scripts
% FORMAT p = val_util('extract', name1, name2, ...)
% hdr = val_util('header', title)
% val_util('result', name, passed, detail)
% ok = val_util('summary')
%
% 'extract' pulls the named subfunctions out of tf... |
8df276ccae9c36633ee59c3895f709656a3c616ad9fcdb463295b98513081ce9 | MATLAB | 2,569 | 57 | %% Constants
% Paths
global SOFTWARE_PATH DATA_PATH;
% Here, define the path to the SampleData and Scripts folders on your computer:
SOFTWARE_PATH = 'D:\GitRepositories\island\Scripts\InternalStructureHeadDirection\';
DATA_PATH='D:\GitRepositories\island\SampleData\HeadDirectionData';
addpath([SOFTWARE_PATH 'custom_sc... |
ef2b4998128d6c5520086e26268315464e8556936c54c295657c2150a53ec99d | MATLAB | 2,569 | 51 | function P_value = permutation_test_ttest_NBS(ctrl_mtx, case_mtx, CID, M, threshold_GT)
% Conducts a permutation test using the t-test to assess the statistical significance
% of a test statistic derived from control and case matrices compared to a permuted dataset.
% Inputs:
% ctrl_mtx - M... |
76d76e5717abc87727e46edbfab6b91666f7784d73722268dc8840c7d494e0fc | MATLAB | 2,570 | 98 | % VOL_TREE Volume values for all segments in a tree.
% (trees package)
%
% vol = vol_tree (intree, options)
% --------------------------------
%
% Returns the volume of all tree segments (in um3).
%
% Input
% -----
% - intree ::integer: index of tree in trees or structured tree
% - options ::string:
% '-s' ... |
14a5adc81efe1912f6be7581a66b8f2a00a3b091009b02f6d243c28145d746ff | MATLAB | 2,571 | 73 | function mask = choose_mask_channels(self, imgType, varargin)
%choose_mask_channels - Protected class method to choose an individual mask
% based on the image channels
% Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al.
%
% This program is free software: you can redistribute it and/or modify
% ... |
22fb16d0e7e3cc12bbd268353d4a9f125562d6245af2ccf62ef3d5321db99a3a | MATLAB | 2,571 | 61 | function [f, g] = LK_PlotRippleExample_20231030(dt)
%
% LK_PlotRippleExample_20231030 plots the ERP and the power spectrogram of
% an example ripple.
%
% The input is a structure with multiple fields
%
% The output are two figure handles.
%
% Lukas Kunz, 2023
%% ERP
% create figure
f = figure('units', 'centimeters', ... |
7bda9a3c9696d2a6ad67f04d38c2664e3c006a989227a445581defc31677c789 | MATLAB | 2,571 | 89 | % fix_preprocess_dimensions unit test
%
rng(42)
tol = 10e-10;
% Random data
N = 100;
X = randn(N,40);
clabel = randi(2, N, 1);
cfg = [];
cfg.preprocess = {};
cfg.preprocess_param = {};
oversample_param = mv_get_preprocess_param('oversample');
undersample_param = mv_get_preprocess_param('undersample');
zscore_param ... |
09ff2066283a88349700f45275f997c708705927143f91c9176e0c510f926b9b | MATLAB | 2,573 | 79 | function [MapOrt,AmpOrt,TCPROrt,TCPROrtAmp] = CalculateMapTCPROrt(MapResp,Ort,Mask)
%% function [MapOrt,AmpOrt,TCPROrt,TCPROrtAmp] = CalculateMapTCPROrt(MapResp,Ort,Mask)
% Calculate orientation map with a vector summation
%
% Combine CalculateMapOrt.m and CalculateTCPROrt.m
%
% MapResp must be 3D---[Y,X,Ort]
% Ort is... |
256b5f59bf317d568e083538f7403ad97561fef51c01d909f31d67aeed85656a | MATLAB | 2,573 | 79 | classdef Test_Config < matlab.unittest.TestCase
%TEST_CONFIG Summary of this class goes here
% Detailed explanation goes here
% ================================================================== %
properties (Constant)
ConfigDef = Mock_Config();
inputVals = {'value2', 2};
... |
6b6b330b0d49813c49adc4872e96678aeed9e06394819ec4ed9ae4bd3bbb1086 | MATLAB | 2,573 | 117 | %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... |
f808475363bfcc1f4d15e8a4a234695eacedd95fd32d28fd4dc14f8db039a8b7 | MATLAB | 2,573 | 59 | function SubTypeClusteringPerType_Array=SubClusteringPerSegment(NumOfStates,activity_per_segment_Array,segmet_start_time_Array,segmet_end_time_Array,ManualClustering2_flug)
SubTypeClusteringPerType_Array={};
for run_type=1:NumOfStates
run_type
activity_at_long_segments_of_chosen_cluster=activity_per_segment_Ar... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.