Surf 3D Plot for measuring data does not work
Mostra commenti meno recenti
Hi there,
We have got a problem with 3D plotting data of a measuring series. The project contains sensitive data so I unfortunately can't share the matlab file. However I am going to describe it as good as I can:
The measurements can be split in three different types- lets call them x, y, z. From the test series I get two different tables with x, y, and z data, which I import as arrays in matlab. With the use of a script I combine those arrays to one final array. Every array entry can be empty (because there was no measurement) an is then displayed as NaN in the array. Or it contains a measurement. The final array contains an average, if there is a measurement in the same entry of both original arrays. In case of the same entrys of both arrays being empty (NaN), also the final array will have an entry with NaN (see attachment).

This all works fine. But when I am trying to plot the final array with "surf(x, y, z)" I just get lines instead of surfaces (see attachment). Those lines are technically correct, but is there a way to receive a colored surface for my data?

It works if I am setting all the NaN entrys to zero, but this is not making sense in my usecase (because a NaN entry just says that there is no measurement made, it could be something different from zero).
I hope someone has a solution,
Greetings from Germany (I'm sorry for my English :)),
Max
2 Commenti
KSSV
il 9 Giu 2022
When you plot a surface using surf, to have color each vertex should have some number. In your case, mostly you have NaN's; thats why you are getting onlines.
Either you fill the NaN's using fillmissing or use scatter plot.
Max Winger
il 9 Giu 2022
Risposte (0)
Categorie
Scopri di più su Logical in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
