Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
2025.0.0 - Português


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

History

VersãoDescrição
2024.0.0 Introduction in Scilab.
Report an issue
<< writetable Timeseries/Table csvDefault >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu Oct 24 11:16:58 CEST 2024