how to read a .mat file into table

143 次查看(过去 30 天)
I have a data: [5 x 3000 double] data.mat file tracking robot movements for 3000 iterations.
The variables are:
data = [
x
y
theta
u1
u2
]
I did
S = load('data.mat');
S
disp(S)
in a livescript but don't get a nice spreadsheet or table to view the data.
I am familiar with Pandas for Python.
How can I display this data so the rows are variables and columns are iterations 1 to 3000.

采纳的回答

Star Strider
Star Strider 2022-1-31
The struct2table function could be helpful.

更多回答(1 个)

Benjamin Thompson
Benjamin Thompson 2022-1-31
Are you trying to transpose the data display? transpose(S.data) or use the apostrophe transpose operator, S.data'
  5 个评论
Stephen23
Stephen23 2022-2-1
"Still cannot figure out how to put column headings though."
As Star Strider wrote, you should take a look at STRUCT2TABLE
And also double click on the variable in the workspace to open the variable viewer.
Nobutaka Kim
Nobutaka Kim 2022-2-1
I get it. Make a struct using slice syntax for the rows of the data.m, put the labels for the struct and then call the struct2table(). Thanks, I did that workspace way too.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Data Type Conversion 的更多信息

标签

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by