Home > database > ensemble_table2datastruct.m

ensemble_table2datastruct

PURPOSE ^

Converts a MATLAB table variable into an Ensemble datastruct

SYNOPSIS ^

function data_st = ensemble_table2datastruct(data_t)

DESCRIPTION ^

 Converts a MATLAB table variable into an Ensemble datastruct

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function data_st = ensemble_table2datastruct(data_t)
0002 % Converts a MATLAB table variable into an Ensemble datastruct
0003 
0004 % 26Jan2015 Petr Janata
0005 
0006 data_st = ensemble_init_data_struct;
0007 data_st.vars = data_t.Properties.VariableNames;
0008 nvars = length(data_st.vars);
0009 
0010 data_st.data = cell(1,nvars);
0011 data_st.name = data_t.Properties.Description;
0012 
0013 for ivar = 1:nvars
0014     data_st.data{ivar} = data_t{:,ivar};  
0015 end
0016 
0017 end

Generated on Wed 20-Sep-2023 04:00:50 by m2html © 2003