How to convert a time series data to txt file?
34 views (last 30 days)
Show older comments
James Pinto on 1 Nov 2022
I have a time series data saved during simulation. How to convert it to a txt file?
Maik on 1 Nov 2022
%% Time Series Data in to Text File
timeSeriesVector = randi([1 10],30,1);
txtFileCreate = fopen('timeSeriesVector.txt','wt');
%Comma Separated Values
% Print in Separate Rows
%% Time Series Matrix File to Data File
timeSeriesArray= randi([1 10],30,30);
Lei Hou on 18 Nov 2022
You can use timeseries2timetable to convert your timeseries to a timetable. Then use writetimetable to write your data to a txt file.
Find more on Time Series Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!