How to plot contour plot with NaN in matrix ?
조회 수: 25 (최근 30일)
이전 댓글 표시
I have three matrices xvalues (X), yvalues (Y) and measured property (Z). All these three are upper triangular matrices with lower triangular part containing NaN values. How do I plot a contour plot only for the upper triangular part?
댓글 수: 0
답변 (1개)
Star Strider
2014년 12월 10일
편집: Star Strider
2014년 12월 10일
If you plotted it as it currently exists, the NaN values would simply not plot anything, that is be blank areas of the contour plot.
댓글 수: 8
Star Strider
2014년 12월 12일
I have no idea what you’re doing, but you can see what the result is if you replace the contourf plot with surfc:
surfc(X,Y,Z)
To see only ‘Z’:
surfc(Z)
The problems with ‘X’ and ‘Y’ can be seen if you plot them:
surfc(X)
surfc(Y)
The point is that ‘X’ and ‘Y’ are not linear, and ‘Z’ seems not to exist along the diagonal.
I’ll leave you to sort these. The plotting is trivial once you deal with whatever is going on with your data.
참고 항목
카테고리
Help Center 및 File Exchange에서 Contour Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!