How can I access the data stored in a 1x16 struct in a .mat file?

2 visualizzazioni (ultimi 30 giorni)
The name of the .mat file: NoDotsAnalyzed.mat.
I downloaded the .mat file, then opened it using: load('NoDotsAnalyzed.mat')
This created 3 structures: current_save, data_dic_save, reference_save. The sizes, respectively: 1x16, 1x1, 1x1. The data I believe is stored in data_dic_save. How can I access this data so that I can plot it?
  1 Commento
Stephen23
Stephen23 il 12 Set 2018
@Ken Mathai: your question is self-contradictory: in your title you ask "How can I access the data stored in a 1x16 struct...", but in the description you state that "... current_save, data_dic_save, reference_save. The sizes, respectively: 1x16, 1x1, 1x1. The data I believe is stored in data_dic_save", which means that the structure you want to plot has size 1x1.
So what is the size of the structure: as your title (1x16), or as the question body (1x1) ?

Accedi per commentare.

Risposta accettata

Stephen23
Stephen23 il 12 Set 2018
Modificato: Stephen23 il 12 Set 2018
S = load('NoDotsAnalyzed.mat');
plot(S.data_dic_save.WhateverFieldYouWantToPlot)
You need to know which field/s of the structure that you want to plot. You need to then use the dot syntax, like I showed, to access the data in that field. I cannot show you the exact fieldname in my example, because you did not tell us the name of the field that you want to plot.
  2 Commenti
Stephen23
Stephen23 il 12 Set 2018
Ken Mathai's "Answer" moved here:
I ended up being able to access the fields within data_dic_save. It turns out that was a container for multiple fields that hold all the data.
I'm proceeding to plot by just doing: plot(data_dic_save.FIELD1, data_dic_save.FIELD2) etc.
Thank you for your assistance!
Stephen23
Stephen23 il 12 Set 2018
@Ken Mathai: Remember to accept my answer if it helped you!

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Workspace Variables and MAT Files in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by