# How to convert time series table into an array and save as an excell file?

67 ビュー (過去 30 日間)
Piyumal Samarathunga 2023 年 2 月 18 日

I have data collected from accelerometers, and that data is saved in a timetable.
I have saved that timetable data as a .mat file.
The data in this .mat file is of the duration data type.
I used the table2array function to convert this table to array.
Following is my code and data set that I used.
New = table2array(NI_Data)
When I use that function, it indicates that all of my variables as sec values, and data type shows as duration.
How I can convert a time series table into an array as data format as double and how to remove the suffix sec at the end of each data?
Thank you.
##### 2 件のコメントなしを表示なしを非表示
Walter Roberson 2023 年 2 月 19 日
https://www.mathworks.com/help/matlab/ref/writetimetable.html ?
Askic V 2023 年 2 月 20 日
Wow, it seems that Matlab has a built in function for just about everything that one can need.

サインインしてコメントする。

### 回答 (2 件)

Askic V 2023 年 2 月 18 日

New = table2array(NI_Data);
time_sec = seconds(New(:,1));
acc_1 = seconds(New(:,2));
plot(time_sec, acc_1)
Regarding saving into an Excel file, I suggest to look this part of the documentation:
Matlab has an excellent documentation with a lot of examples.
##### 0 件のコメント-2 件の古いコメントを表示-2 件の古いコメントを非表示

サインインしてコメントする。

Corey Silva 2023 年 3 月 14 日
You can use writetimetable to write a timetable to an excel spreadsheet without any conversions needed.

サインインしてコメントする。

### カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

R2022b

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by