How can I extract data from a structure? I keep getting "The class struct has no Constant property or Static method named 'strains'." error
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sarah Blust
am 20 Mai 2019
Beantwortet: Bob Thompson
am 20 Mai 2019
I am currently running the Ncorr software with matlab and need to pull the strain data from it.
The below is the data in structure form and I can't figure out how to get the values out of the "strains" section. I tried simply doing [struct.strains] but the I get the error "The class struct has no Constant property or Static method named 'strains'". I don't care how the values are presented, I just need the numbers to put in a research notebook.
>> handles_ncorr.data_dic
ans =
struct with fields:
displacements: [1×152 struct]
dispinfo: [1×1 struct]
strains: [1×152 struct]
straininfo: [1×1 struct]
Thanks for the help in advance and let me know if further information is needed!
0 Kommentare
Akzeptierte Antwort
Bob Thompson
am 20 Mai 2019
ans.strains
The 'struct with fields' is the standard output line that tells you the class of the variable you just viewed, 'ans.'
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Structures finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!