how can i create a 3d-plot from a matrix?
4 views (last 30 days)
Show older comments
Nicolas Ippoliti
on 6 May 2019
Commented: Walter Roberson
on 8 May 2019
Hi guys, i trying to create a 3d-plot or a waterfall-plot from an excel-table but i cant do it.
Maybe y could help me!.
The problem is that i have 3 variables: Time, frequency and soundpressure (SPL) y can take a look into the attachment.
could y tell me how to make it?
i thank y a lot!
Regards
Nico.
2 Comments
Walter Roberson
on 7 May 2019
You have 13 header lines.
Your 14th header line starts with 'Hz' and has a number of values listed after that without indication of meaning. Are those times?
Line 15 to 45 appears to start with a frequency and have a number of readings after that. Are those SPL corresponding to the times from line 14 ?
You have semi-colon delimited values with comma as the decimal separator.
It appears that at higher frequencies you have fewer entries per line.
Accepted Answer
Walter Roberson
on 8 May 2019
I have attached code.
The data was messier than it looked. There were two half-tables side by side, same times and same frequencies, but with ranges that are somewhat different. The code plots them in different plots, variables SPL1 and SPL2 .
You might want to set YScale to log for the plots, since the frequences increase on a log scale (looks like 10*log10(4) as the exponent)
For the first plot, it is meaningful to set the Z scale to log, as all of the values are positive except for one 0.
For the second plot, there are a number of negative values, so it does not make sense to use log scale.
The top left point in the right hand set of data comes across as exactly 65535 . I was pretty sure that was an indicator of invalid data, so I set that to nan.
2 Comments
Walter Roberson
on 8 May 2019
I am not sure what a terz frequency distribution is, or an octave for this purpose? Do you want the frequency axes to be labeled with log2 of the frequency?
More Answers (0)
See Also
Categories
Find more on Octave in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!