Surf 3D Plot for measuring data does not work

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

KSSV
KSSV 2022년 6월 9일
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.
Thank you for the advice!
I never knew there are so many options for "fillmissing". I did compensate the missing data with "fillmissing" via the moving meridian in my latest plot. The plot is not looking too bad now. Probably I leave it like that. So fillmissing is the usual way to go for missing data?
With kind regards,
Max

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

제품

릴리스

R2020b

태그

질문:

2022년 6월 9일

댓글:

2022년 6월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by