sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
a57028eeca1737c1848cbe99e1c85f8ff84958d482d0123b33623660cbe6010e
MATLAB
712
40
function x = zef_QinvMQ(x,Q_1,Q_2,Q_3,M,tol,maxit,DM,use_gpu) if use_gpu x = gpuArray(x); Q_1 = gpuArray(Q_1); Q_2 = gpuArray(Q_2); Q_3 = gpuArray(Q_3); M = gpuArray(M); DM = gpuArray(DM); end x_1 = Q_1*x; x_2 = Q_2*x; x_3 = Q_3*x; if use_gpu [x_1] = pcg_iteration_gpu(M,x_1,tol,maxit,DM,x...
c547ce44e667be120fdde5d14995be627561ce806b540077e680c40a9a44c05b
MATLAB
712
19
function [model_collection,params] = estimate_parameters_collection_implementation(params,models) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Default Function for Parameter Estimation % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
d86734fefd4ac1131ff96eb98e90c0e3efa2bfc9ff0a6f4a799af260d4b98940
MATLAB
713
23
function c = redwhite(m) %REDBLUE Shades of red and blue color map % REDBLUE(M), is an M-by-3 matrix that defines a colormap. % The colors begin with bright blue, range through shades of % blue to white, and then through shades of red to bright red. % REDBLUE, by itself, is the same length as the curren...
2c15bb743ef1b6ebf5187add8508081d4a27903832b2d53401c9e6df09b0e005
MATLAB
714
30
function colorscale_val = zef_update_colorscale(varargin) if isequal(evalin('caller','exist(''zef'')'),1) zef = evalin('caller','zef'); else zef = evalin('base','zef'); end if not(isempty(varargin)) h_figure = varargin{1}; else h_figure = eval('zef.h_zeffiro'); end h = findobj(get(h_figure,'Children...
bc1f661c06551023083ef4a9b5a23627149ddb6c26ba6896495e34f63b7f91d8
MATLAB
714
23
function c = bluewhite(m) %REDBLUE Shades of red and blue color map % REDBLUE(M), is an M-by-3 matrix that defines a colormap. % The colors begin with bright blue, range through shades of % blue to white, and then through shades of red to bright red. % REDBLUE, by itself, is the same length as the curre...
beb901ee88966a5e05e79b7e80aaaf1f46c96ee8e1368c84c9ab73501bc16805
MATLAB
714
25
function p = kolmpdf(x) % KOLMPDF Kolmogorov probability distribution function (pdf). % P = KOLMPDF(X) computes the Kolmogorov pdf at the values in X. % % The size of P is the common size of X. A scalar input % functions as a constant matrix of the same size as the other inputs. % Author: Sergiy Iglin %...
d58514bd243d7e7616d77fe600c7888c413e305907f41d8a38acafdf4726b04c
MATLAB
715
35
% OV_MATLAB toolkit % OV_createBoxInstance.m % ------------------------------- % Author : Laurent Bonnet (INRIA) % Date : 28/07/2011 % % This file is meant to be executed prior to any user defined script. % It construct the objects used by the other functions of the toolkit % MEANT TO BE USED BY OPENVIBE % %out fu...
9b9109c9a978f563bd4c1e2dc4a702fff4aba99bdc9384571be3668e080b1058
MATLAB
716
22
function CovMats = getCovMats(X,T,maxlag,partial,Flips) % Get the autocorrelation matrices up to lag maxlag, for each trial N = length(T); ndim = size(X,2); if nargin<5, Flips = zeros(N,ndim); end CovMats = zeros(ndim,ndim,2*maxlag+1,N); eps = 1e-8; t0 = 0; for j = 1:N t1 = t0 + T(j); Xj = X(t0+1:t1,:); t0 = t...
75432d018ed7ed822790318e1d8d296c911b0dfe9a91493d3c3b3b46cb247e66
MATLAB
717
26
function compartment_tag = zef_find_compartment(property_name,property_value) compartment_tags = evalin('base','zef.compartment_tags'); compartment_tag = ''; compartment_found = 0; compartment_counter = 0; if ischar(property_value) property_value = ['''' property_value '''']; else property_value = char(strin...
8001443b9eaad6f00e55859a5ca91983cdd794e3c12c7c795c2ff0de3f81119b
MATLAB
717
27
function [wmean,wcov]=weightmecov(data,weights) %WEIGHTMECOV computes the reweighted mean and covariance matrix of multivariate data. % % Required input arguments: % data : data matrix % weights : weights of the observations % % This function is part of LIBRA: the Matlab Library for Robust Analysis, % availabl...
97b20985854400f95c51dda08f2dba24067d50552a558d711372cbfea9a2a881
MATLAB
717
13
zef.fields_to_be_removed = {'gpu_count','compartment_activity','start_mode','colormap_cell','path_cell','use_display','current_version','matfile_object','zeffiro_restart','verbose_mode','use_waitbar','zeffiro_task_id'}; zef.ini_cell = readcell([zef.program_path '/profile/zeffiro_interface.ini'],'FileType','text'); zef...
e166df9670ba95c9bf3ee61c76051aef514d9909783687625e8ca01102bf5368
MATLAB
719
29
function preview_s_lambda_button_pushed(app) sLambda = app.AddStructuresPreviewField.Value; temp_params = app.params; [temp_params] = addSpecificStructure(temp_params, sLambda); learned_structure = temp_params.learned_structures{end}; xLimits = [1 size(learned_structure,1)]; yLimits = [1 size(learned_structure,2)...
0a68502d105bc21155f8ff3a17456a81abb60fa72652a77aecb3bd723ac59091
MATLAB
720
28
function nhist = spike_hist(fs_spike, Twin, Nmax, Nspike) % Poisson distribution histogram % spike_hist(fs_spike, Twin, Nmax, Nspike) % --- % fs_spike : spike firing freq [Hz] % Twin : time window length [sec] % --- optional % Nmax : max number of spikes in Twin % Nspike : total number of spikes %...
8869d351cfb2278d976da080183e4adf974dca98de82760ef59b75f378e50388
MATLAB
720
35
function [pruned_hmm,fe,fehist] = chain_dropstates(hmm,X,T,verbose) % pruned_hmm: best model of the chain % fe: free energy of pruned_hmm % fehist: history of all the chain K = length(hmm.state); fehist = []; fe = []; pruned_hmm = hmm; if nargin<4, verbose = 0; end if K==2 return end fe = Inf; for k = 1:K [...
d29aabc652907ca298e8b178d31bec6ae54fffcd57dd92d022ed1daf850ab2d5
MATLAB
720
25
% THIS FUNCTION IS PRIVATE AND SHOULD NOT BE CALLED BY OUTSIDE CODE! % function [res] = DoFastQueryCmd( sm, cmd ) ok = CalinsNetMex( 'sendstring', sm.handle, sprintf( '%s\n', cmd ) ); if( isempty( ok ) ) error( '[%s] error: cannot send string.', cmd ); end lines = CalinsNetMex( 'readlines', s...
d03bd359bdf1c4a9cfd5898c1a6a90e01760c192ff975a40f0f338353639c792
MATLAB
722
17
function [y_vals, plot_mode] = zef_dtw_mean_scaling(time_series) %Copyright © 2018- Sampsa Pursiainen & ZI Development Team %See: https://github.com/sampsapursiainen/zeffiro_interface %This function processes the N-by-M data array f for N channels and M time %steps. The other arguments can be controlled via the ZI user...
f4326563a80f0216836d55f23ceeb892c23eca5e7b24954b712e6584ba950d8f
MATLAB
722
25
function vecVals = getMatVals(matGrid,vecRow,vecCol) %getMatVals Description % % SYNTAX % vecVals = getMatVals(matGrid,vecRow,vecCol) % % INPUT % matGrid: data matrix (2D) % vecRow: vector that determines in which row the corresponding value of % vecVals will be entered % vecCol: vector that d...
5c2f8241aa4a231bf084d3c6fb9814ced62ec28cde05743a0761d11785aca8d1
MATLAB
723
20
% ChatGPT was used to assist writing code. The authors reviewed, edited, and take full responsibility for the content. % Add path to the location of reference-feature-extraction addpath("/Podcast/Encoding_v5/Feature_Codes/reference-feature-extraction") % Change this path to the location of podcast.wav [wav, fs] = au...
7a7d9d2747acfded73149d1a7518c1a8d831086b098983ae6d95ad229a334a14
MATLAB
723
24
function c = blackgreen(m) %blackgreen Shades of green color map % blackgreen(M), is an M-by-3 matrix that defines a colormap. % The colors begin with bright blue, range through shades of % blue to white, and then through shades of red to bright red. % redgreen, by itself, is the same length as the current f...
923f0f918c2b127c76780216259465323447845e67e822729e53ea710198d4c3
MATLAB
723
30
function [W C] = fgda(Ctrain,Ytrain,METHOD_MEAN,ARG_MEAN,METHOD_COV,ARG_COV) labels = unique(Ytrain); Nclass = length(labels); C = mean_covariances(Ctrain,METHOD_MEAN,ARG_MEAN); Strain = Tangent_space(Ctrain,C); Nelec = size(Strain,1); mu = zeros(Nelec,Nclass); Covclass = zeros(Nelec,Nelec,Nclass); for ...
1368b327ea4bdc3032ba0afed43dde6b25d2cc9787cef9efc4703c4cbf654524
MATLAB
724
23
function c = greenwhite(m) %REDBLUE Shades of red and blue color map % REDBLUE(M), is an M-by-3 matrix that defines a colormap. % The colors begin with bright blue, range through shades of % blue to white, and then through shades of red to bright red. % REDBLUE, by itself, is the same length as the curr...
6df446f9af44a6420dab1191e26a5e5727fe9fa2fd32a8735538c8dd91de66ef
MATLAB
724
15
function generate_pattern_completion_scatter(app) app.pattern_completion_scatter = axes('Parent', app.PCNScatter, 'Units', 'pixels',... 'OuterPosition', [106.4000 93.4000 573.1000 560.3000], 'InnerPosition', [67 58 621 615],... 'Box', 'on'); set_common_plo...
bc56a7809f318a51ccb865357a0d35a50b76615b2d1a43496b609ae15504dfd8
MATLAB
724
28
function vecMahal=getMahal(matThisData,vecMu,matThisCovInv) %UNTITLED8 Summary of this function goes here % Detailed explanation goes here %get number of trials intTrials=size(matThisData,1); %loop is faster.... vecMahal=nan(1,intTrials); for intTrial = 1:intTrials %can be used as parfor vecXY = (matTh...
d10defe3b28d7035048525c04c30a8b4d95e52d1776eb5b018ca66edcc50bb98
MATLAB
724
17
function [y_vals, plot_mode] = zef_dtw_max_scaling(time_series) %Copyright © 2018- Sampsa Pursiainen & ZI Development Team %See: https://github.com/sampsapursiainen/zeffiro_interface %This function processes the N-by-M data array f for N channels and M time %steps. The other arguments can be controlled via the ZI user ...
d20f8b85a54633496f123c0d07dbb4b63e4fbf5461107f95df7496837ba77e06
MATLAB
724
19
function zef_parcellation_roi_plot(zef) [s_x,s_y,s_z] = sphere(100); h_axes1 = zef.h_axes1; hold(h_axes1,'on'); h_parcellation_roi_sphere = findobj(h_axes1,'Tag','additional: parcellation roi'); delete(h_parcellation_roi_sphere); for i = 1 : size(zef.parcellation_roi_center,1) s_x_2 = zef.parcellation_roi_radius(i)*s_...
97d57193a922974655cec00f97aecd78235a94ded7807a1ce1ab40c92d649782
MATLAB
726
27
function indUseFiles = ETO_CheckSelection(sFigETO) %get checked if isfield(sFigETO,'sPointers') && isfield(sFigETO.sPointers,'CheckRun') indUseFiles = cellfun(@(x) x.Value==1,{sFigETO.sPointers.CheckRun}); else indUseFiles = []; end %check if any if ~any(indUseFiles) ptrMsg = dialog('Position',[600 400 25...
fd7e9878f029ad26e9adb9df99403a1c7983ed23800110c36f41511dd9cd6256
MATLAB
726
16
function vecNewIdx = groupInto(cellOldNames,cellGroupInto) %groupInto Groups names in cellOldNames into groups defined by cellGroupInto % vecNewIdx = groupInto(cellOldNames,cellGroupInto) [cellUnique,a,vecOldIdx] = unique(cellOldNames); cellGrouped = cellfun(@(x,y) find(contains(x,y,'IgnoreCase',true)),cellfill(c...
0d66b15d953929591a63ff6386f979d2f4ee0f563c9802507e610814bbb10f88
MATLAB
731
21
function m = nanprod(x,dim) %NANPROD Product over x, ignoring NaNs. % M = NANPROD(X) returns the sample prod of X, treating NaNs as missing % values. For vector input, M is the prod value of the non-NaN elements % in X. For matrix input, M is a row vector containing the prod value of % non-NaN elements i...
3bf7c2ed8766430594c3d2a14045bd82aac6c2695d8d3a3a8c1aa6e43f11791d
MATLAB
732
29
function [triangles_out] = zef_triangles_2_sensor_boundary(zef,compartment_tag,triangles_in) triangles_out = []; points_ind = []; if isfield(zef,[zef.current_sensors '_boundary_cell']) boundary_cell = zef.([zef.current_sensors '_boundary_cell']); points_ind = zeros(length(boundary_cell)+1,1); ...
6147c57f8317a1b92f5ba9d99231482532e3b6dd0e8e5ed63376d36276c530be
MATLAB
732
23
function dblValue = getFractionalEntry(vecList,dblFractionalEntry) %getFractionalEntry Returns fractional entry from input list % dblValue = getFractionalEntry(vecList,dblFractionalEntry) % %Inputs: % - vecList; [1 x N] data vector % - dblFractionalEntry; [scalar] fractional entry (e.g., 2.345) % %Output: % - ...
1e6d164d1ffe92aabe5cc52ee257b4787c68b7e3cfffd56df509964642fc1cad
MATLAB
735
29
function zef = zef_set_position(zef) if nargin == 0 zef = evalin('base','zef'); end position_vec = zef.h_zeffiro_window_main.Position; if zef.h_segmentation_tool_toggle.UserData == 1 position_vec(3) = 0.505*position_vec(3); end zef.ini_cell = readcell([zef.program_path '/profile/zeffiro_interface.ini'],'File...
89048c3375b8033a5cf1a95a3ff30b85910fcaf2980520dfce9d689b1130c1a3
MATLAB
735
32
%%% Gives individual SEM and p value for difference in mean of unpaired %%% distributions function [p, sem1, sem2] = bootstrap_p_sem_unpaired(x,y) n = length(x); m = length(y); t = ( mean(x) - mean(y) ) / sqrt( var(x)/n + var(y)/m ); z = [x y]; itr_num = 1000000; t2 = zer...
f351fb99a235e76a9dde67c59bc5c20ef06b182e5b503eca33bd4b8c4eae4ff1
MATLAB
736
29
function rids = realign_all_niftis(outputfolder, suffix) %% main if nargin < 1 outputfolder = '/data2/MRI_PET_DATA/processed_images_final'; end if nargin < 2 suffix = ''; end MRI_folder_init = ['/data2/MRI_PET_DATA/raw_data/MRI_nii' suffix filesep]; fnames = dir(MRI_folder_init); fnames = {fnames.name}; rids =...
875070408ed40961a41a569342e2412a477e3bb45ceb2b632568ff5a0a9fa744
MATLAB
737
30
function [out] = sw_rem_temporary_data(opt) % function to remove temporary data from data directories temp_dat_fns={'_bandpass', '_widepass', '_mfigure'}; warning off all if isfield(opt,'pat') fn0= [opt.pat opt.fn '_' opt.detect '_bandpass.mat']; else fn0=''; end fns=dir(opt.pat); for i=1:3 for ...
d026e6f24e04cd015c210debdd8226ce232978b4bb18add79434447d1e488d95
MATLAB
737
16
function zef = zef_update_parameter_distributions(zef) parameter_profile = eval('zef.parameter_profile'); for zef_j = 1 : size(parameter_profile,1) if isequal(parameter_profile{zef_j,8},'Segmentation') && isequal(parameter_profile{zef_j,3},'Scalar') && isequal(parameter_profile{zef_j,6},'On') eval(['zef.'...
06eba5f59f1f1aebaf664afeaa1cbc2e0b9d1c0f35ea96ef258e0718e9179931
MATLAB
738
27
function [prediction] = make_predictions(frames, num_udf, best_model) [num_frames, num_nodes] = size(frames); node_potentials = best_model.theta.node_potentials; edge_potentials = best_model.theta.edge_potentials; z = exp(best_model.theta.logZ); cp_udf = zeros(num_frames, num_udf); udf_nodes = num_nodes+1-num_udf:...
f2475627421be4d72718e53d1c93fe807d341315d5091ae02833a4d83f45e4da
MATLAB
738
12
function [colormap_vec] = zef_contrast_4_colormap(colortune_param, colormap_size) c_aux_1 = floor(colormap_size - colortune_param*colormap_size/2); colormap_vec = [10*(colormap_size/3)*[c_aux_1:-1:1]/c_aux_1 zeros(1,colormap_size-c_aux_1); 3*(colormap_size/3)*[1: c_aux_1]/c_aux_1 3*(colormap_size/3)*[colormap_size-c_a...
20fda0d1d31d796fa379fb33b7aa7a7a26ca6964b491de65243db43f84f9879e
MATLAB
739
25
function result = isdiagonalizable(C) %% function result = isdiagonalizable(C) % % Quick check of whether the connectivity matrix is diagonlizable % % Inputs: % - C - connectivity matrix to check % %% Linear Sync Toolkit (linsync) % Copyright (C) 2023 Joseph T. Lizier % Distributed under GNU General Public License v3 ...
2c2b8346abd41623d5c968ebed2ce40a462e5502b60699c82e6f796879930058
MATLAB
739
33
function [m, P, K, D] = kf_sL_update_approx(m,P,y,H,R) % Approximating the inverse of square root matrix N = 5; M = 1; Z = eye(length(m)); Y = P; invY = Z; invZ = Z; for n = 1:N for k = 1:M invY = 2*invY-invY*Y*invY; invZ = 2*invZ-invZ*Z*invZ; end ...
61c512efb05ee9e606d564a4599290a102fac9ddeadd4ccc45c97f2c9555f0c0
MATLAB
740
22
%%%% design a Chebyshev-Type-II bandpass ( f1 to f2 Hz) filter function Hd = bandp_filter(f1, f2, fs) Fstop1 = f1-0.3; % First Stopband Frequency Fpass1 = f1; % First Passband Frequency Fpass2 = f2; % Second Passband Frequency Fstop2 = f2+0.3; % Second Stopband Frequency A...
6a7a0eade4f151cc62813c998cfac030890d60793e1942e38bb47450c9dc268a
MATLAB
740
28
function zef = zef_delete_all_compartments(zef) if nargin == 0 zef = evalin('base','zef'); end if not(isempty(zef.h_compartment_table.Data)) for zef_i = 1 : length(zef.h_compartment_table.Data(:,2)) zef.h_compartment_table.Data{zef_i,2} = 0; end for zef_i = 1 : length(zef.h_sensors_table.Data(...
64eb3c781dcecb1c1f6d7d10694e9e5f1a4b49f8461dba82afe8fe1717e21583
MATLAB
742
34
%% Copyright © 2025- Joonas Lahtinen function self = initialize(self,L,f_data) % % initialization function % % Initialize recursively updated variables before the computation of % the first time step. % % Inputs: % % - self % % An instance of CSMInverter with the method-spe...
070cd50ea06c3eebd76a2e7b892c491f14d823d3adc0701bf26192fdeebb6f82
MATLAB
743
23
if ~isempty(strfind(fsub,'.mat')) dat = load(fsub); if isfield(dat,'X') X = dat.X; else X = getfield(dat,char(fieldnames(dat))); end clear dat elseif ~isempty(strfind(fsub,'.txt')) X = dlmread(fsub); else % no extension - assumed to be an SPM file try % Note that we are not t...
27633fccb97ba0f9b497bb50f1934146e5429f55fe874c762a679488c3930fce
MATLAB
743
25
function [model_stats] = characterize_learned_models(models) last_model = models{end}; last_model = rmfield(last_model, "structure"); last_model = rmfield(last_model, "absolute"); last_model = rmfield(last_model, "converged"); last_model = rmfield(last_model, "pending_parameter_estimation"); last_model = rmfield(last_...
94014d2002c219e49a6889c49b99c55c2b4ff05b81f61dd6724dee4065fc5df5
MATLAB
743
29
function zef_nse_plot_signal_pulse(zef, nse_field) h_axes = zef.h_axes1; axes(h_axes); c_map = lines(1); c_map = c_map + 0.1; c_map = c_map/max(c_map(:)); mmhg_conversion = 101325/760; plot_data_time = [0:nse_field.time_step_length:nse_field.cycle_length]; plot_vec = zef_nse_signal_pulse(plot_data_time,nse_field...
49c7730cb7c47745ddb6fd56bbee677d08c5792d12c3a8c84c231b97b0a565c4
MATLAB
744
27
function obj = stats_coverage(obj) % Calculate coverage of microstates % Check inputs if isempty(obj.label) error('To calculation microstate coverage, property label is required') end % Number of states if ~isempty(obj.maps) Nstates = size(obj.maps,2) ; else ...
9c270e82172e628b2ba9ca6cddde62e94a7c506b6e63da90a6983241d282c5bd
MATLAB
745
18
function generate_parameter_space_structural_learning(app) app.parameter_space_structural_learning = axes('Parent',... app.ParameterSpacePanel_SL, 'Units', 'pixels', 'OuterPosition',... [15 9 235 200], 'InnerPosition',... [36.7333 33.7333 205.7667 164.9667], 'Box', 'on'); app.parameter_space_structural...
20cc2447bba1e8d33ba3014605c2bfa08e2c005f4e83bf3fc06ed26b9eed0420
MATLAB
746
18
%Copyright © 2018- Sampsa Pursiainen & ZI Development Team %See: https://github.com/sampsapursiainen/zeffiro_interface function [void] = zef_color_label(tag_str) void = []; switch_val_1 = evalin('base',['zef.' tag_str '_on']); switch_val_2 = evalin('base',['zef.' tag_str '_visible']); if isvalid(evalin('base','zef.h...
0fa89ce8843b5d7c8f4d305e4d35ce618df80b4548ebeb177d3db173594b4be8
MATLAB
747
31
function [Ytest d C] = mdm(COVtest,COVtrain,Ytrain,varargin) if isempty(varargin) method_mean = 'riemann'; method_dist = 'riemann'; else method_mean = varargin{1}; method_dist = varargin{2}; end labels = unique(Ytrain); Nclass = length(labels); C = cell(...
0a3f2c97a4580df01c2ef5d199790eb46936ec49b428d3b47977acc9a1cf1ee8
MATLAB
748
26
function err = shape_error(data,Model,parm) Ntau = length(Model.tau); decayRate = 100; [tpeak, gpeak, tdecay] = spike_func_peak(parm.tau, decayRate); Nt = ceil(tdecay*parm.fs); dt = 1/parm.fs; data_eval.dt = dt; data_eval.Dt = 0; data_eval.y = zeros(1,Nt); switch Ntau case 2 g1 = spike_func_evalua...
202110eb0dcff6622d8497eded2ab810165c6e0c45ff6f2267ff208669cccbd8
MATLAB
748
24
function ET_SwitchRecordVideo(strSelected) %% globals global sET global sEyeFig %% update switch if strcmpi(strSelected,'On') if isfield(sET,'objVidWriter') && isprop(sET.objVidWriter,'Filename') && ~isempty(sET.objVidWriter.Filename) sET.boolSaveToDisk = true; open(sET.objVidWriter); if isfield(sET,'...
1193fac6d8d26190acb2a86993904c07becd829b38194dbca1869d9d941b69ab
MATLAB
749
35
function self = initialize(self,L,f_data) % % initialization function % % Initialize recursively updated variables before the computation of % the first time step. % % Inputs: % % - self % % An instance of DipoleScanInverter with the method-specific parameters. % % ...
47765a68936f1fd46123213712a0196cda96912c0915ff29345114247940194f
MATLAB
749
31
function [p,z] = bino2test(k1,n1,k2,n2,boolForceFloat) %bino2test Two-sample binomial test % [p,z] = bino2test(k1,n1,k2,n2) %input if nargin==1 vecIn = k1; k1 = vecIn(1); n1 = vecIn(2); k2 = vecIn(3); n2 = vecIn(4); end if ~exist('boolForceFloat','var') boolForceFloat = false; end if ~boolForceFl...
7abbae08716e46dc74c4818eac99eb7833f989bfa2b1d6619235d0fd78d3dc92
MATLAB
750
17
function [colormap_vec] = zef_easter_colormap(colortune_param,colormap_size) c_aux_1 = floor(colormap_size/2); colormap_vec = zeros(colormap_size,3); colormap_vec(1:c_aux_1+1,:) = [zeros(c_aux_1+1,1),2*(1:c_aux_1+1)',3*(c_aux_1:-1:0)']; c_aux_2 = c_aux_1+floor(colormap_size/4); c_aux_1 = c_aux_1+1; colormap_vec(c_aux_...
94e9034e8c8d4683b322a86f42959233937254b39c98906cfcc51aba87ac7ff0
MATLAB
750
38
function visualize_classification(opts) change_current_figure(opts.hand); clf; stats = opts.stats; epoch = opts.epoch; plots = setdiff(cat(2, fieldnames(stats.train)', fieldnames(stats.val)'), {'num', 'time'}) ; for p = plots p = char(p) ; values = zeros(0, epoch) ; leg = {} ; for f = {'train', 'val'} ...
c32f52c621358086c983573924bfb7957ffade0cf80ad66d1d26803acd0ac456
MATLAB
750
26
function I = localperm(N,R) % I = localperm(N,R) % I is a random permutation of the integers from 1:N. However, % unlike RANDPERM, the indices remain somewhat local. % Specifically, the displacement I(x) - x has a gaussian % distribution with standard deviation R. % 2010-11-13 Dan Ellis dpwe@ee.columbia.ed...
87dc23b928bcd54de183caf4a28a4898d6ec7ec266f18d6d0d88b76b171af87e
MATLAB
751
20
% OV_MATLAB toolkit % OV_setSignalInputHeader.m % ------------------------------- % Author : Laurent Bonnet (INRIA) % Date : 28/07/2011 % Set the header information on a signal input. function box_out = OV_setSignalInputHeader(box_in, input_index, nb_channel, nb_samples_per_buffer, channel_names, sampling_rate) ...
62aba42a6c806aa03211b6cf962af54eab8c90157220668addc2bc303add3113
MATLAB
752
32
function zef = zef_dataBank_init(zef) if nargin == 0 zef = evalin('base','zef') end if not(isfield(zef.dataBank,'var_starttime')) zef.dataBank.var_starttime = 0; end if not(isfield(zef.dataBank,'var_endtime')) zef.dataBank.var_endtime = 0; end if not(isfield(zef.dataBank,'workingHashes')) zef.dataBa...
a758b4c098a52997ff78208eee56da6d9ad6f70fa6e510863b4c7bdb59bcd44c
MATLAB
752
20
% if data is a cell, transform into matrix format if iscell(data) if size(data,1)==1, data = data'; end if iscellstr(data) % if comes in file name format dfilenames = data; t0 = 0; for i = 1:length(dfilenames) fsub = dfilenames{i}; loadfile_sub; if i==1, data ...
f372b58d94b99307cd16559262efd2207600082c7de078901252aa8af78a50dc
MATLAB
752
27
% THIS FUNCTION IS PRIVATE AND SHOULD NOT BE CALLED BY OUTSIDE CODE! % function [res] = DoQueryCmd( sm, cmd ) ChkConn( sm ); ok = CalinsNetMex( 'sendstring', sm.handle, sprintf( '%s\n', cmd ) ); if( isempty( ok ) ) error( '[%s] error: cannot send string.', cmd ); end lines = CalinsNetMex...
0b801de8c535504afbd028ac6f16370d55300fd71d8da3a2ae4e584e6d06d4b8
MATLAB
753
34
function slider_value_new = zef_update_transparency_cones(varargin) if isequal(evalin('caller','exist(''zef'')'),1) zef = evalin('caller','zef'); else zef = evalin('base','zef'); end if not(isempty(varargin)) h_figure = varargin{1}; else h_figure = eval('zef.h_zeffiro'); end h = findobj(get(h_figure,...
0cf1de74eced9873d259cd92705cd6d3a07cce1e281fe6b8418bdde501f85b9d
MATLAB
753
56
function v = zef_volume_scalar_vector(nodes, tetra, scalar_field, weighting) % % zef_volume_scalar_vector % % TODO: Sampsa should document this. % % Inputs: % % - nodes % % TODO: explanation. % % - tetra % % TODO: explanation. % % - scalar_field % % TODO: explanation. % % - weighting % % TODO: explanation. % % ...
3b237d6b047ed598e4d0c0cb330262eb8b4abb21675aec91a93565942e38c016
MATLAB
753
30
function [P,T,L,r,centerX,cX]=classSVD(x); %CLASSSVD performs the singular value decomposition of a matrix with more % rows than columns (uses svd.m) % % Required input: % x : data matrix of size n by p where n>p % % This function is part of LIBRA: the Matlab Library for Robust Analysis, % available at: % ...
bc83572f9d42fdeb9037caea4be5b4ab9ab98c1eaf975bc03767b18bbb9518c2
MATLAB
753
17
h_axes = gca; if isempty(findobj(allchild(h_axes),'Type','DataTip'))~=1 h_datatip = findobj(allchild(h_axes),'Type','DataTip'); zef.nse_field.nvc_source_x = []; zef.nse_field.nvc_source_y = []; zef.nse_field.nvc_source_z = []; for i=1:size(h_datatip) zef.nse_field.nvc_source_x = [zef.nse_field....
4ac81c5463664bda650647374d49f62a179fd92e79a467a4c390d8428655da49
MATLAB
754
35
% Implementation of shrinkage covariance matrices as describes in : % [1] B. Blankertz, S. Lemm, M. Treder, S. Haufe, et K. Müller, % “Single-trial analysis and classification of ERP components - A tutorial,” % NeuroImage, Jun. 2010. function [Cov gamma] = shcov(X) N = size(X,2); T = size(X,1); % Classical covaria...
5be1382fbb93fd11ccea8030066124ee9ab119bc2ba2499e2eac18f3649a6d43
MATLAB
755
25
function sqnorm = multisqnorm(A) % Returns the squared Frobenius norms of the slices of a 3D matrix. % % function sqnorm = multisqnorm(A) % % Given a 3-dimensional matrix A of size n-by-m-by-N, returns a column % vector of length N such that sqnorm(i) = norm(A(:, :, i), 'fro')^2. % % See also: multiprod multitransp mul...
1328b57506ba80710a5916a6d4ec2ae69b9c84623833a469745f607f256bc440
MATLAB
756
24
% openvibe toolbox for Matlab % OV_getSignalOutputHeader.m % ------------------------------- % Author : Laurent Bonnet (INRIA) % Date : 28/07/2011 % Set the header information on a signal output. % MEANT TO BE USED IN USER SCRIPT function [errno, nb_channels, channel_names, dynamic] = OV_getChannelLocalisationOutpu...
15ee05a48ed69d37d91e95754e27768fd8bda970e4cba12d02d050a6e8be455b
MATLAB
756
19
function generate_node_performance_distribution(app) app.node_performance_distribution = axes('Parent', app.NodePerformance_IDENS, 'Units', 'pixels',... 'OuterPosition', [ 21 19 410 440], 'InnerPosition', [60.4000 54.4000 362.1000 385.3000],... 'Box', 'on'); ...
9ae81463abe65b47933138852b2741446b9fd7fd2cbe79155bd6041be30cf3b9
MATLAB
756
26
function zef_git_push(my_key,varargin) message = '"Regular push."'; if not(isempty(varargin)) zef_i = 1; while zef_i <= length(varargin) aux_var = varargin {zef_i + 1}; if isequal(varargin {zef_i},'message') aux_var = char(join(string(aux_var))); end eval([varargin{...
b769f0f24546e9e18a7b3ca2327b11dc5091c24eeba14841b9cc2168f450fd0d
MATLAB
756
45
function mfiles = get_mfile_paths(folder) % % get_mfile_paths % % Returns a list of Matlab code file paths in a given folder and its % subdirectories. % % Inputs: % % - folder % % The root folder from which the m-files are to be searched from. % % Outputs: % % - mfiles % % The paths to the located m-files. % a...
0eb39164c0b24832609b05ab7d8fade589af22e83e8f3dec04abfc49d08836bd
MATLAB
757
34
function slider_value_new = zef_update_transparency_sensor(varargin) if isequal(evalin('caller','exist(''zef'')'),1) zef = evalin('caller','zef'); else zef = evalin('base','zef'); end if not(isempty(varargin)) h_figure = varargin{1}; else h_figure = eval('zef.h_zeffiro'); end h = findobj(get(h_figure...
82432174b505393eadafab24288b496ee32bfee5d6b9bba9a117d6f741730872
MATLAB
758
24
%% set options sOptions = struct; sOptions.Solver='lsqcurvefit'; sOptions.MaxIterations = 1000; %% no gauss vecY = vecActivity; cellCoeffs01 = {0,0,0,0,0,0}; [cellCoeffs1,matOutX,cellBasisFunctions,vecLinCoeffs,vecLinCoeffFunctions] = gnmfit(matX,vecY,cellCoeffs01,sOptions); vecPredY1 = gnmval(cellCoeffs1,matOutX,cel...
98727bcb57e22781f5f3d895c41f5d178add432588008de2898aa8cc54a73df9
MATLAB
758
33
function slider_value_new = zef_update_transparency_surface(varargin) if isequal(evalin('caller','exist(''zef'')'),1) zef = evalin('caller','zef'); else zef = evalin('base','zef'); end if not(isempty(varargin)) h_figure = varargin{1}; else h_figure = eval('zef.h_zeffiro'); end h = findobj(get(h_figur...
aa8fced663d7628274ba458b301d07b0921c7d35add18bac56a0ee5e85af8540
MATLAB
758
10
function direction = zef_nse_vel_dir(zef,nse_field) % roi_ind = zef_nse_roi_ind(str2double(zef.nse_field.h_roi_x),str2double(zef.nse_field.h_roi_y),str2double(zef.nse_field.h_roi_z)); roi_ind = find(sqrt(sum((zef.source_positions - repmat([str2double(nse_field.h_roi_x.Value) str2double(nse_field.h_roi_y.Value) str2dou...
446df47b825d768b690f9b4808d92bdb84f3b86efa2c11f58c9350361b242bea
MATLAB
759
29
function [gcc] = find_global_cluster_coeff(graph_structure) % Function for finding global cluster coefficient % Shuting Han Date Unknown, adapted Darik O'Neil 05/18/2022 num_node = size(graph_structure,1); num_tric = 0; num_ftric = 0; % make sure the diagnal is zero graph_structure = graph_structure-diag(diag(grap...
6419da26433d047311cc5bc292f9502d9db6e3c6359f35b16464fc8f7e7f3a3b
MATLAB
759
17
function generate_node_weight_parameter_estimation(app) app.node_weight_parameter_estimation = axes('Parent', app.Potentials_PE, 'Units', 'pixels',... 'OuterPosition', [21 19 420 190], 'InnerPosition', [60.4000 54.4000 372.1000 135.3000],... 'Box', 'on'); set_common_plot_s...
aedc11428691a102555a3d21fcfe6f8e1ad667b95b5cdf67d737779df2a88566
MATLAB
759
31
function specular_val = zef_update_specular(varargin) if isequal(evalin('caller','exist(''zef'')'),1) zef = evalin('caller','zef'); else zef = evalin('base','zef'); end if not(isempty(varargin)) h_figure = varargin{1}; else h_figure = eval('zef.h_zeffiro'); end h = findobj(get(h_figure,'Children'),'...
fc3470cb8bf64a3feb852b122a57ea5af6b0394375a9fdf296205548f20dce12
MATLAB
759
24
training_data_file_name = ''; credibility_data_file_name = 'credibility_dataset_p0857_10dB'; project_file_name = '~/Dropbox/ResearchData/PerEpi_material/Patients/p0803.mat'; supervised_clustering = 'on'; frame_number = 1; max_iter = 10000; training_data_size = 50; snr_vec = [10]; frame_number = 1; cred_val_rec = 0.95;...
0b6dbfeaf2f44d8365a3a3f91a734c5f0614c24a7359d2c611af34d24165e7bd
MATLAB
760
32
function [x_sil y_sil] = removeSilentFrames(x, y, range, N, K) x = x(:); y = y(:); frames = 1:K:(length(x)-N); w = hanning(N); msk = zeros(size(frames)); for j = 1:length(frames) jj = frames(j):(frames(j)+N-1); msk(j) = 20*log10(norm(x(jj).*w)./sqrt(N)); end msk = (msk-max(m...
6d1283c865205c5201d67ec96c395873babf96571897f5d1e21f4d5de6406c82
MATLAB
760
32
if zef.current_version <= 2.2 for zef_i = 1 : 22 eval(['zef.d' num2str(zef_i) '_priority =' num2str(28-zef_i) ';']); end end clear zef_i if zef.current_version < 4 if isempty(zef.active_compartment_ind) && isfield(zef,'brain_ind') zef.active_compartment_ind = zef.brain_ind; end i...
6d705d4ea93c131a16423a78afd82d248c5188912961030a47cf0d192924c0a8
MATLAB
762
37
function self = initialize(self,L,f_data) % % initialization function % % Initialize recursively updated variables before the computation of % the first time step. % % Inputs: % % - self % % An instance of RAMUSInverter with the method-specific parameters. % % Outpu...
184e571124ec401d863861b4c90a48088a047eed8e9be882d4b55b3b4df3bb32
MATLAB
763
33
function ambience_val = zef_update_ambience(varargin) if isequal(evalin('caller','exist(''zef'')'),1) zef = evalin('caller','zef'); else zef = evalin('base','zef'); end if not(isempty(varargin)) h_figure = varargin{1}; else h_figure = eval('zef.h_zeffiro'); end h = findobj(get(h_figure,'Children'),'...
82d1748350c2d32101658198c6354ce17da2fe5422d97c4aef8238bcfa77f3b4
MATLAB
763
31
function diffusion_val = zef_update_diffusion(varargin) if isequal(evalin('caller','exist(''zef'')'),1) zef = evalin('caller','zef'); else zef = evalin('base','zef'); end if not(isempty(varargin)) h_figure = varargin{1}; else h_figure = eval('zef.h_zeffiro'); end h = findobj(get(h_figure,'Children')...
b88ecc0d4bc647c1baa0c0fe61238381f97c30225cc094232bab92f928e6f14e
MATLAB
763
35
function zef = zef_dataBank_getHasForMenu(zef) if nargin == 0 zef = evalin('base','zef'); end if isempty(zef.dataBank.app.Tree.SelectedNodes) %either no selected or no node in tree, either way start on first level disp('please select nodes'); return; else if size(zef.dataBank.app.Tree.SelectedNodes,...
4ddb22ba6dfde8b05ce9e1b1fb430b523365c5b3f6f2979e5967b91e93a75438
MATLAB
764
12
function [colormap_vec] = zef_contrast_3_colormap(colortune_param, colormap_size) c_aux_1 = floor(colormap_size - colortune_param*colormap_size/2); colormap_vec = [10*(colormap_size/3)*[c_aux_1:-1:1]/c_aux_1 zeros(1,colormap_size-c_aux_1); 3*(colormap_size/3)*[1: c_aux_1]/c_aux_1 3*(colormap_size/3)*[colormap_size-c_a...
70275924ad5cead1d17b93ee536e7975b2b052877124a18c9608c3141e11a01e
MATLAB
764
32
function [x_sil, y_sil] = removeSilentFrames(x, y, range, N, K) x = x(:); y = y(:); frames = 1:K:(length(x)-N); w = ml_hanning(N); msk = zeros(size(frames)); for j = 1:length(frames) jj = frames(j):(frames(j)+N-1); msk(j) = 20*log10(norm(x(jj).*w)./sqrt(N)); end msk = (msk-m...
92295965c61d099d6e72653fc785523b2cc7540913acf34c32b38477e529b544
MATLAB
764
14
function [colormap_vec] = zef_intensity_1_colormap(colortune_param, colormap_size) c_aux_1 = floor(colortune_param*colormap_size/3); c_aux_2 = floor(colormap_size - colortune_param*colormap_size/3); colormap_vec = zeros(3,colormap_size); colormap_vec(1,:) =10*([colormap_size:-1:1]/colormap_size); colormap_vec(2,:) = ...
cc8b6ecc85d0a7fb44bc54fd2afbd775faee760266922f98d6c7db966fef7546
MATLAB
764
33
function zef_nse_plot_sphere(h_axes,nse_field) if nargin == 0 h_axes = evalin('base','gca'); nse_field = evalin('base','zef.nse_field'); end axes(h_axes); hold_val = ishold(h_axes); if not(hold_val) hold(h_axes,'on'); end h_sphere = findobj(h_axes.Children,'Tag','additional:nse_sphere'); delete(h_sphere...
487232c20d81dc9f2efbffb91693ebb2664b893e7d5b8313fb44e0358b1dfaab
MATLAB
765
14
function [colormap_vec] = zef_intensity_3_colormap(colortune_param, colormap_size) c_aux_1 = floor(colortune_param*colormap_size/3); c_aux_2 = floor(colormap_size - colortune_param*colormap_size/3); colormap_vec = zeros(3,colormap_size); colormap_vec(3,:) = 10*([colormap_size:-1:1]/colormap_size); colormap_vec(2,:) =...
9ca53d3fcc576be25c913c7fbcf9a557c1149940e5794827576b5222cd10514f
MATLAB
765
14
function [colormap_vec] = zef_intensity_2_colormap(colortune_param, colormap_size) c_aux_1 = floor(colortune_param*colormap_size/3); c_aux_2 = floor(colormap_size - colortune_param*colormap_size/3); colormap_vec = zeros(3,colormap_size); colormap_vec(2,:) = 10*([colormap_size:-1:1]/colormap_size); colormap_vec(1,:) =...
8314034c1fc2893fc0c4f54f9966692d3938b4dcda235496d6f6a4da6ae5cd0b
MATLAB
767
25
function [htest,P,rank] = bsliang_permutationtest(Morgi,Mi,alpha,tail) % do permutation test Mi_Morgi=[Mi,Morgi]; nBOOT=length(Mi); if isequal(tail,'both') if Morgi<mean(Mi,'omitnan') Mi_Morgi=sort(Mi_Morgi); rank=find(Mi_Morgi==Morgi,1); P=(rank+1)/(nBOOT+1); elseif Morgi>mean(...
221a8df4981f79ef0843d352eaa6494c15dcc0c23441977c3e1153f52eb36eba
MATLAB
768
25
function bad_samples = artifacts_json2badsamples(filename) artfctdef_jsonstr = fileread(filename) ; artfctdef = jsondecode(artfctdef_jsonstr) ; bad_samples = [] ; for mthd = {'clip','jump','zscore'} [m,artfctdef] = size_artfctdef(artfctdef,mthd{1}) ; for i = 1:m bad_samples = [bad_samples , (artfctd...
45b7fae5cc1ff36c56bc8ee79d507efb96328112a9dee86aaf7696760bf4cf73
MATLAB
768
15
function generate_edge_weight_parameter_estimation(app) app.edge_weight_parameter_estimation = axes('Parent', app.Potentials_PE, 'Units', 'pixels',... 'OuterPosition', [481 19 420 190], 'InnerPosition', [520.4000 54.4000 372.1000 135.3000],... 'Box', 'on'); s...
8911d18b4b09a4ef9703758d6e2ca90ba8bf08d1e32b5407e77b04b6a154fc89
MATLAB
768
35
%### If you have a vocal it has 2 columns so please modify code based on %line 15 or 24, one of them must be used when you want to normalize [x, fs] = audioread('nonmarmoset4.wav'); y= abs(max(x)); ampMax= y(1); t=linspace(0,length(x)/fs,length(x)); plot(t,x) xlabel('time') ylabel('x[n]') hold on %% %###...
e7e7763aac34adf640c4386d714aa3199b7fa10380e87a31747024ba4d3d1812
MATLAB
768
31
%-------------------------------------------------------------------------------- % softmax_b.m % % This demo is included in % Triple equivalence for the emergence of biological intelligence % Takuya Isomura % % The MATLAB scripts are available at % https://github.com/takuyaisomura/reverse_engineering % % Copyright (C...
2ae470f14589120b0791afb4e7a2f79840521b70e79df2754cff5d2e8fd56675
MATLAB
769
46
function indent_mfiles ( filename ) % % indent_mfile % % Programmatically indents a given Matlab source file. Requires that Java is % available, meaning Matlab cannot be started with -nodesktop. % % NOTE 1: this function requires that Matlab was opened with the Java % components enabled. % % Inputs: % % - filename % % ...
acf67c78889c83e1d16195d1ccb9446214e3771ea7468d5401286d65789acc1c
MATLAB
769
24
function vecGaussian = getGaussian(params,xVector) %singleGaussian builds a Gaussian with inputs: (params,xVector) %params is a vector: [mu sigma peak baseline] %define parameters if length(params) < 1, mu=0; else mu = params(1);end %mu if length(params) < 2, sigma=1; else sigma = params(2);end %sigma if length...
ff812474e6658fad801edf6d85d8aba9d152395bfc5296558d2e2758e2528829
MATLAB
769
40
function indent_mfiles(folder) % % indent_mfiles % % Programmatically indents matlab source files in a given folder and its % subdirectories. Requires that Java is available, meaning Matlab cannot be % started with -nodesktop. % % NOTE 1: this function requires that Matlab was opened with the Java % components enabled....
7812f2d1945c3084c02a3588b5ac9a210f08fa8878d031e4188bb74eecaa8fb9
MATLAB
771
30
%-------------------------------------------------------------------------------- % accuracy.m % % Copyright (C) 2025 Takuya Isomura % (RIKEN Center for Brain Science) % % 2025-05-12 %-------------------------------------------------------------------------------- function rate = accuracy(x,y) Nx = size(x,1); N...
76c9e2eb32f83d8d7dc483b94606a61b64cdd811550cfcdd7c25a016cbec8720
MATLAB
772
32
function intNewFrame = ETP_GetCurrentFrame(handle,dummy,strType) %get globals global sETP; global sFigETP; %% get frame if ~exist('strType','var') strType = ''; end intOldFrame = sFigETP.intCurFrame; intNewFrame = intOldFrame; if strcmpi(strType,'Edit') intNewFrame = round(str2double(sFigETP.ptrEditFra...