Loading table from object from .mat file
Mostrar comentarios más antiguos
I import a table object that I have stored in a .mat file (attachment) using:
ParaDat=load('ParameterDatabase.mat')
Then, I try to assign values to the different elements of that table, e.g.
A1=ParaDat.a1
but this line generates the error message: Unrecognized field name "a1"
Also, if I try to convert the imported struct to a table using:
Dat=struct2table(ParaDat)
A1=Dat.a1
but I wtill see the same error message. How can I address the different variables of the imported table?
3 comentarios
Your MAT file contains one table named PARATABLE:
S = load('ParameterDatabase.mat')
T = S.ParaTable
T.a1
Do not LOAD directly into the workspace.
Saeid
el 7 de Abr. de 2024
Stephen23
el 7 de Abr. de 2024
"why should I NOT load directly into the workspace?"
For most of the reasons listed here:
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Data Type Conversion en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!