how to read a .mat file into table

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.

 Respuesta aceptada

Star Strider
Star Strider el 31 de En. de 2022

0 votos

The struct2table function could be helpful.

2 comentarios

Nobutaka Kim
Nobutaka Kim el 1 de Feb. de 2022
This is sweet.
Star Strider
Star Strider el 1 de Feb. de 2022
Thank you!
I intend that as a follow-on to the procedure in Load List of Variables into Structure Array.
.

Iniciar sesión para comentar.

Más respuestas (1)

Benjamin Thompson
Benjamin Thompson el 31 de En. de 2022

0 votos

Are you trying to transpose the data display? transpose(S.data) or use the apostrophe transpose operator, S.data'

5 comentarios

Nobutaka Kim
Nobutaka Kim el 31 de En. de 2022
S.data shown by @Stephen worked but I wish I could get row and column headings and have it appear full screen size, scrollable, etc.
I have worked quite a bit with Pandas and Matplotlib in Python but is there anything similar?
Benjamin Thompson
Benjamin Thompson el 31 de En. de 2022
App Designer supports a table display. You can also find your workspace variable in the workspace variables list, right click it, and "view" or "display" it to see all its contents.
Nobutaka Kim
Nobutaka Kim el 1 de Feb. de 2022
@Benjamin Thompson, transpose worked great for now as I get numbered rows for iterations of the simulation.
Still cannot figure out how to put column headings though.
Stephen23
Stephen23 el 1 de Feb. de 2022
"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 el 1 de Feb. de 2022
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.

Iniciar sesión para comentar.

Productos

Versión

R2021b

Etiquetas

Preguntada:

el 31 de En. de 2022

Comentada:

el 1 de Feb. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by