How do i plot data from a structure? and extract data from a structure?
3 views (last 30 days)
Show older comments
Maximilian Jatzkowski
on 27 Nov 2018
Commented: Maximilian Jatzkowski
on 27 Nov 2018
Hi!
I have been given several tables of values, which cannot be opened, only read directly into matlab using the command "importdatat". When I do that, it saves the values in a structure, like below:
SpeedA=
struct with fields:
distanceA_km: [1716*1 double]
SpeedA_kmph: [1716*1 double]
My question is, how can now sort of "unpack" this structure, to plot it or see it in table/array/vector form? Plotting would help, as i am supposed to create a linear approximation of the values. I tried using struct2cell and then cell2mat, but that gives me all the values in one column, whereas they should appear in 2 columns, seperated between speed and distance. What do i ?
Thanks!
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Structures in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!