sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
d4afbc51c5525e8b1e115d55a66e469c754a44e1365ebcf9dc655d07af5ff811 | MATLAB | 634 | 15 | function [L, measurements] = zef_lead_field_scaling(lf_bank_index)
%Copyright © 2018- Sampsa Pursiainen & ZI Development Team
%See: https://github.com/sampsapursiainen/zeffiro_interface
%This function normalizes the lead field data for a given lead
%field bank entry.
%Description: Scaling
L = evalin('base',['zef.lf_ba... |
1b10ccb1bae7f64a9e8f2e0f53d798b8cc079ca59667ce5442527fa6156e7acf | MATLAB | 637 | 14 | function recompare_random_ensembles_button_pushed(app)
update_log(app, 'Recomparing to random ensembles with explicit deviations');
num_deviations = app.DeviationsEditField.Value;
[app.ensemble_nodes] = recompare_random_ensembles(app.node_performance, app.random_ensemble_performance, num_deviations);
plot_node_performa... |
36c6f018df15453467f9abee99b4cf5ca808812755e30500d21c1f1f295aaf4a | MATLAB | 637 | 23 | function coh_avg = erp_grandaverage(obj)
% Calculate grand average ERPs
% Number of conditions
Ncond = length(obj.conditionlabels) ;
% initialize output
coh_avg = microstate.cohort ;
% Calculate group average ERPs
for i = 1:Ncond % Loop over conditions
ind = find(obj.condition == i) ;
ERP = [ob... |
8d5a73704f1da08964a8e91010d3a25e82456addf96e9fecbd325b19e5f68c19 | MATLAB | 637 | 15 | function rois = secondary_validation_rois(rois, data)
if isempty(rois)
rois = simulate_rois(size(data, 2));
end
if isstruct(rois)
assert(length(rois.xpix)==length(rois.ypix), 'Mismatched roi masks: number of xpixel sets does not match number of ypixel sets');
assert(length(rois.xpix)==length(rois.boundary... |
a5696a993ae21b852cf7ae439c000d6e2301a0ef9c1033cf0f6f847b70fb570a | MATLAB | 638 | 15 | % star strider's findlevel function from Igor
% modified to avoid crash if there aren't 3 points for interpolation
%https://www.mathworks.com/matlabcentral/answers/1770785-looking-for-a-way-to-copy-an-igor-pro-function-in-matlab
function xv = FindLevel(x,y,level)
cxi = find(diff(sign(y-level)));
for k = 1:numel... |
a8cfd61127012a353d91d01db9ec138e4ed85732566c029b282f7a691b6aa4a8 | MATLAB | 638 | 24 | function zef = zef_tes_lead_field_isotropic(zef)
if nargin == 0
zef = evalin('base','zef');
end
warning('off');
zef.lead_field_type = 5;
zef.imaging_method = 1;
zef_delete_original_field;
zef = zef_process_meshes(zef);
zef.sensors_attached_volume = zef_attach_sensors_volume(zef,zef.sensors);
zef = zef_lead_field_... |
ff183a173d809d96a8599a1443af90caf0ca00df2ec461c64d3712a42b957c09 | MATLAB | 638 | 20 | function zef = zef_ES_update_reconstruction(zef, varargin)
switch nargin
case 0
zef = evalin('base','zef');
[sr, sc] = zef_ES_objective_function(zef);
zef.reconstruction = zef.y_ES_interval.volumetric_current_density{sr,sc};
case 3
zef.reconstruction = zef.y_ES_interval.volumetri... |
07bb02ce11e93c0a3af2c69f2840a8d778f86bea1ce9daa9988e5599d59d1606 | MATLAB | 639 | 24 | function zef = zef_eeg_lead_field_isotropic(zef)
if nargin == 0
zef = evalin('base','zef');
end
warning('off');
zef.lead_field_type = 1;
zef.imaging_method = 1;
zef_delete_original_field;
zef = zef_process_meshes(zef);
zef.sensors_attached_volume = zef_attach_sensors_volume(zef,zef.sensors);
zef = zef_lead_field_... |
3d2a6efa6e45e24231235b7ccec0edc0aa1cb781f81539854e82a637802eabb2 | MATLAB | 641 | 21 | function matOut = logmvnrnd(mu,covar,n)
%logmvnrnd Log-normal random numbers with mean=mu and std=sqrt(covar)
% matOut = logmvnrnd(mu,covar,n)
%
%Works for covar with diagonal elements, but exact results for correlated covar mats not
%guaranteed
%log normal
matCov = log(covar./(mu.^2)+1);
vecMu = log(mu) - ... |
740dfc6453f12148a5a86b8c1f1858516da74a516adbbcd034882782eded937c | MATLAB | 641 | 24 | function zef = zef_tes_lead_field_anisotropic(zef)
if nargin == 0
zef = evalin('base','zef');
end
warning('off');
zef.lead_field_type = 10;
zef.imaging_method = 1;
zef_delete_original_field;
zef = zef_process_meshes(zef);
zef.sensors_attached_volume = zef_attach_sensors_volume(zef,zef.sensors);
zef = zef_lead_fie... |
ca301222293fcac263745fa27da8ba9cb43cc92204954761f60344a13563d223 | MATLAB | 641 | 24 | function zef = zef_eeg_lead_field_anisotropic(zef)
if nargin == 0
zef = evalin('base','zef');
end
warning('off');
zef.lead_field_type = 6;
zef.imaging_method = 1;
zef_delete_original_field;
zef = zef_process_meshes(zef);
zef.sensors_attached_volume = zef_attach_sensors_volume(zef,zef.sensors);
zef = zef_lead_fiel... |
f58356304c513563fa7cfcd0bc9f2d6b03db47a467a8fdd25874a97f4fa7f7e9 | MATLAB | 641 | 22 | function zef_plot_condition
axes(evalin('base','zef.h_axes1'));
h_axes = evalin('base','zef.h_axes1');
condition_number = zef_condition_number(evalin('base','zef.nodes'), evalin('base','zef.tetra'));
condition_number = max(1E-30,condition_number);
h_hist = histogram(log10(condition_number),10000);
hist_y = log10(h_... |
0b9786b42c67ef2141db5991b6ed7e53ef8cffc77a11cfbd987ae6913a938a66 | MATLAB | 642 | 16 | function r = gaussrnd(mu,sigma,vecSize)
%GAUSSRND Random arrays from the normal distribution.
% R = GAUSSRND(MU,SIGMA) returns an array of random numbers chosen from a
% normal distribution with mean MU and standard deviation SIGMA. The size
% of R is the common size of MU and SIGMA if both are arrays. If eithe... |
53a0ddc620dc0eb240d4053b8fd792650af209e4f283f0a1e9a4bad99ad2f5f8 | MATLAB | 642 | 27 | %%
% This code is for setting paths of BIDS data and SPM.
% Thus, this code must be run before running the other codes.
%%
clear;
% % % Please enter data path here >>>
pathBIDS = ''; % <<<<<<<
pathCurrent = pwd;
tempFolder = 'temp';
dirSPM = cellstr(which('spm.m','-ALL'));
if length(dirSPM) >=1
pathSPM = dirSPM... |
0277f967e8f973c67b105088d7b78fb9e3b7c8bf833d219339d83873cb7ee088 | MATLAB | 643 | 15 | function generate_median_degree_structural_learning(app)
app.median_degree_structural_learning = axes('Parent', app.DegreesSL, 'Units', 'pixels',...
'OuterPosition', [386 9 171 210], 'InnerPosition', [406.7333 44.4 126.6 139.3],...
'Box', 'on');
set_common_plot_settings(app.median_degre... |
0dddc017aaa41cc3e739ae9b0124862828c16dbff63f1403326cb5d2ac05cc68 | MATLAB | 643 | 15 | function generate_ensemble_one_udf_all_ens_pr(app)
app.ensemble_one_udf_all_ens_pr = axes('Parent', app.EnsembleAllPR, 'Units', 'pixels',...
'OuterPosition', [63.4 57.4 356.1 238.3], 'InnerPosition', [24 22 404 293], 'Box', 'on');
set_common_plot_settings(app.ensemble_one_udf_all_ens_pr);
set_no_tick(app.ensembl... |
10cc325e6aa88522a9f51f4ea0f2f22bfa30b7040b24b59aec60dfcdc560b71c | MATLAB | 643 | 15 | function generate_ensemble_all_udf_one_ens_pr(app)
app.ensemble_all_udf_one_ens_pr = axes('Parent', app.EnsembleUDFPR, 'Units', 'pixels',...
'OuterPosition', [63.4 57.4 356.1 238.3], 'InnerPosition', [24 22 404 293], 'Box', 'on');
set_common_plot_settings(app.ensemble_all_udf_one_ens_pr);
set_no_tick(app.ensembl... |
531d422c6148dc10f2ec3876798eb5ef0f25978ae712bf73a50b78dd5fae9233 | MATLAB | 643 | 30 | function ET_updateTextInformation(varargin)
%update cell information window
global sEyeFig;
%check if data has been loaded
if isempty(sEyeFig)
return;
else
try
cellOldText = get(sEyeFig.ptrTextInformation, 'string');
catch
return;
end
end
%check if msg is supplied, otherwise ...
if nargin > 0
... |
8af24328ffab49fae6384a94e9657f0c7866b86db7af84e778b561326e97192c | MATLAB | 644 | 29 |
%% delete all x
dltType='gmm';
%dltType='reconstruction';
onlyIn='node';
allHashes=fieldnames(zef.dataBank.tree);
allHashes=allHashes(startsWith(allHashes, onlyIn));
i=1;
while i<=length(allHashes)
if strcmp(zef.dataBank.tree.(allHashes{i}).type, dltType)
zef.dataBank.hash=allHashes{i};
zef.... |
a8d6569712488ae39fa34df50310087192c62072c8994f73694b6aa8e0d07310 | MATLAB | 644 | 17 | function []=zef_slidding_callback
if evalin('base','zef.store_cdata')
zef_play_cdata(1,get(gcbo,'Value'));
else
l_r = evalin('base','(zef.frame_stop-zef.frame_start+zef.frame_step)/zef.frame_step;');
evalin('base',['zef.frame_start=' ,num2str(ceil(l_r*evalin('base','zef.h_slider.Value'))),';']);
evalin... |
be1c7d6132a9936dd676e1362d5bad35f7096fa50b3fbfa685ec555080ab7c56 | MATLAB | 644 | 22 | function Fun_RemoveSheet123(XLSXfileName)
sheetName = 'Sheet'; % Language dependent
% Open Excel file
objExcel = actxserver('Excel.Application');
objExcel.Workbooks.Open(XLSXfileName);
% Delete sheets
try
% Throws an error if the sheets do not exist
objExcel.ActiveWorkbook.Worksheets.Item([sheetNa... |
1183e66ce330001098309d27769476834b80b17ec34b210e2ba40aef074c5281 | MATLAB | 646 | 26 | function zef = zef_assign_data(zef, zef_data)
%zef_assign_data assigns the fields of struct zef_data as
%fields of struct zef.
%Input: struct zef, struct zef_data
%Output: struct zef.
if nargin == 0
zef_data = evalin('base','zef_data');
if not(isempty(evalin('base','whos(''zef'')')))
zef = evalin('base... |
844bc611ad24bca8a169a0d93b408518b6cdb056cdcaa2761da0799db867d2bf | MATLAB | 646 | 10 | for zef_i = 1 : length(zef.sensor_tags)
zef.aux_field_1{zef_i,1} = zef_i;
zef.aux_field_1{zef_i,2} = eval(['zef.' zef.sensor_tags{zef_i} '_name']);
zef.aux_field_1{zef_i,3} = eval(['zef.' zef.sensor_tags{zef_i} '_imaging_method_name']);
zef.aux_field_1{zef_i,4} = eval(['zef.' zef.sensor_tags{zef_i} '_on... |
e3078e1ef5bad1800d48f119b6b73ac8894620cc39987744f0c7ccad473eafff | MATLAB | 646 | 25 | % tuto2_FFT_filter_Initialize.m
% -------------------------------
% Author : Laurent Bonnet (INRIA)
% Date : 25 May 2012
%
function box_out = tuto2_FFT_filter_Initialize(box_in)
% we display the setting values
disp('Box settings are:')
for i=1:size(box_in.settings,2)
fprintf('\t%s : %s\n',box_in.setting... |
825d8bc4d0e1b61c319e444461253b32098078b22104f0f708485f937999ab7f | MATLAB | 648 | 19 | function [P_store,z_inverse] = kalman_filter_sLORETA(m,P,A,Q,L,R, timeSteps ,number_of_frames, smoothing,standardization_exponent)
P_store = cell(0);
z_inverse = cell(0);
h = zef_waitbar(0,1, 'Filtering');
for f_ind = 1: number_of_frames
zef_waitbar(f_ind,number_of_frames,h,...
['Filtering ' int2str(f_ind) ... |
b83faaa9959b05a0459eacfe25c9747f7167bd42938e6af331e992bbd1200f3c | MATLAB | 649 | 29 | function [out,LINE] = GoToKeyWord(fid, keyWord)
% Usage: [out, line] = GoToKeyWord( fid, keyWord)
%
% Input:
% - fid: file descriptor, as obtained with fopen();
% - keyWord: requested key word;
%
% Output:
% - out: key word actually found (-1 if not found);
% - line: number of the line in the file where the k... |
bbb0b299856a1c4aeaf8d365e2ae7f972f3f0293736fdd8b9ee42135f0d71b86 | MATLAB | 650 | 48 | function v = zef_volume_scalar_vector_F(nodes, tetra, scalar_field)
%
% zef_volume_scalar_vector_F
%
% TODO: Sampsa should document this.
%
% Inputs:
%
% - nodes
%
% TODO: explanation.
%
% - tetra
%
% TODO: explanation.
%
% - scalar_field
%
% TODO: explanation.
%
% Outputs:
%
% - v
%
% TODO: explanation.
%
N =... |
58620234524f3989118f475cb82c6ec856c4a0685d2af1117b63143a8d115d21 | MATLAB | 651 | 21 | function y = gausspdf(x,mu,sigma)
%GAUSSPDF Gaussian probability density function (pdf).
% Y = GAUSSPDF(X,MU,SIGMA) returns the pdf of the Gauss distribution with
% mean MU and standard deviation SIGMA, evaluated at the values in X.
% The size of Y is the common size of the input arguments. A scalar
% input fu... |
5f57b8ac68331027650cf31cb90b469fab6ac1dab0b91398fe3a6c18b13838d7 | MATLAB | 652 | 15 | load(['..',filesep,'data',filesep,'DWIBEHAV']);
load(['..',filesep,'data',filesep,'DWIBEHAV_RAW']);
for row=2:size(CRcell,1)
if CRcell{row,10}==1
% p <.01 *sig
X=CORR_RAW.(CRcell{row,1}).(CRcell{row,2}).(CRcell{row,3}).(CRcell{row,4}).(CRcell{row,5}).DWI;
Y=CORR_RAW.(CRcell{row,1}).(CR... |
0637cc732e63174cb3d5bbcc3a2753fcae40f2ee725574de8e5ac2a11418645b | MATLAB | 653 | 28 | % Test admUI acceleration (currently tested for the case when S and at least one of Y or Z are binary-valued)
clear all;
addpath(genpath('../'))
ns = 2; nz = 2 ; ny = 2;
N = ns*ny*nz;
% partition [0,1] into N pieces
P = sort([0, rand(1,N-1), 1]);
% random P, sampled uniformly
P = P(end:-1:2)-P(end-1:-1:1);
P = P/... |
40c614e1210c3b62cbf953e8216b7679ac6e806c49ec9a81bed5a2fcdd23a3ed | MATLAB | 653 | 22 | % Runs all demos of the Variational Laplace scheme. Note that the demos
% compare the output of this standalone toolbox against the output of
% the canonical implementation of the VL scheme in the SPM software package.
% This requires having SPM on your Matlab path. It can be downloaded from
% https://www.fil.ion.ucl.... |
b410af8a188e3cc069dd9d89354ec710038cd0af90ea092eedb2357b3598d2a8 | MATLAB | 653 | 20 |
%%% returns the "power ratio" of a signal 'S' with 'fs' sampling frequency
%%%% power ratio is defined as the ratio of power in the lower frequency band (2.5-12 Hz) to that in the higher frequency band (12-80 Hz).
function PR = power_ratio(S, fs)
filter_low = bandp_filter(2.5, 12, fs);
signal_lowpass... |
e6b35ab800db63b4120342dbf622a0b1c749cb5bd755ccef3746c6af52b96a27 | MATLAB | 653 | 19 | function [Y,winix] = frame(X,W,H)
% Y = frame(X,W,H)
% Return Y as a set of columns as W-point segments of X stepped
% by H.
% There's no windowing (i.e. scaling by a tapered window) in here.
% 2010-11-14 Dan Ellis dpwe@ee.columbia.edu
lx = length(X);
nh = 1+ceil((length(X)-W)/H);
% Pad X to an integral number... |
faf7c75ea1da201d4bd41bcee57a5e76c0bdfd6f8c28aa09b493e33e0f04cc24 | MATLAB | 653 | 22 | L_1 = zef.L;
source_positions = zef.source_positions;
[dof_ind, dof_count, dof_positions] = zef_decompose_soure_space(source_count, zef.source_positions);
M = size(L_1,1);
N = size(dof_positions,1);
L_2 = zeros(M,N);
K = size(source_positions,1);
for i = 1 : K
L_2(:,3*(dof_ind(i)-1)+1) = L(:,3*(dof_ind(i)-1)+1... |
204fee110bdbb8bdc2597b38d7d81a72b0fc9b0ba9ca6a8882050bf0f4581858 | MATLAB | 654 | 18 | function zef_plot_synthetic_source(varargin)
%A static plot showing the active synthetic sources
color_cell = {'k','r','g','b','y','m','c'};
h_axes = evalin('caller','h_axes_image');
%axes(h_axes);
s = evalin('base','zef.inv_synth_source');
s_o = s(:,4:6)./repmat(sqrt(sum(s(:,4:6).^2,2)),1,3);
for i = 1 : size(s,1)
... |
25d57bc402b00dac2535694800bc6c124f51f70f05664372273e56f744c2f13e | MATLAB | 654 | 20 | function generate_max_degree_structural_learning(app)
app.max_degree_structural_learning = axes('Parent', app.DegreesSL, 'Units', 'pixels',...
'OuterPosition', [26 9 171 210], 'InnerPosition',...
[46.4 44.4 126.6 139.3], 'Box', 'on');
set_common_plot_settings(app.max_degre... |
79471ba99ee13426c828d9dbe7d58805199e7cb71ddb6224951eaaabf8659109 | MATLAB | 654 | 16 | if isempty(findobj(allchild(zef.h_axes1),'Type','DataTip'))~=1
zef.h_datatip = findobj(allchild(zef.h_axes1),'Type','DataTip');
zef.nse_field.roi_x = [];
zef.nse_field.roi_y = [];
zef.nse_field.roi_z = [];
for i=1:size(zef.h_datatip,1)
zef.nse_field.roi_x = [zef.nse_field.roi_x h_datatip(i).X];
... |
56db2643feaacd1d672e433fbe4831c3667beb7899bd6b7fd5e49b6a490ad8a2 | MATLAB | 655 | 18 | function generate_model_decoding_evaluation(app)
app.model_decoding_evaluation = axes('Parent', app.EVModel, 'Units', 'pixels',...
'OuterPosition', [501 39 420 376], 'InnerPosition', [506.0000 44.0000 410.0000 351.7000],...
'Box', 'on');
set_common_plot_settings(app.model_d... |
77c4ccf04f64891c702bf6050f21c6f3cad7630b2274d4db9383ab31068f5966 | MATLAB | 655 | 13 |
zef.LeadFieldProcessingTool.bank=zef.LeadFieldProcessingTool.bank(~cell2mat( zef.LeadFieldProcessingTool.app.BankTable.Data(:,6)));
zef.LeadFieldProcessingTool.app.BankTable.Data=zef.LeadFieldProcessingTool.app.BankTable.Data(~cell2mat( zef.LeadFieldProcessingTool.app.BankTable.Data(:,6)),:);
zef.LeadFieldProcessing... |
87c8dd4ba8135566b57e0c5cd6db6daa8dd23b20c5efa37a65f8143d541c1ed9 | MATLAB | 658 | 29 | function bFofT = BarFofT( stack, t1 )
%t1 = 100;
%bFofT = zeros( height, width, frames, 'double' );
bFofT = double( stack );
frames = size(stack, 3);
%barFofT = smooth( cropstack(:,:,p), t1 );
%nframes = zeros( size(frames) - [0,0,1] );
ts = t1 / 2;
te = frames - ts;
tic
%temp = ones( height, width, ts );
temp = mean(... |
2a9c979b128e661cc13ec34a797a897a97c187e04e3c63f1684c6c7de8c204fc | MATLAB | 659 | 29 | function y = strcut(x,c,doempty)
%STRCUT Cut string into pieces according to specified separator
%---
% function y = strcut(x[,c[,doempty]])
%---
% Cut string x based on delimiter character c (default is [9 10 32], i.e.
% tab + linefeed + white space), and returns a cell array of sub-strings y.
% Thomas Deneux
% Copyr... |
a9e62639fe89712f30691e5e8e4cb58c21d4306f5dcc9767fa96b629df1be208 | MATLAB | 659 | 15 | zef.aux_field_1 = zef.h_parameters_table.Data;
zef.aux_field_2 = {'scaling','x_correction','y_correction','z_correction','xy_rotation','yz_rotation','zx_rotation','affine_transform'};
for zef_i = 1 : size(zef.aux_field_1,1)
if numel(str2num(zef.aux_field_1{zef_i,2})) > 1
evalin('base',['zef.' zef.current_... |
62ba51240923b778e2d629eee9a4b4ffe91f28d72b4623a828c1a029d964883a | MATLAB | 660 | 27 | function sensors_attached_volume = zef_pem2cem(sensors_attached_volume,tetra);
n_electrodes = max(sensors_attached_volume(:,1),[],1);
sensors_aux = [];
for i = 1 : n_electrodes
ele_ind_aux = find(sensors_attached_volume(:,1)==i);
[I, ~] = find(sensors_attached_volume(ele_ind_aux,:)==0);
if isempty(I)
... |
c99f1e3689017e45b6c6aa6542cac4b1128bc85d02dd421c5d3463c60e535118 | MATLAB | 660 | 29 | function [rec_cell, rec_info] = zef_dataBank_get_reconstructions(zef,frame_number)
if nargin < 2
frame_number = 1;
end
rec_cell = cell(0);
rec_info = cell(0);
zef.reconstruction = cell(0);
data_tree = zef.dataBank.tree;
rec_ind = 1;
fn = fieldnames(data_tree);
for k=1:numel(fn)
node = data_tree.(fn{k});
... |
f6147fe76aa431f92cab3b17850f8c04ab1d0642660fb0eeec213efd464a9ccf | MATLAB | 660 | 8 |
eval(['zef.' zef.compartment_tags{zef_j}, '_on = ' num2str(double(zef.aux_field_1{zef_i,2})) ';']);
eval(['zef.' zef.compartment_tags{zef_j}, '_name = ''' zef.aux_field_1{zef_i,3} ''';']);
eval(['zef.' zef.compartment_tags{zef_j}, '_visible = ' num2str(double(zef.aux_field_1{zef_i,4})) ';']);
eval(['zef.' zef.compart... |
5f72d5304764d7b85330b124499558f9f9564624a37587c8a9b9ea3e06f55441 | MATLAB | 661 | 19 | % OV_MATLAB toolkit
% OV_setStreamedMatrixInputHeader.m
% -------------------------------
% Author : Laurent Bonnet (INRIA)
% Date : 28/07/2011
% Set the header information on a streamed Matrix input.
function box_out = OV_setStreamedMatrixInputHeader(box_in, input_index, nb_dim, dim_sizes, dim_labels)
box... |
376d43c982beed7bf5db9f63b26460e87748ed2be212b720218615037e1ccfe6 | MATLAB | 662 | 16 | %Script for the remove method button of find_synthetic_source_app.
if isfield(zef,'synth_source_data')
zef.synth_source_data(zef.find_synth_source.selected_source) = [];
zef.find_synth_source.h_source_list.Data(zef.find_synth_source.selected_source)=[];
if isempty(zef.synth_source_data)
zef = rmfi... |
eef3de74eab908aceaebdf3865e4588abf7210fac7be1fa5cd00f928d54b2cc4 | MATLAB | 664 | 22 | function [vecParams,vecLowerBounds,vecUpperBounds] = getParamsMuSigma(vecMu,matSigma)
%UNTITLED7 Summary of this function goes here
% Detailed explanation goes here
%remove upper triangle from covariance matrix
matLowerTriangle = tril(true(size(matSigma,1)),0);
vecC = matSigma(matLowerTriangle);
%put toget... |
469319ad7c48bd68507192210d02d6ff41e5b9c292abcfb7e1fcd4ceb2b59fdc | MATLAB | 665 | 29 | function r = circ_dist(x,y)
%
% r = circ_dist(alpha, beta)
% Pairwise difference x_i-y_i around the circle computed efficiently.
%
% Input:
% alpha sample of linear random variable
% beta sample of linear random variable or one single angle
%
% Output:
% r matrix with differences
%
%... |
e44200f0ada2eff0f2039116ca95426a416889dd66e917f1aaf8643b38f711c9 | MATLAB | 665 | 12 | function [processed_data] = zef_electrode_reference(f,electrode_index)
%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 Z... |
445346e61f467c6beafe8443d52aa7bf9b463607d092317891071982ee5be81f | MATLAB | 667 | 24 | function [outrawdata,curve]=bsliang_getAMBdatacurve(AMB,rawdata)
% AMBIGUOUS: AMB=3;
% UNAMBIGUOUS; AMB=[1 5];
% HALFAMBIGUOUS; AMB=[2 4];
amb_seq=rawdata(:,4);
inds=zeros(length(AMB),length(amb_seq));
for amb_ind=1:length(AMB)
inds(amb_ind,:)=amb_seq==AMB(amb_ind);
e... |
5a8739d95305761efe6d06cd007888b2d61ad2415091f9aae0ae7e6344e8d570 | MATLAB | 668 | 19 | function zef = zef_parcellation_roi_delete(zef)
I = [1 : size(zef.parcellation_roi_center,1)];
I = setdiff(I,zef.parcellation_roi_selected);
if not(isempty(I))
zef.parcellation_roi_center = zef.parcellation_roi_center(I,:);
zef.parcellation_roi_color = zef.parcellation_roi_color(I,:);
zef.parcellation_roi_radius = zef... |
9d7f9a5ace84a4366c49c2e7f7ec9e6b8e832cace3b8939596fe33dc36a93bc2 | MATLAB | 671 | 26 | function im1 = stackViewer(ax, st1, nave, frame, hROI, minmax)
% st1 st2 are image stacks (x,y,t)
% nave is the number of frames to average
% frame is the image to show
% hROI is a ROI structure created with interface
nFrames = size(st1,3);
ts = frame;
tend = frame+nave;
if(tend>nFrames)
tend=nFrames;
e... |
b2ea47ca117aedffcfcc85e14a3497899c83becaf49cd413f8629896c2468060 | MATLAB | 671 | 24 | function [vecMu,matSigma] = getMuSigma(vecParams,intDims)
%UNTITLED6 Summary of this function goes here
% Detailed explanation goes here
vecMu = vecParams(1:intDims);
if numel(vecParams) == 2*intDims %only diagonal values supplied
matSigma = diag(vecParams((intDims+1):end));
else %assign values to lower le... |
bc08b0cf33e1ef1d21bdba122f596151d05e58a0d7d0603954325dd889df0fb7 | MATLAB | 671 | 15 | function generate_ensemble_all_udf_one_ens_auc(app)
app.ensemble_all_udf_one_ens_auc = axes('Parent', app.EnsembleUDFAuc, 'Units', 'pixels',...
'OuterPosition', [63.4 57.4 356.1 238.3], 'InnerPosition', [24 22 404 293], 'Box', 'on');
set_common_plot_settings(app.ensemble_all_udf_one_ens_auc);
set_no_tick(app.ens... |
215d6716dee8d0bc4c43d56932421f5648bd0c2eb25db1e94bfbfd2f9670736f | MATLAB | 673 | 11 | function zef_segmentation_profile_table_selection(hObject,eventdata,handles)
segmentation_profile_row_selected = eventdata.Indices(:,1);
segmentation_profile_column_selected = unique(eventdata.Indices(:,2));
segmentation_profile_row_selected = unique(segmentation_profile_row_selected);
segmentation_profile_row_selecte... |
3cb24e1d0f31857e4e222c74a4b3cb74c6012f75848bf04e7bb99cf28211b2be | MATLAB | 673 | 16 | function [y_vals, plot_mode] = zef_dtw_no_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 i... |
c3f09e48c2eefe9aaa0eaf350afe718da4a4fdccf849f607a4020005a68de49e | MATLAB | 673 | 48 | function [T, P] = zef_simple_cylinder_generator(R,N,L)
d_r = 2*pi*R/N;
M = ceil(R/d_r);
d_r_aux = R/M;
K = ceil(L/d_r);
P = [];
Z_aux = linspace(-L/2,L/2,K)';
for i = 1 : M
R_aux = i*d_r_aux;
S = ceil(2*pi*R_aux/d_r);
t = linspace(0,2*pi,S+1);
X = R_aux*cos(t(1:end-1));
Y = R_aux*sin(t(1:end-1));
if i == 1
X = [ 0... |
09eb0ed09d21dfe3ff0a2b545299f5881f8febbec341abafc94ab9b74c1de6d2 | MATLAB | 674 | 28 | %Copyright © 2018- Sampsa Pursiainen & ZI Development Team
%See: https://github.com/sampsapursiainen/zeffiro_interface
function [source_positions] = zef_update_source_positions(void)
location_unit_current = evalin('base','zef.location_unit_current');
location_unit = evalin('base','zef.location_unit');
source_positions... |
56daac9e619db2fc4b7a7670889d30f0a725dc83958d04362f9c9d938682ae01 | MATLAB | 675 | 15 | function generate_ensemble_one_udf_all_ens_auc(app)
app.ensemble_one_udf_all_ens_auc = axes('Parent', app.EnsembleAllAuc, 'Units', 'pixels',...
'OuterPosition', [63.4 57.4 356.1 238.3], 'InnerPosition', [24 22 404 293], 'Box', 'on');
set_common_plot_settings(app.ensemble_one_udf_all_ens_auc);
set_no_tick(app.ens... |
26b4779d50f686371eb2d0a4e06fdc4bea793a8db634514799acb7fbefc5ee1a | MATLAB | 677 | 12 | function [m, P] = class_kf_predict(KFclassObj)
% kf_predict is the prediction step of kalman filter
% Skip multiplications if A is Indentity
if (isdiag(KFclassObj.state_transition_model_A) && all(diag(KFclassObj.state_transition_model_A) - 1) < eps)
P = KFclassObj.prev_step_posterior_cov + KFclassObj.e... |
5341af098d17b4a9612ea0f568d9c7faa2e11879f0d20ee0dca6b0572c8bddde | MATLAB | 677 | 24 | function perform_structural_learning_button_pushed(app)
update_log(app, 'Initiating Structural Learning');
[app.params] = structural_learning(app.params);
[app.models] = pre_allocate_models(app.params);
app.FirstPassModelsEditField.Value = app.params.num_seed_structures*app.params.p_lamb... |
0f3a8ee774628eddd1d16096fbc9fa682d4f05f19a3ccddc17b4506fae814a7b | MATLAB | 678 | 34 | function ETP_AcceptParameters(varargin)
%set accept to true
global sETP;
sETP.boolAccept = true;
%save data
%delete video data
try
sETP = rmfield(sETP,{'objVid','matFrames'});
catch
end
%save file
sET = sETP;
%remove extension & build new name
cellFile = strsplit(sETP.strVideoFile,'.');
strFileCore... |
23792cde47226f10e73d229c49a21b24a3ab38b5de11b0d0ebd0072c16769cd4 | MATLAB | 679 | 25 | function bestDiv = bestDivisor(number,target)
% return the divisor of number closest to the target value
factor = 0.2;
if isprime(number)
% need the largest remainder
maxRem=-inf;
for m = round((1-factor)*target):round((1+factor)*target)
tempRem = rem(number,m);
if tempRem > maxRem
... |
6ec6f702751715dfcdcaf611ced2ddffdc64a510e10d406e6b2e66806ba9bea3 | MATLAB | 679 | 26 | function W = getMARmodel(hmm,k)
% Get the MAR coefficients for state k from the estimated model hmm
% This function assumes that order>0
%
% Diego Vidaurre, OHBA, University of Oxford (2016)
if hmm.train.order == 0
error('The states are not modelled to be MAR distributions (order=0)')
end
model_mean = ~hmm.train.z... |
7d853550aee7dbdc73ab4b34bdd2a8525d9cf183c9b7cea84b86cd0f0a4310e1 | MATLAB | 679 | 16 | function [y_vals, plot_mode] = zef_corr_mean_scaling_mean_weighting(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... |
a83f33593e2c96a9666af17cb8456c9dd7379c3e23abb7646570d2f1a50363a5 | MATLAB | 679 | 16 | h_axes = gca;
if isempty(findobj(allchild(h_axes),'Type','DataTip'))~=1
h_datatip = findobj(allchild(h_axes),'Type','DataTip');
zef.nse_field.dir_v_x = [];
zef.nse_field.dir_v_y = [];
zef.nse_field.dir_v_z = [];
for i=1:size(h_datatip,1)
zef.nse_field.dir_v_x = [zef.nse_field.dir_v_x h_datatip(i... |
04914c58ba15522b3e535e651a521c567a6cb21352bc2d3234f224229744c8ea | MATLAB | 680 | 24 | function C_sq = weighted_covariance(x,w)
%
% Computes the covariance matrix for a set of observations x given
% weights in w. See https://www.wikipedia.com/en/Weighted_arithmetic_mean#Weighted_sample_covariance
%
% X should be [N x P] and w should be [N x 1]
%
% C_sq, the covariance matrix, will be [P x P]
%
% Author:... |
38ab21d093e02bef61d24380ee3e63a2a6c0ce2cd293c5c9c7804b023e978139 | MATLAB | 680 | 19 | % OV_MATLAB toolkit
% OV_setChannelLocalizationInputHeader.m
% -------------------------------
% Author : Laurent Bonnet (INRIA)
% Date : 28/07/2011
% Set the header information on a Channel Localization input.
function box_out = OV_setChannelLocalisationInputHeader(box_in, input_index, nb_channels, channel_names, ... |
394c97c33062ac6030a44f9b1a3b20071b8188718c35a19aeeeb8f4fbfbb08bf | MATLAB | 680 | 35 | function [sigma, phi, B, C, D] = Q_quantities(P, m, G, y)
T = size(m,2) - 1;
sigma = zeros(size(P{1}));
for k = 1:T
sigma = sigma + P{k+1} + m{k+1}*m{k+1}';
end
sigma = sigma* 1/T;
phi = zeros(size(P{1}));
for k = 1:T
phi = phi + P{k} + m{k}*m{k}';
end
phi = 1/T * ... |
3b0d3a043110a7629458a08d84789b8cbfdfb72aa1d74451fb5e19582f4ed5fe | MATLAB | 683 | 15 | function generate_pattern_completion_coordinates(app)
app.pattern_completion_coordinates = axes('Parent', app.PCNCoordinates, 'Units', 'pixels',...
'OuterPosition', [ 73.4000 58.4000 602.1000 595.3000], 'InnerPosition', [34 23 650 650],...
'Box', 'on');
set_commo... |
3e9235270a2bf7005143dba038f3c140a73548a7d13fad52d6cae038b5aaf540 | MATLAB | 684 | 19 | %Copyright © 2018- Sampsa Pursiainen & ZI Development Team
%See: https://github.com/sampsapursiainen/zeffiro_interface
function zef = zef_parcellation_tool_open(zef)
zef_init_parcellation;
zef = zef_parcellation_tool_window(zef);
set(zef.h_parcellation_tool,'Name','ZEFFIRO Interface: Parcellation tool');
set(findobj(... |
982e3066781b661fb99d8dcb4198ed494d130c675b5693b1cfc5fbe4f5c2ad07 | MATLAB | 684 | 16 | function dblWLOR = getWeightedLogOddsRatio(vecData)
%getFracLogDevInt Summary of this function goes here
% dblWLOR = getWeightedLogOddsRatio(vecData)
if ~isvector(vecData) || length(vecData) < 3
error('not a vector');
end
%sort
vecData = sort(vecData(:));%sort
vecNorm = linspace(1/numel(vecData),1,numel(... |
c64d5e4c43aa55e5b970c867798fa72e037c9571db6f262af84944c2a8dd2d0b | MATLAB | 684 | 27 | % distance between ROIs
function [goodROIs,Z] = GetGoodROIs( hROI, minDistance )
indices=[];
goodROIs=[];
row=[];
col=[];
thresh=minDistance; % units are microns, the size of one pixel is 1.3 microns
% thresh=13 is about a cell body distance
nROIs = length(hROI.combo);
index=1;
for ii=1:nROIs
% for jj=ii:nROIs
... |
3912d5a87eb8af44793c68257a07c5e3f4724d6a8211bc5b379d555813f56da0 | MATLAB | 687 | 19 | % OV_MATLAB toolkit
% OV_setChannelLocalizationInputHeader.m
% -------------------------------
% Author : Laurent Bonnet (INRIA)
% Date : 28/07/2011
% Set the header information on a Channel Localization input.
function box_out = OV_setChannelLocalisationOutputHeader(box_in, output_index, nb_channels, channel_names... |
3e0623c84b85149927c638c9fe48bef8d4141842a7366217d8b62f5cb4833950 | MATLAB | 687 | 22 | %Copyright © 2018- Sampsa Pursiainen & ZI Development Team
%See: https://github.com/sampsapursiainen/zeffiro_interface
zef.filter_pipeline_selected = get(zef.h_filter_pipeline_list,'value');
zef_j = 0;
for zef_i = 1 : length(zef.filter_pipeline_list)
if not(ismember(zef_i,zef.filter_pipeline_selected))
ze... |
9e7690e98abbba5a006ea996baf11c88d49e178650e93dd7748e008174004cc4 | MATLAB | 687 | 15 | %Copyright © 2018- Sampsa Pursiainen & ZI Development Team
%See: https://github.com/sampsapursiainen/zeffiro_interface
if not(isempty(zef.save_file_path)) & not(zef.save_file_path==0)
[zef_data.file zef_data.file_path] = uigetfile('*.mat','Load filter',zef.filter_save_file_path);
else
[zef_data.file zef_data.fi... |
d9ef3797958a63d931d7786dee4c8dc0c50e266aed163a0ce5d5d8f06beb3f76 | MATLAB | 687 | 24 | %Copyright © 2018- Sampsa Pursiainen & ZI Development Team
%See: https://github.com/sampsapursiainen/zeffiro_interface
zef.lf_item_selected = get(zef.h_lf_item_list,'value');
zef_j = 0;
for zef_i = 1 : length(zef.lf_bank_storage)
if not(ismember(zef_i,zef.lf_item_selected))
zef_j = zef_j + 1;
zef.... |
bcda09aac1a8649edf2864aeb47f4673461666b43ff716e392c6fcbe6495bc22 | MATLAB | 689 | 23 | function exp_sigma_sqr = synchronizability(UcovarianceU)
%
% Compute the expectation value of \sigma^2, meaning the expected average
% square deviation of nodes from the network mean.
%
% Inputs
% - UcovarianceU - covariance matrix, projected into space orthogonal to the
% synchronized state psi_0, computed from th... |
6467a8359b8ff160f0a4dedbf5f3cb01ab11ae3c06dbec2232052ccc06a9da77 | MATLAB | 691 | 11 | 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); 2*(colormap_size/3)*[1: c_aux_1]/c_aux_1 2*(colormap_size/3)*[colormap_size-c_a... |
3871fd4cee7f7d8f523e891cac1985d01a7cb553d54c5d4b54f703fc24f8c7b7 | MATLAB | 692 | 22 | function [avg_log_likelihood] = compute_avg_log_likelihood(node_potentials ,edge_potentials, logZ, samples)
%Function to compute frame-wise log_likelihood
log_likelihood = 0;
sample_count = size(samples,1);
%add nodes
log_likelihood = log_likelihood + sum(samples*node_potentials);
%limit edge_potentials to one trian... |
b56b3698b77a89dec6cc63986d412cba4172482d122d19ee03760c5edfcda621 | MATLAB | 692 | 24 | function zef_set_sensor_color
color_vec = uisetcolor;
item_ind_1 = evalin('base','zef.h_sensor_visible_color.Value');
current_sensors = evalin('base','zef.current_sensors');
visible_list = evalin('base',['zef.' current_sensors '_visible_list']);
for zef_k = 1 : length(item_ind_1)
item_ind_2 = item_ind_1(zef_k);
... |
e8865f5997a40bb74a2bc8d3a55f858098612e95ac7b5f46316db005ca432b79 | MATLAB | 692 | 31 | function zef = zef_ES_clear_plot_data(zef)
if nargin == 0
zef = eval('zef');
end
switch eval('zef.ES_plot_type');
case 1
if isfield(eval('zef'),'h_current_ES')
delete(zef.h_current_ES)
zef = rmfield(zef,'h_current_ES');
end
case 2
if isfield(eval('zef'),'h_barp... |
7f21eea167ba51f727fd8bff6dfd4636df3abf09b3947e0011618d16d510ed3a | MATLAB | 693 | 17 |
h_axes = gca;
if isempty(findobj(allchild(h_axes),'Type','DataTip'))~=1
h_datatip = findobj(allchild(h_axes),'Type','DataTip');
zef.nse_field.sphere_x = [];
zef.nse_field.sphere_y = [];
zef.nse_field.sphere_z = [];
for i=1:size(h_datatip)
zef.nse_field.sphere_x = [zef.nse_field.sphere_x h_datat... |
afc553d713402d9b8ce257452e7a99b9fd0a28195b4c1ed91efbb61ff32794b8 | MATLAB | 695 | 35 | function [maxsl,maxsli]=max_slope(cscf,ts,startind,flag)
%simple numerical
if size(cscf,1) > size(cscf,2)
cscf=cscf';
end
if size(ts,1) > size(ts,2)
ts=ts';
end
dVdt=diff(cscf)./diff(ts);
switch flag
case 'down'
[maxsl ,maxsli]=min(dVdt);
case 'up'
[maxsl ,maxsli]=max(... |
d9c04651ef46d3b4d7b73be6ad6c58bc00b8889e6c1799ed79a4086ac4dabff0 | MATLAB | 696 | 44 | function abspaths = abspath ( files )
%
% abspath ( files )
%
% Returns a string array of absolute paths to a given set of files.
%
% Input:
%
% - files
%
% The list of files you wish to get the absulte paths of.
%
% Output:
%
% - abspaths
%
% A string array of the abslute paths.
%
arguments
files (:,... |
c8f0c1b14426b17204a4d518732c8d2dce07aadcb0d6a17ea0da7fa3a0fbf6b2 | MATLAB | 697 | 28 | full_address = 'exportImage';
file_name = 'parcellation_plot_real_auditoryRH';
f1 = gcf;
f2 = figure();
copyobj(findobj(f1.Children, 'tag','axes1'), f2);
f2.Children.Position(2) = 40;
f2.Children.Box = 0;
l = legend(gca, 'show');
l.AutoUpdate = 'off';
l.FontSize = 12;
h = xline(0.079, '--','79 ms');
h.FontSize = 12;... |
2d8a5282db4aeda7c185e47c6d87ba03e6ed3a26344ae4d4885408ec622b2d7e | MATLAB | 700 | 20 | % OV_MATLAB toolkit
% OV_setStreamedMatrixOutputHeader.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 box_out = OV_setStreamedMatrixOutputHeader(box_in, output_index, nb_dim, dim_si... |
4ea301336ca6c5304bd9f7501d1a0b4745bf78c3898d8c18cf332be9959c6277 | MATLAB | 702 | 31 | function [csc,ts,Fs,date_ts] = import_SCORE_occ4_fro4_data(file_name,Fs)
%import_SCORE_occ4_fro4_data e
fid = fopen(file_name);
i=0;
while ~feof(fid)
i = i+1;
Data.uat{i,1} = fread(fid,5, '*char');
fseek(fid,4,'cof');
Data.uat{i,2} = fread(fid,9, '*char')';
Data.uat... |
535f055ca890a12ff0f58655ac01ff16365039447188008bf6ea70ee7def305a | MATLAB | 705 | 25 | function post_info = estimate_spike_num(post_info)
% --- spike estimation based on posterior for overlap window
% post_info = estimated_post_state(state,spike_state,overlap,Data)
% --- Estimated spike info for overlap window
% post_info.Pspike(ns,n) = P(ns | yk) of n-th overlap window
nwin = size(post_info.Ps... |
e4697007870f9df8049456d55c7008ad630138603621cc36e6961c02e7af7c0d | MATLAB | 705 | 17 | function [y_vals, plot_mode] = zef_cov_no_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 i... |
b5cf6fcf0703776ed8ddab820a8f057175b6f8700723c5a98392a2f2ef43200a | MATLAB | 706 | 28 | function zef = zef_dataBank_saveTreeNodeSwitchChange(zef)
if nargin == 0
zef = evalin('base','zef')
end
zef.dataBank.save2disk=zef.dataBank.app.savetodiskSwitch.Value;
if strcmp(zef.dataBank.save2disk, 'Off') %deleting the files
fwait= zef_waitbar(0,1, 'loading and deleting the data. Please wait');
zef.d... |
4bc88b8481aa5f6a3e7eb39f790233e6883b63e3a1edabbcb7fd43cc8555d978 | MATLAB | 707 | 23 | function r = rangeerror(X,T,Y,orders,options)
% estimates the range of the error
maxorder = options.maxorder;
S = options.S;
Sind = options.Sind == 1;
lambda = 0.01;
if isempty(orders)
r = range(X - repmat(mean(X),size(X,1),1));
else
ndim = size(X,2);
XX = formautoregr(X,T,orders,maxorder,options.zeromea... |
947cfa873cce81974f086ee4d940c384a9aaef8c255a27c2aae4c496984a813c | MATLAB | 707 | 23 | function c = redblackgreen(m)
%REDBLUE Shades of red and black 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 ... |
ef37fad1a53faa759191d6a81d8f9643d3c1d030b3dbfdcd8112e4f891ed0a91 | MATLAB | 707 | 26 | function [P_store,z_inverse] = kalman_filter_sLORETA(m,P,A,Q,L,R, timeSteps ,number_of_frames, smoothing, q_given)
P_store = cell(0);
z_inverse = cell(0);
h = zef_waitbar(0, 'Filtering');
if not(q_given)
q_values = Q;
end
for f_ind = 1: number_of_frames
zef_waitbar(f_ind/number_of_frames,h,...
['Filter... |
a27341666e55db6c43455e0734b1f6ec6574efb8fc0bc211142e7ed050422a7a | MATLAB | 708 | 18 | function [processed_data] = zef_select_channels(f, select_channels)
%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 u... |
2138dae178798422ae042e7a4dca24ff205823683fb08c52b6b3a37a90568054 | MATLAB | 711 | 28 | function MLGamma = gammaRasterPlot(Gamma,T_hmm,t_axispoints,t_axislabels)
% plotting function that takes a state time course Gamma, reshapes it into
% trials given by T (which must be uniform), and plots a raster plot of the
% max likelihood state vs trials.
[NT,K] = size(Gamma);
T = T_hmm(1);
if size(T_hmm,2)>1
n... |
53bcb32be5e11416b4bd8397d139fd2c441234f08ebb16ad01efcb513b1c0257 | MATLAB | 711 | 27 | data_ind = 1;
snr_ind = 1;
frame_number = 1;
file_name = 'training_dataset_p1_10dB.mat';
folder_name = [fileparts(mfilename('fullpath')) filesep 'data'];
file_name = [folder_name filesep file_name];
load(file_name);
data_tree = zef.dataBank.tree;
rec_ind = 1;
fn = fieldnames(data_tree);
for k=1:numel(fn)
node ... |
a6bed343d2d37c3d69aee42f30e843fe7080038c406b36ac860d61a9805b99e8 | MATLAB | 711 | 26 | function [mean_residuals,demean_residuals] = meanResiduals(hmm,Gamma,orders,XX,residuals)
K = length(hmm.state); T = size(Gamma,1);
S = hmm.train.S==1;
regressed = sum(S,1)>0;
if isempty(orders),
order = 0;
else
order = orders(end);
end
residuals0 = residuals;
if order>0
for k=1:K
residuals(:,r... |
f858ca19d16c6e2ad72e21097459784f8591fabac01b58be2890107a180eff02 | MATLAB | 711 | 34 | function i = findfirst(dblVal,vecVals)
%findfirst Find first entry in sorted vector vecVals where dblVal >= vecVals
% i = findfirst(dblVal,vecVals)
dblMax = max(vecVals);
dblMin = min(vecVals);
dblRange = dblMax-dblMin;
intNum = numel(vecVals);
if dblVal>dblMax
i = intNum;
elseif dblVal<dblMin
i = 1;
els... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.