sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
a46512ee47b4894beff3bee6448b9792c9ddca89e6d5cc03824934380c49e88e | MATLAB | 2,049 | 53 | function str = fixname(str)
% FIXNAME changes all inappropriate characters in a sting into '_'
% such that it can be used as a filename or as a structure field name. If
% the string begins with a numeric digit, an 'x' is prepended.
%
% Use as
% str = fixname(str)
%
%
% MATLAB 2014a introduces the matlab.lang.makeVal... |
bba431bcf73225b88e869f44c52aa560a71670fb885118e8c24fcd58462f2915 | MATLAB | 2,049 | 53 | function str = fixname(str)
% FIXNAME changes all inappropriate characters in a sting into '_'
% such that it can be used as a filename or as a structure field name. If
% the string begins with a numeric digit, an 'x' is prepended.
%
% Use as
% str = fixname(str)
%
%
% MATLAB 2014a introduces the matlab.lang.makeVal... |
0d4d5fd1871ff8c6c6bafb2649c4e5443e42bb29e3b401be3f8acbf170f8dc1c | MATLAB | 2,050 | 60 | % mglMetalLines.m
%
% usage: mglMetalLines(x0, y0, x1, y1, lineWidth, color)
% by: ben heasly
% date: 06/13/2022 adapted from mglLines2, updated for Metal
% copyright: (c) 2021 Justin Gardner (GPL see mgl/COPYING)
% purpose: Function to plot lines on a screen opened with mglOpen.
% inputs... |
ef8649f2d70e40b30aaaaa62261553c7bbbdc96092d3d7fc32ca9642d4eb5a80 | MATLAB | 2,050 | 55 | %{
Copyright (C) Cambridge Electronic Design Limited 2014
Author: James Thompson
Web: www.ced.co.uk email: james@ced.co.uk, softhelp@ced.co.uk
This file is part of CEDS64ML, a MATLAB interface to the SON64 library.
CEDS64ML is free software: you can redistribute it and/or modify
it under the t... |
280352211eeeb791b272bac87dd213320f6ed48540665bc90fe3176b03c65432 | MATLAB | 2,051 | 34 | <<<<<<< HEAD
function matchresult = goMatching(result_f, key_f, i, j, general)
% in base la tipo di funzione passo più o meno parametri alla funzione
drawnow;
switch (general.MATCHING_function)
case 'library'
% converto la cella in struct perchè il C non capisce altro
result_a = struct('pFileName'... |
b619cff64f15ebb4b68b8979bfd42704ca4ddac0a2d177f01f9157113a68b583 | MATLAB | 2,051 | 84 | % VL_DEMO_KMEANS_ANN_SPEED Compares Lloyd's, Elkan, and ANN k-means
numCenters = 200 ;
numTrials = 3 ;
maxNumIterations = 10 ;
initialization = 'randsel' ;
%initialization = 'plusplus';
distance = 'l2' ;
%% Create an example dataset
dimension = 32 ;
numData = 50000 ;
X = randn(dimension,numData);
%% Run various ... |
944a80d3616ceccca429705e82822d8634067d0081c820b9ded46cb2fe5d13a8 | MATLAB | 2,054 | 60 | %%
addpath(genpath('.'))
addpath(genpath(fullfile('..','ANE')))
clear gui;
global gui;
global txtFntSz;
global video;
global masks;
global area;
% global r_bg_ratio;
global comx;
global comy;
global list_weight;
global list_weight_trace;
global list_weight_frame;
global list_neighbors;
% global list_mask_update;
% gl... |
cccd6e95d1b9f20a302ea364f1650ac3f7f7736dd0e15df5888b87afa26ee296 | MATLAB | 2,054 | 56 | function mltp_plot_bfo_180_ac_per_cell(obj, session)
dataFolder = fullfile(session.getAnalysisDirectory(), obj.Config.placemaps.outputFolder);
% Load the data
matFilename = fullfile(dataFolder, 'bfo_180_per_cell.mat');
if ~isfile(matFilename)
error('The data file (%s) does not exist. Make ... |
1da0970e0ce9c826f0aef281fee9c4a9e10cf750bb92e3be89874b3150f44924 | MATLAB | 2,056 | 62 | %Calculate Fmax correction for a F-observed and the permutation
%distribution
%
%EXAMPLE USAGE
% >> [h, p, Fmax_crit, est_alpha] = Fmax_corr(F_obs, F_dist, 0.05)
%
%REQUIRED INPUTS
% F_obs - An electrode x time points array of observed F-values
% F-dist - A permutation x electrode x time point ... |
a0a4c9dd4efebf170b92a21dd0a3fa3aafeae623431ea5d4d640774ec7a5b715 | MATLAB | 2,057 | 71 | function [V,dV] = dss_sphere(X, dim, symmetric)
% [V,dV] = dss_sphere(X)
% [V,dV] = dss_sphere(X, dim)
% [V,dV] = dss_sphere(X, dim, symmetric)
% X Data to be sphered
% dim Requested result data dimension, 0 for no reduction
% symmetric Boolean, perform symmetric sphering
% V ... |
a9defca33e4922b31b6d20dd0ece73adb204d6761bdef3302d30dafa243676ec | MATLAB | 2,057 | 95 | function [rev,repo,workingcopy] = aedes_revision()
% AEDES_REVISION - Returns the current revision of Aedes
%
%
% Synopsis:
% [rev,repo,workingcopy] = aedes_revision;
%
% Description:
%
% Examples:
%
% See also:
%
% This function is a part of Aedes - A graphical tool for analyzing
% medical images
%
% Copy... |
f8e45b0d4eaad32abd42fe6e2982d94b8a656f5ced33a32357c1ae5fb404fa8b | MATLAB | 2,058 | 51 | function lfp_indefinite = fillSurveyParametersIndStr( obj, data, fname, obj_file )
% Extract and visualize LFPs from survey Indefinite Streaming mode
%
% Syntax:
% FILLSURVEYPARAMETERS( obj, data, fname, obj_file );
%
% Input parameters:
% * obj - object containg data
% * data - data from json file(s)
% * f... |
63e6ac2c110661ae07b984f7963a95d5db0af1b02688fff8eec1a30ffcebd187 | MATLAB | 2,060 | 58 | function generate_model_data()
%generate_model_data genrates a population vector time-series for a model
%simulation of E-I neurons
% Author: Keshav Srinivasan, March 2023
%% Parameters
N = 1e6; % Number of neurons
steps = 1e8; % Number of timesteps (Can be parallelized to doing smaller runs, for e.g. 100 runs of 1e... |
1a7255cb2ac138cfa237f075a771da9a393834021f60ffe9d6885a91e85ad62a | MATLAB | 2,061 | 69 | function subj_variablity_delay_ft(sn)
% maintenance variance of each set size
load('subs.mat');
subname = subs.name{sn};
set_name = fullfile(Dir.prepro,[subname,'_clean.set']);
EEG = pop_loadset('filename',set_name);
EEG = pop_select(EEG,'nochannel',{'LHEOG','RHEOG','BVEOG','TVEOG'});
X = [EEG.chanlocs... |
f60005fd99544fb337600dfe4f9a5f10c06318f1248354384bf00c88fb20229f | MATLAB | 2,061 | 63 | %Add directory to import search path for the instance of
%the Python interpreter currently controlled by MATLAB
%
%EXAMPLE USAGE
% >> py_addpath('C:\Documents\ERPResults')
%
%REQUIRED INPUTS
% directory - Directory to add the Python import search path
% MATLAB_too - If true (or 1), directory will also... |
cceef1f3a2edfd89795f59538c57b891dcabd6cc392a6884738af32dbb239dd1 | MATLAB | 2,063 | 76 | close all
clear all
clc
a = 100;
poly = [0 0; a, 0; a, a; 0, a];
%figure
%plot(poly(:,1), poly(:,2), 'b-*', 'linewidth', 10)
%hold on
%plot([poly(1,1), poly(end,1)], [poly(1,2), poly(end,2)], 'b-*', 'linewidth', 10)
%grid on
numPoly = length(poly);
polyh = poly;
% This is just to help compute the line segment angl... |
e1d4bdced65e70dde5facef9f9d3af7f0e9b592e8c8e4b3a496f186b7044bdd8 | MATLAB | 2,063 | 50 | %%
clear
file=dir('ACC*reverse*.mat');
k=1;
for jj=1:length(file)
load(file(jj).name)
n=length(outcome);
n1=fix(n*0.15);n2=fix(n*0.50);
go{1}=[find(outcome(1:n1,1)==1);find(outcome(1:n1,1)==2)];
go{2}=[find(outcome(n1+1:n2,1)==1);find(outcome(n1+1:n2,1)==2)]+n1;
go{3}=[find(outcome(n2+1... |
235e8f920002e3852b89cdb33d47e612a27a538b9c09c50ebd22c1b06833e19e | MATLAB | 2,064 | 60 | function Cn = correlation_img(Y,sz,d1,d2,flag_norm)
% construct correlation image based on neighboing pixels
% Y: raw data
% sz: define the relative location of neighbours. it can be scalar, 2
% element vector or a binary matrix
% scalar: number of nearest neighbours, either 4 or 8, default 4
% 2 ele... |
97bae34b4b18a82945da83006430c91ddb184f1514c90fda3686b6445a9c4bec | MATLAB | 2,065 | 67 | % moveLegVideos.m
%
% Function to move all leg videos in input date directories to a
% user-selected destination folder (through GUI). Renames leg videos with
% full experiment name (date_fly#_fov#_trial#_legVid.mp4).
%
% INPUT:
% dateDirs - cell array of full paths to date directories
%
% OUTPUT:
% none, but co... |
bcd52423ef3a3831e94e1f323b285c827bb0c9d479e269ee1b80190820096d1b | MATLAB | 2,065 | 51 | % mglMetalRepeatingFlush.m
%
% $Id$
% usage: [ackTime, drawTimes, frameTimes] = mglMetalRepeatingFlush(nFrames)
% by: Benjamin heasly
% date: 06/17/2022
% copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING)
% purpose: Send one command that causes multiple flushes in a r... |
0d836b562ec709dfcf006f263a8e2bc5c95921e7c86d6f2dae50d5cedff2c9fe | MATLAB | 2,066 | 40 | % SONGETEXTMARKDATA returns the timings, marker values and extra data
% for an AdcMark, RealMark or TextMark channel
%
% Implemented through SONGetExtMarkData.dll
%
% [npoints, times, markers, extra]=
% SONGETEXTMARKDATA(fh, chan, maxpoints, stime, etime{, filtermask})
%
% INPUTS: FH = file ha... |
154c4f5630587cbcce8f80af5e1f13cf38634360a90128f3f9e4833856fd0fd3 | MATLAB | 2,067 | 41 | function test_simple_noninteractive_flytracker()
this_script_folder_name = fileparts(mfilename('fullpath')) ;
flytracker_folder_path = fileparts(this_script_folder_name) ;
flydisco_folder_path = fileparts(flytracker_folder_path) ;
flytracker_test_files_folder_path = fullfile(flydisco_folder_path, 'flyt... |
9cd390382143b2482343f5c5755046f6cb8e5b0305c92370265952c389571331 | MATLAB | 2,068 | 81 | function o = niftistruc
% Create a data structure describing NIFTI headers
% _______________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
%
% $Id: niftistruc.m 8776 2013-11-14 09:04:48Z roboos $
persistent org;
if ~isempty(org),
o = org;
... |
a8cec5a8616dc3d3230c529eb86f6f37181c54c9733433f1c94afad19562b0da | MATLAB | 2,068 | 68 | % mglTestTextureMultiple: an automated and/or interactive test for rendering.
%
% usage: mglTestTextureMultiple(isInteractive)
% by: Benjamin Heasly
% date: 03/10/2022
% copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING)
% purpose: Test rendering a smoothly varying texture.
%... |
55c4cc91712873d7e41adbf8c219fcba93d0235cfec59b83781a65127d13f70c | MATLAB | 2,069 | 54 | % »ñÈ¡µ±Ç°ÎļþµÄ·¾¶
fullpath = mfilename('fullpath');
[path,name]=fileparts(fullpath);
Acc = [];
Left = [];
Right = [];
AllLeft = [];
AllRight = [];
% Ñ»·¶ÁÈ¡Îļþ¼Ð
for i = 1:50
if i<10
SubFolderFiles = [path,'\sourcedata\sub-0' num2str(i) '\'];
else
SubFolderFiles = [path,'\sourc... |
b82b21416fd152d2be590124e65f8c4bae2a1a2c65c24ba5b35dc0dc5d81a828 | MATLAB | 2,069 | 51 | function [path_name, file_base, file_fmt] = data_info_HPC(file_name_tmp, path_name)
% Select datasets to process
% Jinghao Lu 01/12/2016
% [file_name_tmp, path_name] = uigetfile({'*.tif'; '*.tiff'; '*.avi'}, 'Select coordinates file', 'MultiSelect', 'on');
%[file_name_tmp, path_name] = uigetfile('*', 'Select... |
92a83ed260bea2040e85ee201d20a3d3ce8cb9ccfaf0ab7ed287db4b360caf07 | MATLAB | 2,070 | 55 | function outtrx = FlyTracker2WingTracking(expdir,varargin)
[dataloc_params,analysis_protocol,datalocparamsfilestr,settingsdir,perframe_params,ftfile] = ...
myparse(varargin,'dataloc_params',[],...
'analysis_protocol','current',...
'datalocparamsfilestr','dataloc_params.txt',...
'settingsdir','/groups/branson/b... |
9cffcfb32368251cc8bfe6da655c73440f12e55a18a74541f5b6f6e626f4c198 | MATLAB | 2,070 | 40 | function mltp_plot_bfo_180_ac(obj)
numAngles = 2;
best_fit_orientations_all_contexts = zeros(obj.Experiment.getNumSessions(), numAngles);
plotlegend = cell(obj.Experiment.getNumSessions(), 1);
for iSession = 1:obj.Experiment.getNumSessions()
session = obj.Experiment.getSession(iSession);
... |
b5e406b27ef040590615bda2c7ec2e899410c8e3c16165a4c7d66338c437349b | MATLAB | 2,070 | 59 | % data_name = 'lowBG=5e+03,poisson=1';
%%
num_Exp = 10;
list_Exp_ID = arrayfun(@(x) ['sim_',num2str(x)],0:(num_Exp-1), 'UniformOutput',false);
lam = 8;
d0 = 0.8;
%% Load traces and ROIs
dir_parent = fullfile('..','data','data_simulation',data_name);
dir_video = dir_parent;
dir_masks = fullfile(dir_parent, 'GT Masks'... |
2f5b4ab56b039bff97a26e9c00db20865a9f4305322931a17cd9a1ad118f42fd | MATLAB | 2,072 | 56 | function packet = jaga16_packet(buf, hastimestamp)
% JAGA16_PACKET converts the JAGA16 byte stream into packets
% Copyright (C) 2015 Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip
% for the documentation and details.
%
% FieldTrip is free software: you can redistr... |
c4b74a8b4204454133f95c153a2d6175ae2cfc29c0529c257cdc33746b96aa2f | MATLAB | 2,072 | 52 | function startBackgroundWebPreview(chanToPlot,config)
% Starts a background MATLAB process that sends low-res preview images of one channels to the web
%
% Purpose
% Start an instance of MATLAB running the web preview in a loop
% The function is Linux-specific
mPath = config.syncAndCrunch.MATLA... |
c131ac14a47f6fc4f91e2bb3e83c96b4582f3d4f6c6735c0647a0e2fa5b60c9b | MATLAB | 2,073 | 71 | function addVarargRow(DynamicTable, varargin)
p = inputParser();
p.KeepUnmatched = true;
p.StructExpand = false;
addParameter(p, 'id', []); % `id` override but doesn't actually show up in `colnames`
for i = 1:length(DynamicTable.colnames)
addParameter(p, DynamicTable.colnames{i}, []);
end
parse(p, varargin{:});
... |
cbf97063984226d26c6e71ef8d36498a6f025e3c7ac1cf2d786f3b06e6bf87f2 | MATLAB | 2,073 | 59 | function [Y,XYZ] = spm_read_vols(V,mask)
% Read in entire image volumes
% FORMAT [Y,XYZ] = spm_read_vols(V,mask)
% V - vector of mapped image volumes to read in (from spm_vol)
% mask - implicit zero mask?
%
% Y - 4D matrix of image data, fourth dimension indexes images
% XYZ - 3xn matrix of XYZ locations returne... |
d216f3f5b77b68f6f5f57623c9ca40e44636bfe92c6f86f3cdd39bf70787429f | MATLAB | 2,073 | 35 | function options = tracker_default_options()
% default options
options.granularity = 10000;
options.num_chunks = [];
options.num_cores = 1;
options.max_minutes = inf;
options.fr_samp = 100;
options.save_JAABA = false;
options.save_xls = false;
options.save_seg = false;
... |
d68f870f3db6f18d07aaa280bc51c7bbe5ed8e5445e12a3314fe818920604d1d | MATLAB | 2,073 | 46 | function plot_3(z)
figure()
Summary = tight_subplot(3,1,[.03 .03],[.03 .03],[.03 .03]);
% Stim, and CSs
axes(Summary(1))
histogram(allcs/z.sr_e, linspace(0,max(z.cycleTime_b), 50), 'FaceColor', 'k'); hold on
histogram(allgoodcsLocs/z.sr_e, linspace(0,max(z.cycleTime_b), 50), 'FaceColor', 'c');
yyaxis right
plot(z.cyc... |
af1d0918d009e2c1714c56e3a1e536b63ff9ca595f14e60d585a9facd8fb5025 | MATLAB | 2,074 | 43 | %find tilt shift parameter using the val. camera
SC = set_PG_ND(SC);
%% settings
tilt_xs_conf = FOV.TS_ramps_alpha; %ramps in x axis
tilt_ys_conf = zeros(size(tilt_xs_conf)); %ramps in y axis
f_fin = OPT_S.f_fin.*SC.mask_f_laser; %final function
num_tilts = length(ti... |
614e7ecc67e269429e6120b2ca05d81c43a4e18dadcce11261e3a5447cc8897b | MATLAB | 2,075 | 59 | function MovementRegressorsdt = importMovReg(filename, startRow, endRow)
%IMPORTFILE Import numeric data from a text file as a matrix.
% MOVEMENTREGRESSORSDT = IMPORTFILE(FILENAME) Reads data from text file
% FILENAME for the default selection.
%
% MOVEMENTREGRESSORSDT = IMPORTFILE(FILENAME, STARTROW, ENDROW) Rea... |
7db6261a0017d1d1d34e2ac8a014f28d629805aeba486a16f786834a17e20000 | MATLAB | 2,075 | 81 | function o = niftistruc
% Create a data structure describing NIFTI headers
% _______________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
%
% $Id: privateniftistruc.m 8776 2013-11-14 09:04:48Z roboos $
persistent org;
if ~isempty(org),
o = or... |
7a4821b8ad324bf7a16d30c1d09c1a9bf337e6aae0b0081a41375ce7e4eedd26 | MATLAB | 2,076 | 44 | function [movement] = mulana_compute_movement(arenaJson, arenaroi, x_px, y_px, timestamps_ms)
velocity_lowpass_wpass = 0.05;
timestamps_ms = reshape(timestamps_ms, 1, length(timestamps_ms));
% Construct the appropriate arena. All the shapes have 4 control
% points that serve as references.
refP = resha... |
b522057eb12c595310842e9d0d3394ff825c5dfdc6778eff6d5c317ca55d6c1c | MATLAB | 2,076 | 69 | % initRandomization.m
%
% $Id:$
% usage: [parameter alreadyInitialized] = initRandomization(parameter)
% by: justin gardner
% date: 03/01/10
% purpose: function that initializes the parameters for randomization
% routines blockRandomization and uniformRandomization.
%
% ... |
dac835d7551d351c0c7dc8066dc53f4ccacffd897f970f1e6edf0308331a57ca | MATLAB | 2,076 | 59 | function unit = ft_estimate_units(size)
% FT_ESTIMATE_UNITS tries to determine the units of a geometrical object by
% looking at its size and by relating this to the approximate size of the
% human head according to the following table:
% from 0.050 to 0.500 -> meter
% from 0.500 to 5.000 -> decimeter
% fr... |
b039cf916964f40c4072962ff75ecc3c6b407ea7aab5595d4908bbb0bbea74d5 | MATLAB | 2,077 | 68 | function phaseout = gliomaImmunotherapyContinuous(input)
% glioblastoma-immune dynamics system and objective functional for optimal control using GPOPS-II
% used in the code GBMoptimalcontrol.m
% Note: if you decide to use a one-term integral constraint (Intconstraint) instead of a three-term
% constraint in OCHiPe... |
34c64c0522ffbf8476e55132e350884cec20741b619bdbc5f4e593bbba6a8b6d | MATLAB | 2,078 | 82 |
%# -*- texinfo -*-
%# @deftypefn {Function File} {} postpad (@var{x}, @var{l}, @var{c})
%# @deftypefnx {Function File} {} postpad (@var{x}, @var{l}, @var{c}, @var{dim})
%# @seealso{prepad, resize}
%# @end deftypefn
%# Author: Tony Richardson <arichard@stark.cc.oh.us>
%# Created: June 1994
function y = postpad (x, ... |
b146ddca13c41fb8bbd1bc294e6cf1a23fe0f817a0cc013515d33f63ad4509f3 | MATLAB | 2,078 | 72 | % callFreeWalkSwingStanceSteps.m
%
% Function that takes in steps (defined by start, mid, end indices),
% step parameters (calculated in computeFreeWalkStepParameters())
% Calls swing/stance based on whether leg is moving in the reference frame
% of the arena during that half step (swing) or the leg is stationary in ... |
be9dc9ce48dd33f864abd92c10a678c03f2a50c1fb6a181e069907dc2d9a319a | MATLAB | 2,078 | 66 | function r_splithalf = simseq_getSplitHalfDataReliability(data, varargin)
% r_splithalf = simseq_getSplitHalfReliability(data, [nIter], [runFlag])
%% Parse inputs
p = inputParser;
p.addRequired('data', @isnumeric);
p.addParameter('nIter',1000, @isnumeric);
p.addParameter('runFlag',true, @islogical);
p.addParameter('sp... |
c1604e03445d3c08db0987b7ad41e92a8c8a4a2864a4a91af4dbbf29dcbb0d85 | MATLAB | 2,078 | 62 | % determineStepDirection.m
%
% Function that determines the angle moved in the xy plane for each leg
% during each step.
% 0 deg points straight up toward head; 90 deg points right; -90 points
% left; 180/-180 points down abdomen
%
% INPUTS:
% legXPos - matrix of leg x positions over time; num frames x num tracked
... |
190a24c488e191b9abd6133d5d6f045ad6596f153d2ceb3887444dd81911f079 | MATLAB | 2,079 | 43 | classdef CBIG_ArealMSHBM_unit_test < matlab.unittest.TestCase
% Written by Ru(by) Kong and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md
methods (Test)
function test_example(testCase)
% create output folder
CBIG_CODE_DIR = getenv('CBIG_CODE_DIR'... |
5030ea1435716a732c0899e0759d3e87b233637a6555a4ec3aa35e32761d97c0 | MATLAB | 2,079 | 68 | %{
Copyright (C) Cambridge Electronic Design Limited 2014
Author: James Thompson
Web: www.ced.co.uk email: james@ced.co.uk, softhelp@ced.co.uk
This file is part of CEDS64ML, a MATLAB interface to the SON64 library.
CEDS64ML is free software: you can redistribute it and/or modify
it under the t... |
c26a7c3c6f65d557294414f17067f0bd2f61dd1fdf7b9417a2856344b2e2d0b2 | MATLAB | 2,079 | 59 | %% Script to obtain centiles by FEP diagnosis (first session)
% Copyright (C) 2023 University of Seville
% Written by Natalia García San Martín (ngarcia1@us.es)
% This file is part of Neurobiology Centiles Psychosis toolkit.
%
% Neurobiology Centiles Mapping toolkit is free software:
% you can redistribute... |
eeb90c3381ee98bdaeadf04c0094656559355d284a3c32bd1404246c371ba17e | MATLAB | 2,080 | 76 | % mglFillOval - draw filled oval(s) on the screen
%
% $Id$
% usage: results = mglFillOval(x, y, size, color, antialiasing)
% by: Benjamin Heasly
% date: 03-17.2022
% copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING)
% inputs: x,y - vectors of x and y coordinates of c... |
6a30ee836b5589ed1cc9baf4fafbcf25db16505958468e1e73dba250a4eda0b3 | MATLAB | 2,081 | 59 | function [BTA, behaviorCounts, BTA_RMSD] = ML_BehaviorTriggeredAverage_whitened_ridge(Xtrain,Xtest,Ytrain,Ytest)
%This function performs the core BTA caculation using maximum likelihood
%with whitening and ridge regression; not used in paper
%nThi = size(X,1);
ntfilt = size(Xtrain,2);
number_of_behaviors = size(Ytrain... |
b3affd0cdafd20e8273e88cf02155f2b0462f660bac1f36b65def503564e3624 | MATLAB | 2,082 | 43 | function [sp,evm] = genNextSpikeTimepoint(spike_opts, n_locs, sp)
% function [sp,evm] = genNextSpikeTimepoint(spike_opts, n_locs, sp)
%
% Function to generate a set of correlated spike trains by using a Hawkes
% process, or a discrete approximation of a Hawkes process.
%
% 2019 - Alex Song and Adam Charles
%%%%%%%%%%... |
b91771a2676270e160536716b367acc23ddae3cc37a38708994ade4a9deceb46 | MATLAB | 2,082 | 73 | function [varargout]=SONGetExtraData(varargin)
% SONGETEXTRADATA reads or writes the extra data area of a SON file
%
% [ERR, BUFFER]=SONGETEXTRADATA(FH, N, DATATYPE, BYTEOFFSET, FLAG)
% or
% ERR=SONGETEXTRADATA(FH, BUFFER, BYTEOFFSET, FLAG)
%
% INPUTS: FH the SON file handle
% N the numbe... |
6c7f31f6dcb0ab9e3b81ac3f3ba37a093e60aa67801b9d24909db9030f4d455f | MATLAB | 2,083 | 59 | function state = dss_check_adaptivity(state)
% Check adaptivity of alpha, beta & gamma
% Copyright (C) 2004, 2005 DSS MATLAB package team (dss@cis.hut.fi).
% Distributed by Laboratory of Computer and Information Science,
% Helsinki University of Technology. http://www.cis.hut.fi/projects/dss/.
% $Id: dss_check_adaptiv... |
92a0a3531677490c829bef6de74e1f16617a95e3b00257e3ffeb4370735e19bc | MATLAB | 2,083 | 49 | stable=nan(6,4);uncertain=nan(6,4);reverse=nan(5,4);restable=nan(5,4);
f1=dir('ACC*stable-DF.mat');
for i=1:length(f1)
load(f1(i).name)
stable(i,1)=Info.Hit;stable(i,2)=Info.Miss;stable(i,3)=Info.CR;stable(i,4)=Info.FA;
end
f2=dir('ACC*uncertain-DF.mat');
for i=1:length(f2)
load(f2(i).name)
unc... |
4294d95d7d552821bce07986fed07b31463cec0c47aa42be5b6e51b3135fb258 | MATLAB | 2,084 | 89 | %
% Goodness of fit of all matrix decompositions in function of rank.
%
% This test uses full matrices, so will only work for very small networks.
%
% PARAMETERS
% $NETWORK
%
% OUTPUT
% dat/approximation.$NETWORK.mat
% functions Cell array of function names
% prec RMSE values
% .(function).values(i_decomposi... |
481e65f2c70934d21f27bd79cdc8e7596cee842c527682995f418b1a7b15c1b8 | MATLAB | 2,084 | 74 | function corr_normplot(x,y)
% Plots univariate histograms, scatterplot, and joint histogram
% for the bivariate data set defined by [x,y]
%
% FORMAT: corr_normplot(x,y)
%
% INPUTS: x and y are two vectors of the same length
% Cyril Pernet v1 20/06/2012
% -----------------------------
% Copyright (C) Corr_toolbox 201... |
68bc183b3b165bb2395ab398e7e5ef007f1b7428ee90878f456d248771781992 | MATLAB | 2,084 | 61 | function [f F]=motif3funct_bin(W)
%MOTIF3FUNCT_BIN Frequency of functional class-3 motifs
%
% [f F] = motif3funct_bin(A);
%
% Functional motifs are subsets of connection patterns embedded within
% anatomical motifs. Motif frequency is the frequency of occurrence of
% motifs around a node.
%
% Input: ... |
9705043558c48ca04263ab067ee01afaf914576a8d039ce8b64f89cf810aa335 | MATLAB | 2,084 | 73 | % distBtw2Pts.m
%
% Function to return the Euclidian distance between two points, using the
% vector norm.
% If input x and y points are themselves vectors, returns the distance
% between each set of points, paired at corresponding indicies
% Inputs must be of same length
%
% INPUTS:
% x1 - x value of first point (... |
6f9307300ffac7d42479dd62d71e840b229a3ddc6bfe7df77b7657f14acf6015 | MATLAB | 2,085 | 69 | function path_out = dendrite_randomwalk2(M,root,ends,distsc,maxlength,fillweight,maxel,minlength)
% path_out = dendrite_randomwalk2(M,root,ends,distsc,maxlength,fillweight,
% maxel,minlength)
%
% Wrapper for dendrite_randomwalk_cpp.cpp, a fast function to produce a
% random walk through the neural volume. ... |
cfdaf8c3ff87c3f810c2d01fa2ea26f01470c674b446e19af62df3e7011871ce | MATLAB | 2,085 | 55 | %{
Copyright (C) Cambridge Electronic Design Limited 2014
Author: James Thompson
Web: www.ced.co.uk email: james@ced.co.uk, softhelp@ced.co.uk
This file is part of CEDS64ML, a MATLAB interface to the SON64 library.
CEDS64ML is free software: you can redistribute it and/or modify
it under the t... |
44c861a3769a0cfc72358a50fae3c3ad0dc3049ae5786e2b370f3976513c8935 | MATLAB | 2,086 | 76 | function style = vl_plotstyle(index)
% VL_PLOTSTYLES Get a plot style
% STYLES = VL_PLOTSTYLE(INDEX) returns a cell array of PLOT() options
% for the color/line style of index INDEX. The available styles are
% defined the ColorOrder and LineStyleOrder properties of the
% current axes and cycled first by color ... |
282a91ebf166e7ccae3307c249753c66af0a0d646cbf2ec18856cd711c1bdd4c | MATLAB | 2,087 | 60 | function elec = read_asa_elc(fn)
% READ_ASA_ELC reads electrodes from an ASA electrode file
% converting the units to mm
% Copyright (C) 2002-2013, Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip
% for the documentation and details.
%
% FieldTrip is free software: ... |
f2d36a422126b5c058fdbc10bca5dbc2cbc1eb19a7fa9eb55c9f9e93a1f0de49 | MATLAB | 2,087 | 47 | function[interval, start]=SONGetSampleInterval(fid,chan)
% SONGETSAMPLEINTERVAL returns the sampling interval in microseconds
% on a waveform data channel in a SON file, i.e. the reciprocal of the
% sampling rate for the channel, together with the time of the first sample
%
% [INTERVAL{, START}]=SONGETSAMPLEINTER... |
163e001cfdf9c7a5c0503fb6813fe26a0ef25869512d1fcf72935905b80d38d7 | MATLAB | 2,088 | 63 | function [dat, w] = ft_preproc_denoise(dat, refdat, hilbertflag)
% FT_PREPROC_DENOISE performs a regression of the matrix dat onto
% refdat, and subtracts the projected data. This is for the
% purpose of removing signals generated by coils during continuous
% head motion tracking, for example.
%
% Use as
% [dat] = ... |
3f933e094805a8694ac92c6f1cfb8479facebb5088bbe68953a58a59f0f33c02 | MATLAB | 2,088 | 56 | function [ev_changepts, ev_sfit, ev_1deriv, ev_2deriv] = find_ev_IntDegSeg(ev, method, knots, order)
%find_ev_IntDegSeg Finds the two indices bounding Int Deg Seg regimes
% This function fits a spline to the eigenvalues and then finds change
% points in the eigenvalue spectrum.
%
% Usage: ev_changepts = fin... |
f9bd9cadf772e533da0a7550fdf44711092ce0ca5c9bf50ed568613478f4a45c | MATLAB | 2,090 | 77 | % mglTestQuads: an automated and/or interactive test for rendering.
%
% usage: mglTestQuads(isInteractive)
% by: Benjamin Heasly
% date: 03/10/2022
% copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING)
% purpose: Test rendering a checkerboard.
% usage:
% % You... |
04148a3bc828ed025ca47713f4f151e471197c7b91f843646b8430a3bd25c4a6 | MATLAB | 2,091 | 57 | function [event] = read_bucn_nirsevent(filename)
% READ_BUCN_NIRSEVENT reads the event information of ASCII-formatted NIRS
% data acquired with the UCL-BIRKBECK machine and postprocessed by the
% Paris group. The first line contains the header-info and the rest of
% the file contains per line an event. The first colu... |
ca97682962703f4216dadbb9be574bfcdc47d653f71a1ef46fa7bfaff48d89a5 | MATLAB | 2,091 | 54 | function textprogressbar(c)
% This function creates a text progress bar. It should be called with a
% STRING argument to initialize and terminate. Otherwise the number correspoding
% to progress in % should be supplied.
% INPUTS: C Either: Text string to initialize or terminate
% Perce... |
93474599bd57495813406b0ded5eca614b09eb6add3ac522437d9956345b6b7b | MATLAB | 2,092 | 48 | function [slabel, sal] = saliencyPredict(feat, grids, model, para)
sal = zeros(para.imh, para.imw); hitTime = zeros(para.imh, para.imw);
if size(feat, 1) > para.split, % split the grids array for out of the memory problem
re = n; st = 1; ed = para.split;
while(re > 0)
gs = uint32(grids(st : ed, :... |
e82a492d35e74e1f4d90bfc232b3770c51d47e8a7aff3a9f6969066997d12b3b | MATLAB | 2,092 | 59 | function mglEyelinkRecordingStart(varargin)
% mglEyelinkOpen - Opens a connection to an SR Resarch Eyelink eyetracker
%
% program: mglEyelinkRecordingStart.m
% by: eric dewitt
% date: 04/03/06
% copyright: (c) 2009,2006 Eric DeWitt, Justin Gardner, Jonas Larsson (GPL see mgl/COPYING)
% purpose:... |
e97946850f6346604ffbfc32932e3885e313d8e7f39ec775ca94de825f84fe9c | MATLAB | 2,093 | 91 | %
% Compute the dimensional parameter r in function of dataset.
%
% RESULT
% r_svd reduced rank for singular value decomposition
% r_lap reduced rank for Laplacian decomposition
%
% PARAMETERS
% network Dataset name
%
% INPUT
% dat/runtime
%
function [r, r_l] = get_rank(network)
alpha = 0.7; % Scaling fac... |
f79971345acbb83a7d605b5544c3f6269fa1b2a55e82086b29c1f8d2f0ce6262 | MATLAB | 2,094 | 52 | %% This script runs Processing1_*.m for multiple directories.
%
%% Specify directories
% It is assumed that each of the following folders contains exactly N *_events.mat files, where
% N is the number experimental groups (e.g. 2 for a BEFORE vs. AFTER
% design).
folders ={
'\\folder1\', ...
'\\f... |
d98ab04743b6b4d5de183c56fba07dbe34dd04a4f7bc2b60cb3449f59dc6c628 | MATLAB | 2,095 | 92 | function histograms(DATA,ROI,AddInfo)
% HISTAGRAMS - Calculate histograms for image and ROIs (Aedes plugin)
%
%
% Synopsis:
%
% Description:
%
% Examples:
%
% See also:
%
% This function is a part of Aedes - A graphical tool for analyzing
% medical images
%
% Copyright (C) 2006 Juha-Pekka Niskanen <Juha-Pekka.Nis... |
e7e8ee6759598eea424b6e5f3538aab3b92746f48e0a8eaf1229596ba96a4779 | MATLAB | 2,096 | 59 | classdef AnnotationSeries < types.core.TimeSeries & types.untyped.GroupClass
% ANNOTATIONSERIES Stores user annotations made during an experiment. The data[] field stores a text array, and timestamps are stored for each annotation (ie, interval=1). This is largely an alias to a standard TimeSeries storing a text array ... |
70b4a06356dc290db965ad8877fd131564d58f063a2a9074322a1bbbe399c5e9 | MATLAB | 2,097 | 66 | function results = vl_test_fisher(varargin)
% VL_TEST_FISHER
vl_test_init ;
function s = setup()
randn('state',0) ;
dimension = 5 ;
numData = 21 ;
numComponents = 3 ;
s.x = randn(dimension,numData) ;
s.mu = randn(dimension,numComponents) ;
s.sigma2 = ones(dimension,numComponents) ;
s.prior = ones(1,numComponents) ;
s... |
8cf47d0b07c4f88fa00977293ce3a91bb88933623f71ececc2e5544e42f89349 | MATLAB | 2,097 | 107 | %
% Draw one scatter distribution, i.e., a distribution plot for the
% values of one single statistic.
%
% PARAMETERS
% s (n*1) Values of the statistic for all networks
% class Class name
% type Type of plot
% a - Normal
% b - Bare - only points and frame. No labels. Square
% aspect ratio.
% bx - Bare, with ... |
cc3b56637ebe58e2e748fe6e95fadfe531f0dc1bbedfe78ae3c530acd1ccba37 | MATLAB | 2,098 | 61 | % f_DesignFIRfilter.m
%
% Copyright (C) 2015, Miguel Navarrete
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any la... |
3f361335d307019e9a45cc12b6a9aa3a0ae1c3a922eb620e74cf98d12f1136a3 | MATLAB | 2,099 | 69 | classdef OptogeneticSeries < types.core.TimeSeries & types.untyped.GroupClass
% OPTOGENETICSERIES An optogenetic stimulus.
% OPTIONAL PROPERTIES
properties
site; % OptogeneticStimulusSite
end
methods
function obj = OptogeneticSeries(varargin)
% OPTOGENETICSERIES Constructor for OptogeneticSeries
... |
a6e24445903930b0cf3e5aea05f1ae670fcb3e50e7fa6dcc3397f166737cb642 | MATLAB | 2,099 | 87 | function out = sort_back( data, ind, dim )
% SORT_BACK sort back data to original order
% ind is the indexes obtained from sorting
% dim is the sorted dimension of the data (assumed to be 1 if not specified)
% Ex:
% y = randn(3,4,2);
% [y,ind] = sort(y,2);
% do stuff with sorted y...
% y2 = sort_back( y, ind, 2 );
%
%... |
cfa4873b9ce1072b158afed5824cfb99f0b614083e74a288c01f96ef216552a2 | MATLAB | 2,099 | 34 | % SON
%
% Files
% progressbar - WAITBAR Display wait bar.
% SONADCToDouble - scales a SON ADC channel to double precision floating point
% SONADCToSingle - scales a SON ADC channel to single precision floating point
% SONChanList - returns a structure with details of ac... |
832481d7460dc464b89e418044425571a10514c335c75b5fc2fca48664b2c5b6 | MATLAB | 2,101 | 77 | function [matrix, extra] = read_mat(fn);
% READ_MAT reads a matrix from an ascii or binary MBF format file
%
% Usage: m = loadmat('file');
% or [m,extra] = loadmat('file');
%
% LOADMAT('file') returns the matrix stored in 'file' and
% the extra information stored at the bottom of that file.
% LOADMA... |
ee523352192634141609f419264f12906729e7aafb21dd2588cb0cbb97018c8d | MATLAB | 2,103 | 57 | function [ Tracks ] = load_single_folder(folder_name, field_names)
%get the tracks given a single folder
if nargin < 2
field_names = {};
end
Tracks = [];
analysis_folder_name = [folder_name, filesep, 'analysis'];
if exist(analysis_folder_name, 'dir')
%use new data structure system i... |
ae238205a0ed044028379600e5e249ea8c8c5de00534fd18370cdcdbad1947c6 | MATLAB | 2,104 | 69 | clear
cd ./reverse-cuelight
control=dir('C*cuelight*.mat');
inhibit=dir('I*cuelight*.mat');
for j=1:length(control)
load(control(j).name)
if ~isempty(C1S7)
C1S7(:,2)=1;%hit
end
if ~isempty(C1S8)
C1S8(:,2)=2;%miss
end
if ~isempty(C1S9)
C1S9(:,2)=3;%cr
end... |
9d15db27351ddd7559c053930911a3f648ec207dfee201c9a28c28785b89e626 | MATLAB | 2,105 | 55 | function [NB, NBpattern] = netBurstDetection_alg(BDTrains, IBeITh, numElecTh, userParam)
% BDTrains:
% 1st col: elec number
% 2nd col: burst init ([sample])
% 3rd col: burst end([sample])
% sorting bursts in chronological order
if (~isempty(BDTrains))
BDTrainsSorted = sortrows(BDTrains,2);
tsBE = BDTrainsSorted... |
c5e99a6f1a76a8fed5167439ac895219bfb54c2dfc2bb78659134982b619f1a6 | MATLAB | 2,105 | 63 | % Author: Zachary Chiang, Buenrostro Lab, Harvard University
% Uses cross correlation to register one stack to another in x, y, and z
function[stackBr] = simple_offset_xyz(stackA, stackB)
% handle stacks with different numbers of z-planes
if size(stackA,3) < size(stackB,3)
new_stackA = zeros(size... |
60d89f219d10148c7a36eaaed9d0f76041a9c71c37d4d62b2e66efdd4d3e916c | MATLAB | 2,107 | 51 | function TR_PlateDiameter(RGapp, displayH)
% enter external plate diameter in mm (current plates 55 mm)
% Select image of plate from above at the same settings in which the
% videos are taken
% find bounding box of circle and extract diameter in pixels from that
% calculate and return mm per pixel
% TREX provides X-Y... |
45172c1f4d422b4b115eeb64a034169705d145042d5cc0dcf1ffc460c1b9407e | MATLAB | 2,109 | 57 | function [TKenergy]=TKEO(x)
%
%% Utility function to calculate measures based on the nonlinear energy operator
%
% Function to estimate the TKEO of input data, follows the classical rule
% of Teager and Kaiser
%
% Inputs: x -> any time-series signal (vector)
%
% ====================================... |
c30f5556204fe258ca00421ed251cc1af8d2fd9104d966f8c403cfe1b14f8e23 | MATLAB | 2,109 | 80 | function res = networkstim_audiotrigger(pairs, ntrials)
cerestim = BStimulator();
connx = connect(cerestim);
if connx < 0
error('Can''t connect to cerestim')
end
filename = datestr(now);
filename = strrep(filename,' ','_');
filename = strrep(filename,':','-');
logfile = fopen(['C:/Stimulation/ORNet... |
fa0fe039745719c35bf557426255e0aa3f916cc23c5c96031f78cc9d000cebdf | MATLAB | 2,110 | 111 | % script for quick plots of average leg steps, FicTrac, iInj data
dataPath = '/Users/hyang/Dropbox (HMS)/EphysAnalysis-Helen/AnalyzedData/220922_iInj/220922_iInj_cond_0msStart_200msWin_l-40yawVel';
%
datNames = {'220912_fly02_avgLegStepsFictracEphysIinj_s-1_cond.mat',...
'220912_fly02_avgLegStepsFictracEphysIinj... |
7875a17073b14e64b45a495f38590ec230ef4f04dee3eeb2e2b313522c475e6d | MATLAB | 2,114 | 96 | function change_format_all_datasets
all_folders=dir('Glu*');
%total_units=0;
for f=1:size(all_folders,1)
f
cd(all_folders(f).name)
Data=Change_format_dataset;
%% check that the total number of units is correct N=33;
%total_units=total_units+size(unit,2);
cd ..
save([all_folders(f).name '.mat... |
5af7633ab8dd6f5461888ab459f357ea47416c4aceedc82131319937b6f5ba2b | MATLAB | 2,115 | 47 | function export_pytorch_fixture(input_image, V, PCANet, bestWaveletsAll, param, file_name)
% Export one PREPROCESSED image and exact learned filters for Python checking.
%
% Run from the original MATLAB workspace after training, with its folders on path:
% export_pytorch_fixture(imagesCellTest{1}, V, PCANet, ...
% ... |
6598d79ac9ebf3681357e52cc67a7261721dc7b1be4ea64764f4ce27a2c7934e | MATLAB | 2,115 | 31 | sBA = % every sBA struct is for one tracked period. can be several sBAs for the same movie
% Kinem vectors:
position_x: [14600x1 single] % in goodStamp (relative to goodFirst)
position_y: [14600x1 single] % in goodStamp (relative to goodFirst)
distance: [14599x1 single... |
1cfbbf093551da27774e98f3e464f7bc1952b1fe4851dae8f86a68e209b1bd2b | MATLAB | 2,116 | 36 | function bemf1_fullmodel_graphic(COpar,P,t,Indicator)
%%% head model graphics
t0 = t(Indicator==1, :); % skin here (change indicator if necessary)
str.EdgeColor = 'none'; str.FaceColor = [1 0.75 0.65]; str.FaceAlpha = 0.6;
bemf2_graphics_base(P, t0, str);
t1 = t(Indicator==2, :); % skull here (change indicator ... |
d66b07f339db4d2c2562329df972f8302914d20b44c5004af93cdcb8826826e6 | MATLAB | 2,117 | 79 | %% LOAD
load('ds_events.mat')
[outcomes] = get_pop_sparseness(ds_events,2);
%%
starts=-99:1:100;
bin=30;
ends=zeros(1,length(starts))+bin;
timepoints=[starts;ends];
t=100;
type='peak';
param(1).type=type;param(1).stat='avg';param(1).extype='ratio';param(1).exthresh= 2;
d=10;
[X,Y] = get_classification_var(timepoint... |
3efd04b74003f2a4ee3ba937f7a00a9028a3d0ca329cf2bede8fc74e45496e08 | MATLAB | 2,118 | 65 | clear
Stim_sort=[]; Lick_sort=[];
k=1;
file=dir('ACC*stable*.mat');
for jj=1:length(file)
load(file(jj).name)
totalevent=sort([Events.C1S3;Events.C1S5]);
hit=find(outcome(:,1)==1);
for i=1:length(hit)
cuetime=totalevent(hit(i),1);
tp=find(Events.IN1>=cuetime & Events.IN1<=c... |
2da918a28e94b646c7a19d1f87e5da87cd34884108cff8fb9c3c502f14bce849 | MATLAB | 2,119 | 61 | % saveFictracImgCount.m
%
% Function to run on FicTrac computer to record the start and end frame
% numbers for FicTrac video.
% Saves start and end frame counts into .mat file named with corresponding
% trial names (user specified, should match trial names from main
% experimental code (runEphysExpt() calls)
% Also... |
7f787aee25f77812bbc2627f0f57c5481209e5b4ef9c58de236210bd1021640a | MATLAB | 2,121 | 45 | function negLL = computeNegLL_Scz_factModel(phi,param)
%function computes negLogLikelihood(data,parameters) for BCI model, for use in BADS %%%%
iModel = param.iModel;
rADistrib = param.rADistrib;
rVDistrib = param.rVDistrib;
iSubj = param.iSubj;
whichSubj = param.whichSubj;
varFitA = param.varFitA;
varFitV... |
a031f1f68bd864f023d262b8d37de0adfc9c70a8905ea77955ddbf09b3df7e1b | MATLAB | 2,121 | 52 | function [location,location_env] = asCriteria(cond1, cond2, cond3, cond4, cond5, cond4_raw, maxDurStim, Delta_e, Delta_i, Iattn) %base on average of peak: (r,stimIn)
%asCriteria return the situation of criteria obeying
% return as= '' or 'asCriteria1/' or 'asCriteria2/' or 'asAllCriteria/'
% criteria1 is cond 1,... |
ab8f50baaaadf2ffc8d4b6df8d0f8965b43467d7120e87d13a8e671f71e31cb9 | MATLAB | 2,121 | 67 | function [elec] = read_brainvision_pos(filename);
% READ_BRAINVISION_POS reads electrode positions measured with the Polhemus
% tracker in one of the F.C. Donders EEG labs. The polhemus software is actually
% not from Brainvision.
%
% Use as:
% [elec] = read_brainvision_pos(filename)
%
% This returns an electrode s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.