sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
9a1274dcf2d28d848e79f584a67d5f8377fe884ad346f3de86351fbbaa801108 | MATLAB | 893 | 32 | function ds=surfing_eucldist(xs,ys)
% computes the euclidian distance between points
%
% DS=SURFING_EUCLDISTANCEFROM(XS,YS)
% INPUTS:
% XS: 3xP matrix for P coordinates
% YS: 3xQ matrix for Q coordinates
% OUTPUT
% DS: PxQ matrix, where DS(i,j) is the Euclidian distance between
% XS(:,i) and YS(:,i... |
b30852f2f9f2582a6b648c9d6bff102367575e75abcd2845cc2bc19683d51b23 | MATLAB | 893 | 21 | function [ Cells_coords, Pools_coords ] = Search_edos_coords( Cells_edos, sis_query, Coordactive )
%Encuentra las coordenadas de las celulas pertenecientes a cada estado y
%las coordenadas de los grupos base. Cells_coords son las coordenadas de
%cada estado [x,y,edo] Pools_coords [x,y,edo] Cells_edos: celulas de cada
%... |
beabcb2dae169937ee052ddf90c2149d491ecfd7f7e37280026caaa266682acc | MATLAB | 893 | 23 | %function ind = MS_nearest(x,tau,v);
%
% returns the row vector containing the indicies of the nearest
% neighbours to each of the columns of x. Each point and its tau
% temporal neighbours are excluded from the search.
% v is an array (not necessarily logical) indicating which columns of x to
% use or, the relative i... |
f1acd4f1c8cd2400638cddffaa8f3f413aba6ec6bfce262a4daa71aa58378769 | MATLAB | 893 | 20 | function fn = getFileName(params, filetype)
switch filetype
case 'ExpInfo'
fn = ['ExpInfo(' params.imtoken ')_' num2str(params.nums(1)) '-' num2str(params.nums(end)) '.mat'];
case 'WSData'
fn = ['WSData(' params.imtoken ')_' num2str(params.nums(1)) '-' num2str(params.nums(end)) '.mat'];... |
56eb047df0ebe55e345a758a345d53c357030dd8be87832723c16cb150fbc7c8 | MATLAB | 894 | 31 | clear all
clc
close all
% Parameters to be set
numiter=2000; % total number of simulation
gT1=1000:20:3000; % unit: ms; longitudinal relaxation time
TR=[5500 3000 1500 800 500 300]; % unit: ms; repetition time
noise=linspace(0,0.05,100); % normalized noise level
scale=size(TR);
fun = @(beta,x)(beta(1).*(1... |
3d58129c46d4f26f971c1736df7bd1cc2c52939f8065f0e06cb2620b64278bce | MATLAB | 895 | 36 | function [y] = ptvec2mat(x)
%PTVEC2MAT Convert vector output to matrix format.
% Y = PTVEC2MAT(X) returns a matrix Y by rearranging the values in vector
% X according to their position as determined by PTPAIRCOLS. The values
% in X may represent the output of some statistical test between every
% pair of rows ... |
8b0c2c04efedb237cdb6afe6f495b57c984c5ee1a29504144fd0d08eac8cb2a0 | MATLAB | 895 | 36 | function [y] = ptvec2mat(x)
%PTVEC2MAT Convert vector output to matrix format.
% Y = PTVEC2MAT(X) returns a matrix Y by rearranging the values in vector
% X according to their position as determined by PTPAIRCOLS. The values
% in X may represent the output of some statistical test between every
% pair of rows ... |
b5a67da220f5ebb603efeafb25651c1e548d91b5d869e87dc2349741a7e4a69e | MATLAB | 895 | 21 | function xmax=chron_findpeaks(data,threshold)
% Helper function to find peaks in a given continuous valued time series x
% Usage: xmax=chron_findpeaks(data,threshold)
% Input:
% data (data in time x channels/trials form or a single vector)
% threshold (if specified returns locations of peaks at which data... |
eb33446bddacf2ac259555a5adfa8341b7ad3c1667bc598c336591327e4ad7a1 | MATLAB | 895 | 21 | function [approachfit, approachfitquality] = fitapproach (approachdata)
% fits the approachline currently linear
q=1;
while (q==1);
approachfit = fittype({'x','1'},'coefficients',{'a1','a2'});
options = fitoptions('Method','LinearLeastSquares');
[approachfit, approachfitquality] = fit(approachdata(:,1),ap... |
1254fc5a9adbc8f20ad0976bcd49b4c3a8a00c4aa01af949503fe435700512eb | MATLAB | 896 | 31 | function y = tapas_gaussian_obs_sim(r, infStates, p)
% Simulates observations with Gaussian noise
%
% --------------------------------------------------------------------------------------------------
% Copyright (C) 2012-2013 Christoph Mathys, TNU, UZH & ETHZ
%
% This file is part of the HGF toolbox, which is released... |
2866b0bef5288ac10f97822347afb93f5f37e213b4ab7fcd519701d120e331c5 | MATLAB | 896 | 32 | classdef (Abstract) FitnessFunction
% Fitness function that takes a Reservoir and returns a fitness score.
properties (Abstract)
Params % function parameter/ constants
Spec % function specification as string
end
methods
function obj = FitnessFu... |
4de72d79e687506d25b6628cddd851e42c1b2fe47710dc279664b217136e4adc | MATLAB | 896 | 32 | function essential_distMinAnglePair_test
resetRands(3)
flagDegenerateCase=true;
k=2;
e3=[0;0;1];
Q1=rot_randn([],[],2);
if flagDegenerateCase
Q1b=[Q1(:,:,1);Q1(:,:,2)];
Q2b=essential_randomVerticalMotion(Q1b);
Q2=cat(3,Q2b(1:3,:),Q2b(4:6,:));
else
Q2=rot_randn([],[],2);
end
Rzt=@(t) rot(t*e3);
Q21tk=@... |
d0ce153e1871cbac59cd031b39a83ec28ee73b645191c024ca7a5ea1a87f7cc9 | MATLAB | 897 | 25 | %{
rf.Eye (imported) # eye velocity and timestamps
-> rf.Scan
---
eye_roi : tinyblob # manual roi containing eye in full-size movie
eye_total_frames=NULL : int # total number of frames in movie.
eye_time : longblob ... |
15ef65ef1164c864659c80d90fcb2aac4fa155e645337f40209d9548b9617ed9 | MATLAB | 898 | 25 | % Deal with merging fMRI data from partial sessions.
cd /home/surly-raid1/kendrick-data/nsd/ppdata/-NSD929-nsd02/ % DATE CENSORED
%%%%% preprocessVER1
a1 = load_untouch_nii('preprocessVER1/run04.nii');
a2 = load_untouch_nii('preprocessVER1/run05.nii');
% 50 trials from run04a; ignore first 3 blank trials from run0... |
55ca18e6b21aabf16815925e531332c3811cab450e4dedf8cedc59a872f3b5ea | MATLAB | 898 | 31 | clear all
clc
close all
% Parameters to be set
numiter=2000; % total number of simulation
gT2=20:0.5:60; % unit: ms; longitudinal relaxation time
TE=[7.5:7.5:150]; % unit: ms; repetition time
noise=linspace(0,0.05,100); % normalized noise level
scale=size(TE);
fun = @(beta,x)(beta(1).*exp(-x./b... |
c6b84cf1202341a378c2fe8e7f5e65639a6970d88ccd512b30ff404e5db051f1 | MATLAB | 898 | 36 | function [y1,y2] = ptpaircols(x)
%PTPAIRCOLS Pair matrix columns and output as two separate matrices.
% [Y1,Y2] = PTPAIRCOLS(X) returns matrices Y1 and Y2 whose paired columns
% correspond to every combination of column pairs in X. For efficiency,
% repeated column pairs are skipped.
%
% See also PTVEC2MAT.
%
... |
d4499b2007f1a8c32a52e7017db72437f833cdbf043448a1abf5b01daca535bc | MATLAB | 898 | 19 | % calculate scale in x and y
function [pixelsize_x, pixelsize_y] = pixelsize_xy(zoom,width,width_undistored)
% Look-up-table, measured on the 14-01-2014 by moving the xy-stage using a fluorescent sample
% zsLUT = [1 870 934 ; 2 432 462; 3 283 302; 4 214 226; 8 111 120];
zsLUT = [1 913 944 ; 2 450 478; 3 307 319; 4 232... |
da0459e799702c7c8db832fb190fbe35afbbf9d261a99269ebcb3be8555443d7 | MATLAB | 898 | 36 | function [y1,y2] = ptpaircols(x)
%PTPAIRCOLS Pair matrix columns and output as two separate matrices.
% [Y1,Y2] = PTPAIRCOLS(X) returns matrices Y1 and Y2 whose paired columns
% correspond to every combination of column pairs in X. For efficiency,
% repeated column pairs are skipped.
%
% See also PTVEC2MAT.
%
... |
11b73d5a811abe78a7e344a2ad038584f00b7ebc805c4f0d19295759c5d9f506 | MATLAB | 899 | 26 | function pstruct = tapas_ehgf_namep(pvec)
% --------------------------------------------------------------------------------------------------
% Copyright (C) 2012-2020 Christoph Mathys, TNU, UZH & ETHZ
%
% This file is part of the HGF toolbox, which is released under the terms of the GNU General Public
% Licence (GPL)... |
4cd82df270877eed813e6402e99ea0f0b54eed116893dbdc0b9db1777a7328d6 | MATLAB | 899 | 30 | function osp_check_specsOvPlot_Call(src,~,gui)
%% osp_check_specsOvPlot_Call
% This function is triggered when Grand Mean is checked on the Specs
% Window
%
%
% USAGE:
% osp_pop_specsOvPlot_Call(src,~,gui);
%
% INPUT: src = handle of the fit tabs
% gui = gui class containing all handl... |
5f96b0dd9828007c683b05c687c360d2f24687e9eec48a7a54e07ec85ce0e773 | MATLAB | 899 | 58 | function M = crop(M,n,c)
% crop - crop an image to reduce its size
%
% M = crop(M,n,c);
%
% n is the new size of the image
% c is the center of the grop
%
% Copyright (c) 2007 Gabriel Peyre
n0 = size(M);
n0(3) = size(M,3);
d = 2;
if size(M,3)>3
% multi-dimensional array
d = 3;
end
if nargin<2
n ... |
687ef40f6beaf740b4f89718c3f8e345ecae8e3410fa89f811a0db3b4306a284 | MATLAB | 899 | 41 | function [ x, u ] = optimalControlContinuous( A, B, rho, x0, xT, T )
nStep = 1000;
p = size(A,1);
% redefine the variables and reduce the equation to stardard linear
% equations
I = eye(p);
A_tilde = [A, -1.0/(2*rho)*(B*B');-2*I, -A'];
b = [zeros(p);I]*2*xT;
b_tilde = A_tilde\b;
b1 = b_tilde(1:p); b2 = b_tilde(p+1:end... |
df517ecde328a8e48877130469edede76fd89a274a2183f428d7d465dc8d5687 | MATLAB | 899 | 30 | function esportspect_Callback(hObject, eventdata, handles)
% Plotting Defferntial Expression
[~,detectionName] = fileparts(handles.current_detection_file);
spectname = [detectionName ' Call ' num2str(handles.data.currentcall) '.png'];
[FileName,PathName] = uiputfile(spectname,'Save Spectrogram');
% Cancel if cancelle... |
12d3632a06274506bcda0c9ccd89b384125c58e311d2c7654e31d4d54df1c317 | MATLAB | 900 | 30 | function exesuff=fallbackexeext(exesuffix, exename)
%
% exesuff=fallbackexeext(exesuffix, exename)
%
% get the fallback external tool extension names for the current platform
%
% author: Qianqian Fang, <q.fang at neu.edu>
%
% input:
% exesuffix: the output executable suffix from getexeext
% exename: the executa... |
4e4fba4f627424f45578c63565091d6c243a8454f61ae4dba9ce24c03dcabe17 | MATLAB | 900 | 37 | function vl_test_imreadjpeg
% VL_TEST_IMREADJPEG
% Test basic file reading capability
for t=1:6
files{t} = which(sprintf('office_%d.jpg', t)) ;
end
ims = vl_imreadjpeg(files) ;
% Test inserting a non-image file
files_ = files ;
files_{3} = [mfilename('fullpath') '.m'];
ims_ = vl_imreadjpeg(files_) ;
for t=setdiff(1... |
e3ce09476159def59ca88136eca0838cbeade4be67d0789d55e558ae497d9a1a | MATLAB | 900 | 31 | classdef MaxPSMaxPE < FitnessFunction
% Fitness function for maximizing P(success) and P(emergence).
properties
Params = struct('alpha', 0.5);
Spec = '%0.2f*P(S)+(1-%0.2f)*P(E)';
end
methods
function obj = MaxPSMaxPE(varargin)
% Constructor.
obj@... |
1ab684361f905896a148d2a85de632342566823069474f0d668b289d2a85d1dc | MATLAB | 901 | 36 | function this = load_data(this)
%ONE_LINE_DESCRIPTION
%
% Y = MrRoi()
% Y.load_data(inputs)
%
% This is a method of class MrRoi.
%
% IN
%
% OUT
%
% EXAMPLE
% load_data
%
% See also MrRoi
% Author: Saskia Bollmann & Lars Kasper
% Created: 2014-11-21
% Copyright (C) 2014 Institute for Biomedical Engineering
%... |
3f221e4b2c0bcbdb9f8db4ba7bc9a8f11e2449ced131246ca5fe81d88d9657a0 | MATLAB | 901 | 42 | function [fam_out] = fam_statistic(hsi_img,tgt_sig)
%
%function [fam_out] = fam_statistic(hsi_img,tgt_sig)
%
% False Alarm Mitigation Statistic from Subpixel Replacement Model
%
% inputs:
% hsi_image - n_row x n_col x n_band hyperspectral image
% tgt_sig - target signature (n_band x 1 - column vector)
%
% outputs:
% ... |
6224c525d54193ba160a4edeff9f6a41a4c6609e871df43684f93afd05a6f4ee | MATLAB | 902 | 26 | function pstruct = tapas_hgf_namep(pvec)
% --------------------------------------------------------------------------------------------------
% Copyright (C) 2012-2013 Christoph Mathys, TNU, UZH & ETHZ
%
% This file is part of the HGF toolbox, which is released under the terms of the GNU General Public
% Licence (GPL),... |
cbb5ced95511bb2a3afd266b9337c588923c80066770fae611aeb20e024bfc9e | MATLAB | 902 | 28 | %% [RDF] = Wrapper_BFR_PDF(totalField,mask,matrixSize,voxelSize,algorParam, headerAndExtraData)
%
% Input
% --------------
% totalField : total field map (background + tissue fields), in Hz
% mask : signal mask
% matrixSize : size of the input image
% voxelSize : spatial resolution of each dimension ... |
165614349190c59b9747dce9a25d36d840b574b94a1f95dfe6e3333bd551d22c | MATLAB | 903 | 51 |
root='F:\TEMPO2D_raw\Spikes';
mouse=[78 81 82];
date=[20200130 20200131];
for m=2%1:3
for d=2%1:2
path=fullfile(root,strcat('m',num2str(mouse(m))),num2str(date(d)));
cd(path)
end
end
%%
clear; clc;
path = 'F:\TEMPO2D_raw\Spikes\m81\20200131\meas03\converted\spike-ace-varnam-laser561nm-fov1-1khz... |
367c68f99eaf0689bf9d4c14834e405cdcb80ba3441182e886de9cd392216d75 | MATLAB | 903 | 31 | function osp_RawTabChangeFcn(src,~,gui)
%% osp_RawTabChangeFcn
% This function is triggered when the raw tab is changed. It refreshes
% the figure.
%
%
% USAGE:
% osp_RawTabChangeFcn(src,~,gui);
%
% INPUT: src = handle of the fit tabs
% gui = gui class containing all handles and the M... |
70a07a4709d31876b660d97cbdabfb7b10a2c33d55f6997483def08072da1455 | MATLAB | 903 | 18 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% reconstructFromHalfFourier %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [im,imf] = reconstructFromHalfFourier(d)
d.halfFourier = d.mag.*(cos(d.phase)+1i*sin(d.phase));
% first make the last column of the half fourier space which includes
% the dc and should have... |
e528c96e5ecc24a8646f5df605f9738a9fc86dcb9f5ed4a618600d20875295a4 | MATLAB | 903 | 32 | function s = semedian(x,dim)
%semedian - Compute standard error of the median, ignoring NaNs.
%
% USAGE
%
% s = semedian(x)
%
% x vector or matrix over which the error should be computed
% dim optionally, dimension along which to operate, default
% is first dimension... |
f75ebbd03f2e3ed7ca17d83f12226e3ec987e248b7346933c05e0a6f954ea78a | MATLAB | 903 | 37 | function [status,output] = call_fsl(cmd)
% [status, output] = call_fsl(cmd)
%
% Wrapper around calls to FSL binaries
% clears LD_LIBRARY_PATH and ensures
% the FSL envrionment variables have been
% set up
% Debian/Ubuntu users should uncomment as
% indicated
fsldir=getenv('FSLDIR');
% Debian/Ubuntu - uncomment the f... |
fdf12dde1594549bdc77625a36ffa818787519077969f04822ae1196c83ba6c4 | MATLAB | 903 | 41 | function [r mu] = circ_axialmean(alphas, m, dim)
%
% mu = circ_axialmean(alpha, w)
% Computes the mean direction for circular data with axial
% correction.
%
% Input:
% alpha sample of angles in radians
% [m axial correction (2,3,4,...)]
% [dim statistic computed along this dimension, 1]
%
% ... |
0260369c8125ed89e1382b45263d8303569877d4d7f59121b24f834e2f7d6de8 | MATLAB | 904 | 38 | function [StimValInit, MaxTtest, InitGuess] = GetParams(stimdur)
MaxTtest = log10(100);
StimValInit = 80;
InitGuess = 25;
%{
if stimdist == 2000
if stimdur == 0.167
MaxTtest = log10(14000)
StimValInit = 13300;
InitGuess = 7000;
elseif stimdur == 0.500
MaxTtest = ... |
ede21d9cae13af215040c8bac0e61d8ea318d59daba2080a3667cc352a06bd60 | MATLAB | 904 | 22 | function [pvec, pstruct] = tapas_sutton_k1_binary_transp(r, ptrans)
% --------------------------------------------------------------------------------------------------
% Copyright (C) 2013 Christoph Mathys, TNU, UZH & ETHZ
%
% This file is part of the HGF toolbox, which is released under the terms of the GNU General P... |
a54cf9eba27c0b9313813eeee864f3619c1f90dc8b9469b653aba93b5a6ef68a | MATLAB | 905 | 40 | function [err, XYZ] = AfniIndex2AfniXYZ (Indx, Nxx, Nyy)
%
% [err, XYZ] = AfniIndex2AfniXYZ (Indx, Nxx, Nyy);
%
% Returns the XYZ coordinates of an AFNI voxel with
% an AFNI index of Indx
%
% Indx : Nx1 vector containing the AFNI indices
% Indx must be an integer vector. If it is not, it's values
% are rounded... |
6ea67bdd744320ba82bc6e8c8f21d00430ddda81ba2986e85af93dfbab60d9f6 | MATLAB | 906 | 34 | function osp_WindowKeyUp(~,~,gui)
%% osp_WindowKeyUp
% This function is triggered when a key is released. It refreshes
% the the listbox.
%
%
% USAGE:
% osp_WindowKeyUp(~,~,gui);
%
% INPUT:
% gui = gui class containing all handles and the MRSCont
%
%
% AUTHORS:
% Dr. ... |
c069533d5abd7f3d99e9fe0bb8ec136718463c19d7cdb6276a8b0c96c709710a | MATLAB | 906 | 30 | function osp_check_meanOvPlot_Call(src,~,gui)
%% osp_check_meanOvPlot_Call
% This function is triggered when the Grand Mean is checked on the mean
% overview window
%
%
% USAGE:
% osp_pop_meanOvPlot_Call(src,~,gui);
%
% INPUT: src = handle of the fit tabs
% gui = gui class containing ... |
e0a673920a7fb5a5061ca7c0f18d205f535de23385d1d9d780be86b8b4695cde | MATLAB | 906 | 31 | classdef MinLossMaxPsi < FitnessFunction
% Fitness function for minimizing loss and maximizing psi.
properties
Params = struct('alpha', 0.5);
Spec = '-%0.2f*loss+(1-%0.2f)*psi';
end
methods
function obj = MinLossMaxPsi(varargin)
% Constructor.
ob... |
4417ddbe6a43df1b6855cf840acf173e51686f1f685f211b9b2f0c081982d439 | MATLAB | 908 | 33 | function [version] = hasricoh(desired)
%% HASRICOH tests whether the official toolbox for RICOH MEG systems by
%% Ricoh Company, Ltd. is installed or not.
%% Use as
%% string = hasricoh;
%% which returns a string describing the toolbox version '1.0'.
%% An empty string is returned if the toolbox is not installed.
%... |
8a30863c9162ed45a4f29cad51346db885c25ec509aa541fca7e4c2491cef38c | MATLAB | 908 | 28 | function [smf_out,mu,siginv] = smf_detector(hsi_img,tgt_sig,mask,mu,siginv)
%
%function [smf_out,mu,siginv] = smf_detector(hsi_img,tgt_sig,mask,mu,siginv)
%
% Spectral Matched Filter
%
% inputs:
% hsi_image - n_row x n_col x n_band hyperspectral image
% tgt_sig - target signature (n_band x 1 - column vector)
% mask ... |
a7928206aa6ccacf41d5be35668828c8de66df22d72b1855f73c85529f4e6eed | MATLAB | 908 | 29 | % (C) Copyright 2020 CPP visual motion localizer developpers
function varargout = postInitializationSetup(varargin)
% varargout = postInitializatinSetup(varargin)
% generic function to finalize some set up after psychtoolbox has been
% initialized
cfg = deal(varargin{:});
cfg.dot.matrixWidth = c... |
cbfbdaccbcf1ebf584489aca0e98ae46e7b6a697d1aeb16e613ec431fdd0f0b3 | MATLAB | 908 | 34 | clear all
clc
close all
% Parameters used in the simulation
T2=36; % unit: ms; T2 of global brain tissue
fun=@(beta,x)(beta(1).*exp(-x./beta(2))); % fitting equation
TEnum=2:40; % total number of TE
TErange=(1:0.1:5.0)*T2; % dynamic range of TE
niter=20; % iteration number
noise=1/... |
247451dfce663514983468e3143955574358ac07e6861403f8c108104a0ff1c4 | MATLAB | 909 | 25 | function vl_setupnn()
%VL_SETUPNN Setup the MatConvNet toolbox.
% VL_SETUPNN() function adds the MatConvNet toolbox to MATLAB path.
% Copyright (C) 2014-15 Andrea Vedaldi.
% All rights reserved.
%
% This file is part of the VLFeat library and is made available under
% the terms of the BSD license (see the COPYING fi... |
329b49a3f75fc948fd363ebbf293a0039b75388ab13457c535cdf6aae4c49c55 | MATLAB | 909 | 27 | function [pvalue, permute_dist] = permute_test(a, b, numsamps, varargin)
%non-parametric permutation test for comparing values in a and b (a and b are column vectors).
%numsamps is the number of permutations. 100 or 1000 are reasonable. cmc 5/13/20
% a should still be the data with fewer samples
if isempty(varargin)
... |
1651e86195a73e42d9241af52dbb88539dae448de3616b5145972c3161902fd2 | MATLAB | 910 | 37 | function [] = label_ps( ps, yoffset,x_positions, Fs )
if ~exist('x_positions','var') || isempty(x_positions)
x_positions = 1:numel(ps);
end
if ~exist('Fs','var') || isempty(Fs)
Fs=10;
end
if ~exist('yoffset','var')
ylim_temp = get(gca,'YLim');
yoffset = ylim_temp(2... |
4ca73bc51aa2d488bb96290dba2c63a52cde162b1ede60a1034e55cf53594d57 | MATLAB | 910 | 35 | function [ output_args ] = print_timeinterval( dT )
%PRINT_TIMEINTERVAL( dT ) Prints time-interval in optimal units.
%
% INPUT:
% dT [scalar]: time interval in seconds
%
%
% === Jan Moelter, The University of Queensland, 2017 ===================
%
dTx = timevec( dT );
switch( find( dTx , 1 ) )
case 1
output_... |
861edefe29a67a2c0ce0d21709aadbb887cb61f09306a18a27c7fb5ba46c7c0b | MATLAB | 910 | 19 | clear all, close all, nit = 50; % tabular rasa, max number of fun/grad evals
n = 300; x = 10*sort(rand(n,1)); % sample data
sn = 0.2; y = sin(x)+sqrt(x) + randn(n,1)*sn;
cov = {@covSEiso}; sf = 1; ell = 0.4; hyp0.cov = log([ell;sf]); % covariance
mean = {@meanSum,{@meanLine... |
ae27d60f15e1a46f064d6da7c9eb3981aaf19527a0342d4a06e5c2c2b4a7bd21 | MATLAB | 910 | 42 | %% op_findMax.m
%
% This function finds maximum value in the FD for all subspectra.
%
%
% USAGE:
% out=op_findMax(in,abs);
%
% INPUT:
% in = data in FID-A struct format
% abs = absolute values flag
%
%
% AUTHORS:
% Dr. Helge Zoellner (Johns Hopkins University, 2020... |
714bab1a1102f3f33aabff305e850b1aadeb945322bd7261ce5286d16787c90f | MATLAB | 911 | 27 | function [optiVect]=findBestPartition(FULL_DIM,DESIRED_CHUNK_SIZE)
% [optiVect]=findBestPartition(FULL_DIM,DESIRED_PART)
% Find the best, harmonious chunking (spatial or temporal).
% FULL_DIM: movie length, or 1 frame dimension
% DESIRED_CHUNK_SIZE: size of the chunk (obviously, should be less than FULL_DIM)
% options.... |
85bd87b2874b51ca612b5e3f0f1f722547188bf4f276da1c115b0f3d84113404 | MATLAB | 911 | 33 | function [AUCMean, AUCSEM] =...
DA_CPInByRPE(AUC, RPE, RPEBins, usethese, rpeBnd)
% DA_CPInByRPE - Calculates CPIn Response by RPE
% INPUTS:
% AUC - Trial-by-trial AUC response
% RPE - Trial-by-trial RPE
% RPEBins - bins for RPE discretization
% usethese - which trials to include
% rpeBnd - upper and lowe... |
c625a9ad22535ee7238b572222290715909d6f213965b660db7b788d744997dc | MATLAB | 911 | 30 | function plot_delta_rho(ax,rho,delta,cents,predbounds,ens_cols)
% Reference paper: Herzog et al. 2020 "Scalable and accurate automated method
% for neuronal ensemble detection in spiking neural networks"
% https://www.biorxiv.org/content/10.1101/2020.10.12.335901v1
% Rubén Herzog October 2020
[~,pred_id] = sort(predb... |
dac51b3e47af5b8bf2a5ef4faf4f3df89328fc6da40d9885e495849026f4e448 | MATLAB | 911 | 23 | function csv_data = pipelineReadCSV(spreadsheet_filename, csvRange)
%PIPELINEREADCSV Summary of this function goes here
% Detailed explanation goes here
opts = detectImportOptions(spreadsheet_filename);
opts.Delimiter = ',';
opts.VariableNamesLine = 1;
if length(opts.VariableTypes) < 3
csv... |
df6f775c9d183cb0cea861683eea6819bf5995bc4425d5cebe83bbea7607b696 | MATLAB | 911 | 26 | function save_avw_complex(img,fname,vsize)
% SAVE_AVW_COMPLEX(img,fname,vsize)
%
% Create and save an analyse header (.hdr) and image (.img) file
% for either a 2D or 3D or 4D array (automatically determined).
% Only for use with complex data. (uses avwcomplex)
%
% vsize is a vector [x y z tr] containing the vox... |
570d9d5da3e5b8fd3789ff62121736c0b8704903d2838359436e077bdf9c429b | MATLAB | 912 | 19 | function [infGrad, genGrad, contrastiveGrad] = FD_clVAE_combinedGradients(encoderNet, decoderNet, x, xPos, xNeg, beta, margin)
% VAE Loss
[z, zMean, zLogvar] = FD_clVAE_sampling(encoderNet, x);
xPred = sigmoid(forward(decoderNet, z));
vaeLoss = FD_clVAE_ELBOloss(x, xPred, zMean, zLogvar, beta);
... |
d33f2cf6ce0fdd94c323fba134526455332388bfe7101ff28d1cecb7bea36046 | MATLAB | 912 | 27 | %{
trk.Quality (computed) # quality assessment of tracking using Jake's tracked frames as ground truth
-> rf.Eye
---
pos_err : float # mean Euclidean distance between pupil positions
r_corr : float # correlation of radii
excess_fra... |
e8951fe13252638bd382940b33abc126fe1c5d80aff9f64be03e269421740518 | MATLAB | 912 | 23 | function binnedmatrix = toy_simulation(Network_opts,Assembly_opts)
% creating matrix
binnedmatrix=poissrnd(Network_opts.meanspikebin,[Network_opts.nneurons Network_opts.nbins]);
allassemblyneurons = unique([Assembly_opts.assembly_neurons{:}]);
nonassemblyneurons = setdiff(1:Network_opts.nneurons,allassemblyneurons);... |
2f0c54441a5c809b63acff518c42e28ed291f7aeff55e54797b053f801fe73b7 | MATLAB | 913 | 26 | %% saveFrameInfo
% Batch script to read the frame info from TDT binary and save it into mat file
basePath = 'D:\Data\Lobster\Lobster_Recording-200319-161008\Data';
outputBasePath = 'D:\Data\Lobster\FineDistanceDataset';
filelist = dir(basePath);
sessionPaths = regexp({filelist.name},'^#\S*','match');
sessionPaths = s... |
f23aea000c519a63dd7a0e76832f3c307814a73ae1cbd89132d3f15f11da14fd | MATLAB | 914 | 22 | function [verbose] = tapas_physio_plot_create_scan_timing_philips(t, y, ...
VOLLOCS, Ndummies, LOCS, LOC_END_MARKER)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
verbose.fig_handles(end+1) = tapas_physio_get_default_fig_params();
set(gcf,'Name', 'Sync: Thresholding Gradient for s... |
7d36f67a29e2d120642309ee0e15f08d886d9676ff0cd03f05ea71eff4c3351f | MATLAB | 915 | 32 | function y = tapas_gaussian_obs_offset_sim(r, infStates, p)
% Simulates observations with Gaussian noise
%
% --------------------------------------------------------------------------------------------------
% Copyright (C) 2018 Christoph Mathys, TNU, UZH & ETHZ
%
% This file is part of the HGF toolbox, which is releas... |
db59bd95dc9ed272d8603d056612eff52605afb3b7e76b6b5896ece4e4e245ce | MATLAB | 915 | 32 | function spikeTimesGrounded = groundSpikeTimes(spikeTimes, channels, electrodesToGround, useName)
%GROUNDSPIKETIMES Summary of this function goes here
% Detailed explanation goes here
if isstr(electrodesToGround)
groundElectrodeCell = strsplit(electrodesToGround,',');
groundElectrodeVec = str2double(groundE... |
21d4a5ec44926cb6e8227e7add1301b9ceae901d839c0941ac784f37dc807c02 | MATLAB | 916 | 22 | %{
monet.CaKinetics (lookup) # options for calcium response kinetics.
ca_kinetics : tinyint # calcium option number
-----
transient_shape : enum('exp','onAlpha') # calcium transient shape
latency = 0 : float # (s) assumed neural response latency
tau = -1 : float # (... |
3c04f1741e0469f93bcf564ffd424658b25613e4edc4dcdaedf0bc43a3719ee4 | MATLAB | 916 | 26 | function ProcessData_ExtendedData2(datadir, savedir, codedir)
%ProcessData_ExtendedData2 - Process raw data saved under datadir such that it can be plotted by PlotExtendedData2.
% INPUTS:
% datadir - Local directory where 'Golden_Nature/RawData_ExtendedData2.mat' from Zenodo was saved
% codedir - Local directory wh... |
c6fe23137ad9f182fa163ae2f894a9c0da66ebca473d5cbcdb5809e67e68c064 | MATLAB | 916 | 36 | %{
# Calcium activity for the whole scan (multiple scan fields)
-> `pipeline_experiment`.`scan`
-> `pipeline_shared`.`#pipeline_version`
-> `pipeline_shared`.`#segmentation_method`
-> `pipeline_shared`.`#spike_method`
---
-> fuse.Pipe
%}
classdef ScanDone < dj.Computed
methods(Access=protected)
function makeTupl... |
2990b1c3523d70044db03cdef2ae829e5e5e6c863502cc86d01e9d097123f6c3 | MATLAB | 917 | 38 | function [StimValInit, MaxTtest, InitGuess] = GetParams(stimdur)
MaxTtest = log10(240); % in arcsec
StimValInit = 240;
InitGuess = 60;
%{
if stimdist == 2000
if stimdur == 0.167
MaxTtest = log10(14000)
StimValInit = 13300;
InitGuess = 7000;
elseif stimdur == 0.500
... |
6495d4157554887f70ec3e2c38513bedba8499b5ff1806ee51c29ac745a70ba8 | MATLAB | 917 | 42 | %% op_findMax.m
%
% This function finds maximum value in the FD for all subspectra.
%
%
% USAGE:
% out=op_findMax(in,abs);
%
% INPUT:
% in = data in FID-A struct format
% abs = absolute values flag
%
%
% AUTHORS:
% Dr. Helge Zoellner (Johns Hopkins University, 2020... |
aa1d5932dea55222b50f2d13fe654774aff1e453d5d1675d6cdeda85e867cc0c | MATLAB | 917 | 42 | %% op_findMax.m
%
% This function finds maximum value in the FD for all subspectra.
%
%
% USAGE:
% out=op_findMax(in,abs);
%
% INPUT:
% in = data in FID-A struct format
% abs = absolute values flag
%
%
% AUTHORS:
% Dr. Helge Zoellner (Johns Hopkins University, 2020... |
b685611dbeaf1ea91f303d6fde527d9363c73b0dff5ea0fc652d57252226af4b | MATLAB | 917 | 22 | function [img_nii,bval_file,roi_nii] = getTestData
[d,~,~] = fileparts(which('getTestData'));
d1 = fileparts(d); % one level up
d2 = fileparts(d1); % two levels up
d3 = fileparts(d2); % three levels up
d4 = fileparts(d3); % three levels up
test_data_folder = fullfile(d4, 'download');
i... |
efc5c7842995c1a664a4794dd68ff70c9625ab23a120f35d15968bed0af32968 | MATLAB | 917 | 37 | function tapas_validate_model(model)
%% Verify that an object is complient with the specification.
%
% aponteeduardo@gmail.com
% copyright (C) 2016
%
if ~ isstruct(model)
error('tapas:validate:model', 'model is not a structure')
end
if ~ isfield(model, 'graph')
error('tapas:validate:model', 'model does not h... |
f9563ba3e1e45ddaab040f5534101800904023a456165a7214191172fe3e3ccb | MATLAB | 917 | 24 | %{
# unit type and coordinates in x, y, z
-> reso.ScanSetUnit
---
um_x : smallint # x-coordinate of centroid in motor coordinate system
um_y : smallint # y-coordinate of centroid in motor coordinate system
um_z ... |
1550ba6c9bf8afd478dd6fb7090ada6b2c5aac3ab0c9b9e243d2f81022c2c8c2 | MATLAB | 918 | 36 | function input = fixoldorg(input, revert)
% FIXOLDORG use "old/new" instead of "org/new"
if nargin<2
revert = false;
end
if ~(isstruct(input) && numel(input)==1)
% this does not look like a montage or a sensor description
return
end
if ~revert
from = {'labelorg', 'chantypeorg', 'chanunitorg', 'chanposorg', ... |
790d8c6e5f4175e52fa4407a046b6a0668494972a6e90aafd0b475b76e34501d | MATLAB | 918 | 24 | %{
# unit type, coordinates and delay time
-> meso.ScanSetUnit
---
um_x : smallint # x-coordinate of centroid in motor coordinate system
um_y : smallint # y-coordinate of centroid in motor coordinate system
um_z ... |
a42ac82efbae5ee0be15761ae57057533bcd91cf49e74491ba36d604a9b12142 | MATLAB | 918 | 35 | clear all
clc
close all
% Parameters used in the simulation
T1=2000; % unit: ms; T1 of global brain tissue
fun=@(beta,x)(beta(1).*(1-exp(-x./beta(2)))); % fitting equation
TRnum=2:40; % total number of TR
TRrange=(1:0.1:5.0)*T1; % dynamic range of TR
niter=20; % iteration number
no... |
bd383018deea824996b1a6a4bebbd5307a2e89e6f0041aedd9b98bb84820f69d | MATLAB | 918 | 30 | function grad = fixbalance(grad)
% FIXBALANCE ensures that the balancing representation in grad.balance or
% elec.balance field is up to date and consistent, specifically with the
% list of linear projections (or montages) being applied specified as
% cell-array in "current", and not as a string in "current" and cell-... |
3f93b6cd64746e52e3d844d38289b11e56370edb4c23396f6a52233d0da498ab | MATLAB | 919 | 32 | function test_suite = test_getDirectionBaseVectors %#ok<*STOUT>
% (C) Copyright 2021 CPP visual motion localizer developers
try % assignment of 'localfunctions' is necessary in Matlab >= 2016
test_functions = localfunctions(); %#ok<*NASGU>
catch % no problem; early Matlab versions can use initTestSu... |
44625478750201021632dfa06d1e752032a0201042d823e811c27c5ec5f55f91 | MATLAB | 920 | 55 | function [N] = WordCount (S,D)
%
% [N] = WordCount (S,[D])
%
%Purpose:
% Counts the number of words in S that are delimited by D
%
%
%Input Parameters:
% S a string, trailing blanks are removed
% D (optional) a series of characters to be used as delimiters like
% ' |' for a space or | as delimiters or '|' f... |
880515672f526b2409f005cdbda269bc2f1810c22d411d02bdf95d0f78099822 | MATLAB | 920 | 31 | function v = matrixlincomb(x, a1, d1, a2, d2) %#ok<INUSL>
% Linear combination function for tangent vectors represented as matrices.
%
% function v = lincomb(x, a1, d1)
% function v = lincomb(x, a1, d1, a2, d2)
%
% Given a point x, two tangent vectors d1 and d2 at x, and two real
% coefficients a1 and a2, returns a tan... |
954041483819c99494b429709e5394141da6e5915cc28b81fccc980f5e1bf524 | MATLAB | 920 | 54 | function vl_bench_bnorm(gpu)
if nargin < 1
gpu = false ;
end
T = 100 ;
x = randn(64,64,32,32,'single') ;
g = randn(32,1,'single') ;
b = randn(32,1,'single') ;
if gpu
x = gpuArray(x) ;
g = gpuArray(g) ;
b = gpuArray(b) ;
end
tic
for t=1:T
y = vl_nnbnorm(x,g,b) ;
end
if gpu,... |
a8f83a37598b433829715ffcc8c8440576025faaba8239b1fe1012fe24ddac1e | MATLAB | 920 | 42 | %% op_findMin.m
%
% This function finds minimum value in the FD for all subspectra.
%
%
% USAGE:
% out=op_findMin(in,abs);
%
% INPUT:
% in = data in FID-A struct format
% abs = absolute values flag
%
%
% AUTHORS:
% Dr. Helge Zoellner (Johns Hopkins Univer... |
274ca82ead6d125ad5ee769a2d1856c44105113eb1e977189e37f68f7a4b90ab | MATLAB | 921 | 28 | function [x_hist,y_hist,thr] = hist2d(xdata,ydata,nbins)
%%
% Reference paper: Herzog et al. 2020 "Scalable and accurate automated method
% for neuronal ensemble detection in spiking neural networks"
% https://www.biorxiv.org/content/10.1101/2020.10.12.335901v1
% Rubén Herzog October 2020
remids = isnan(xdata) | isnan... |
fe84116f7f3cd2e82eb76552658e4e413b57a6a84fa03fcdfc9ea7239014269a | MATLAB | 921 | 33 | function trials_shuffle = makeshuffle_balanced(Trials,seed)
% Trials
% varargin
% 1. average across many interations of shuffles
% rng(seed+6)
%combine the two variables
for i = 1:length(Trials)
equate = length(Trials{i,1})-length(Trials{i,2});
if equate>0
removethese = randperm(length(Trials{i,1}));
Trials{i,1}(... |
0220b27a083592dfdd21be8bb454a347ff24c7d63cf9be9bc4875da73702d570 | MATLAB | 922 | 40 | function m = nanreplace(m,val,mode)
% function m = nanreplace(m,val,mode)
%
% <m> is a matrix
% <val> (optional) is a scalar. default: 0.
% <mode> (optional) is
% 0 means replace all NaNs in <m> with <val>.
% 1 means if the first element of <m> is not finite (i.e. NaN, -Inf, Inf), fill entire matrix with <val>.
%... |
421866288bf31ac0821849122b6b406f47734b98347fae2c68f423ba08adba67 | MATLAB | 922 | 24 | function res = is_atom(x)
% Determine whether an expression can be further subdivided into parts
% literal matlab expressions (including matrices, most structs, strings, function_handles) are considered atomic
%
% The exceptions are:
% * struct with .head / .part fields (canonically represented expression)
% * s... |
57866a973826163f4dbb005ed3f424ab0f99614502e1dc291e5afe2917974ba7 | MATLAB | 922 | 26 | function pstruct = tapas_hgf_ar1_binary_mab_namep(pvec)
% --------------------------------------------------------------------------------------------------
% Copyright (C) 2017 Christoph Mathys, TNU, UZH & ETHZ
%
% This file is part of the HGF toolbox, which is released under the terms of the GNU General Public
% Lice... |
934d956f2e81be91a53b77987aca5832e5208a17d07246ead2ab6189ad51807d | MATLAB | 922 | 29 | function [no,el]=removeisolatednode(node,elem)
%
% [no,el]=removeisolatednode(node,elem)
%
% remove isolated nodes: nodes that are not included in any element
%
% author: Qianqian Fang, <q.fang at neu.edu>
%
% input:
% node: list of node coordinates
% elem: list of elements of the mesh
%
% output:
% no: nod... |
a895867b3e955c9e1d072b0aae73685c70c5765cb82323d3e17217d0aa1542c3 | MATLAB | 922 | 30 | function [MPfinal,Anglesfinal]=MeasuringPoints(radius,source,M,ds,op)
% Define number of measuring points
angles = linspace(0, 2*pi, 16);
% if op==6
% angles=linspace(0,1.5*pi,4);
% end
numbMP = length(angles);
% Preallocate memory and define parameters
x = zeros(... |
bd2799d782805a94aa2b90e74a869236de48c4c8350ea19918f64cad943f94ac | MATLAB | 922 | 29 | function eta_matrix=eta_calc_pair(input_matrixa,input_matrixb)
m=size(input_matrixa,2);
n=size(input_matrixb,2);
zmapa=input_matrixa;
zmapb=input_matrixb;
% calculate the eta
eta_matrix=zeros(m,n,'single');
meanzmapa=mean(zmapa);
meanzmapb=mean(zmapb);
for i=1:m
%i
for j=1:n
... |
ea9ee9fd83456cbc94f4c38e16ab6d7c167f406023a87b2bef9b65b69785bddc | MATLAB | 922 | 45 | %% function output = function_name(input)
%
% Usage:
%
% Input
% --------------
%
% Output
% --------------
%
% Description:
%
% Kwok-shing Chan @ DCCN
% k.chan@donders.ru.nl
% Date created:
% Date last modified:
%
%
function get_set_bfr_iharperella(h,mode,input)
str_pattern = {'.bfr.iteration'};
action_handle = {h... |
ff07ab0f7856340c9d7de29db7cd27e562ebccbb7a5e86916b45ebe2e46697df | MATLAB | 922 | 24 | function [new_C]=ProjectCTensor(uf,vf,nf,Old_C,up,vp)
%{ Summary: ProjectCurvatureTensor performs a projection
%of the tensor variables to the vertexcoordinate system
%INPUT:
%uf,vf - face coordinate system
%old_c - face curvature tensor variables as a vector
%up,vp - vertex cordinate system
%OUTPUT:
%new_C - v... |
1946810911c964c8bab7daebe1cf70ba77ce21c3a3e070ec3c8f4aed81c1c3aa | MATLAB | 923 | 31 | function f = getfilter2(ii, oo, l_minus, l_plus)
%% Calcult the filter according to input, output and filter length
% deconvolution process
% the convolution is defined as: o = i * f;
% for discrete system, can be rewritten as o = I * f.
% o: a vector of output, subscript is from 't_plus' to the end
% I: a matrix of i... |
1b576059126ea94755f1d5ed63b242ca4b308d9cbb655bfd0260ca67c796c9ab | MATLAB | 923 | 21 | function SaveFig(filename)
%SaveFig - Save current figure in fig, svg, png, and pdf formats
%
% Copyright (C) 2018 by Ralitsa Todorova
%
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either v... |
2ab122d4f85a0dfe6a8a903355e77777eca3b155d4f59e8c16b6a2454de94278 | MATLAB | 923 | 24 | function candoit = canGetPartialEuclideanGradient(problem)
% Checks whether the partial Euclidean gradient can be computed for a problem.
%
% function candoit = canGetPartialEuclideanGradient(problem)
%
% Returns true if the partial Euclidean gradient of the cost function can
% be computed given the problem descriptio... |
5f5aac1daae3670fce8de9fa9ebc4a724011e662de2b57137df610bdfd778672 | MATLAB | 923 | 38 | function [v,s] = CircularVariance(angles,dim)
%CircularVariance - Estimate circular variance and standard deviation.
%
% USAGE
%
% [v,s] = CircularVariance(angles,dim)
%
% angles angles in radians
% dim optional dimension along which the mean should be computed
%
% OUTPUT
%
% v ... |
72681f2dfc8b69446e5a0c245249746dd0999370342dd7a704961026606b6206 | MATLAB | 923 | 26 | function pstruct = tapas_hgf_ar1_binary_namep(pvec)
% --------------------------------------------------------------------------------------------------
% Copyright (C) 2012-2013 Christoph Mathys, TNU, UZH & ETHZ
%
% This file is part of the HGF toolbox, which is released under the terms of the GNU General Public
% Lic... |
687218b9eeeeaac5587fcd3b5f86192b9467c2c9f752e95455f3b6b1eb35493c | MATLAB | 924 | 35 | function analyzebehavior_prf(datadir)
ppdir = regexprep(datadir,'rawdata','ppdata');
mkdirquiet(ppdir);
% define some constants
deltatime = 1; % holding the key down for less than this time will be counted as one button press
badkey = {'5' 't'};
deltatimeBAD = 0.1;
% load behavioral files
stimulusfiles = matchfil... |
9beeaa21f003befebfe42a084d8a04fc4d12a52d4062bd7f4afe82d847831572 | MATLAB | 924 | 39 | function [m,r] = CircularMean(angles,dim)
%CircularMean - Estimate the circular mean.
%
% USAGE
%
% [m,r] = CircularMean(angles,dim)
%
% angles angles in radians
% dim optional dimension along which the mean should be computed
%
% OUTPUT
%
% m mean angle
% r ... |
be3a7502d7edfe417e47b19ecb1f730cd522a39c0e9cbf8b0452ec735b4b398f | MATLAB | 924 | 35 | function axislabel_translation_slider
% Create UI figure window and components
global AXISALIGN_TRANS_A AXISALIGN_TRANS_B
if isempty(AXISALIGN_TRANS_A), AXISALIGN_TRANS_A = 1; end
if isempty(AXISALIGN_TRANS_B), AXISALIGN_TRANS_B = 1; end
h_f = uifigure('Position',[100 100 350 275]);
% cg = uigauge(fig,'Position',[10... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.