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


writetimeseries

write a timeseries to file

Syntax

writetimeseries(ts)
writetimeseries(ts, filename)
writetimeseries(..., OptionName, Value, ...)

Arguments

ts

timeseries

filename

file path

Optional pairs OptionName, Value are:

"Delimiter", string

the column separator. Default value: ",".

"WriteVariableNames", boolean

when %t, writes variables names in the file (column names). Default value: %t.

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, OptionName, 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 May 22 12:56:24 CEST 2025