Home > data-utility > granger_causality > gcause_libs > format_inputdata.m

format_inputdata

PURPOSE ^

This function formats data into desired structure

SYNOPSIS ^

function [len, dimension, data_list] = format_inputdata(data_list, default_value)

DESCRIPTION ^

 This function formats data into desired structure
 Each row is one collection of variable categories at one time stamp
   - number of observations sampled
 Each column is one type of variable input
   - the dimension of variables

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [len, dimension, data_list] = format_inputdata(data_list, default_value)
0002 % This function formats data into desired structure
0003 % Each row is one collection of variable categories at one time stamp
0004 %   - number of observations sampled
0005 % Each column is one type of variable input
0006 %   - the dimension of variables
0007 
0008 if nargin < 2
0009     default_value = -99;
0010 end
0011 
0012 mask_nan = isnan(data_list);
0013 data_list(mask_nan) = default_value;
0014 
0015 [n, m] = size(data_list);
0016 
0017 if m > n
0018     data_list = data_list';
0019     len = m;
0020     dimension = n;
0021 else
0022     len = n;
0023     dimension = m;
0024 end

Generated on Tue 23-May-2017 03:00:58 by m2html © 2005