<< Direct computation with Table | Tables | array2table >> |
Nelson provides extensive capabilities for reading and writing tables to files, supporting both text-based and binary storage formats to meet different data management needs.
Text files (.csv, .txt, etc.):
Binary file:
Binary format is recommended for preserving exact numeric precision and working with large datasets.
Read/Write table to .nh5 file
% Create a sample table with sensor data
T = table([1.5; -2.3; 4.7], [0.5; 1.1; -0.7], [-1; 2; 3], 'VariableNames', {'Voltage', 'Current', 'Resistance'});
R = T;
filename = [tempdir(), 'table_example.nh5'];
save(filename, '-nh5', 'T');
clear T
load(filename, 'T');
assert(isequal(T, R));
T
Read/Write table to text file
% Create a sample table with sensor data
T = table([1.5; -2.3; 4.7], [0.5; 1.1; -0.7], [-1; 2; 3], 'VariableNames', {'Voltage', 'Current', 'Resistance'});
filename = [tempdir(), 'table_example.csv'];
writetable(T, filename);
T2 = readtable(filename);
writetable, readtable, load, save.
Version | Description |
---|---|
1.10.0 | initial version |
Allan CORNET