writetimeseries
write a timeseries to file
Syntax
writetimeseries(ts) writetimeseries(ts, filename) writetimeseries(..., Name, Value)
Arguments
- ts
timeseries
- filename
file path
- Name, Value
Name: 'Delimiter', Value: string (default value: ','): the column separator.
Name: 'WriteVariableNames', Value: boolean (default value: %t): when %t, writes variables names in the file (column names).
Description
The writetimeseries function writes a timeseries into a text file, where data are separated by comma (default value). It is possible to specify the delimiter to be applied: writetimeseries(ts, filename, "Delimiter", delim) Accepted file formats are .txt, .dat or .csv.
writetimeseries(ts) writes timeseries ts into the file timeseries.txt saved in TMPDIR.
writetimeseries(ts, filename, Name, Value) can be used to specify the column delimiter and to write the variable names into the file.
Examples
dt = [datetime(2022,1,10):caldays(1):datetime(2022,1,21)]'; hc = [13574; 13169; 11999; 12146; 15456; 10545; 11091; 21657; 11393; 10283; 10924; 16208]; hp = [13593; 15306; 16766; 15941; 14558; 13722; 18401; 14632; 14571; 14925; 14284; 15028]; ts = timeseries(dt, hc, hp, "VariableNames", ["Time", "HC", "HP"]); writetimeseries(ts, fullfile(TMPDIR, "data.txt")); r = readtimeseries(fullfile(TMPDIR, "data.txt"));
See also
- readtimeseries — create a timeseries from a file
- timeseries — create a timeseries - table with time as index
History
Versão | Descrição |
2024.0.0 | Introduction in Scilab. |
Report an issue | ||
<< writetable | Timeseries/Table | csvDefault >> |