I am currently working on constructing my dataset after extracting signals from a (.mat) database in Matlab.
[X,Y]=extract_structures(filename);
time=X(1).Data;
time =
Columns 1 through 6
0 0.0100 0.0200 0.0300 0.0400 0.0500
Columns 7 through 12
0.0600 0.0700 0.0800 0.0900 0.1000 0.1100
Columns 5 119 through 5 124
51.1803 51.1903 51.2003 51.2103 51.2203 51.2303
Columns 5 125 through 5 127
51.2403 51.2503 51.2603
The X representing time. I extracted this time variable and other signals and constructed my data vector, starting with the first column as time, following this syntax :
data = [time' variable_u' variable_y'....... ];
To be able to use the csv file in Python my dataset should have a date
column that contains the datetime of the time-series.
How can I achieve the transformation of the 'time' column into a datetime format using Matlab before exporting the csv file into Python.
time = X(1).Data
is. Is it a MATLABdatetime
? Aduration
? A string which looks like a datetime? Adatenum
? Take a look at what additional information we might need in a minimal reproducible example and then edit your question to include it. The fact you're starting from a mat file and targeting Python seems irrelevant here, to answer this question we just need details about (1) what data type you have in MATLAB and (2) how you want it to appear when written to csv, which has no sense of data types so it's just a formatted string