Regarding the contour matrix obtained from contourf

1 Ansicht (letzte 30 Tage)
Sparsh Garg
Sparsh Garg am 8 Jul. 2021
Kommentiert: Sparsh Garg am 8 Jul. 2021
I recently ran contourf on the image below .
.
The output of this is as follows
Now when I plot the contour matrix for Number 240,I am getting something like this
Any ideas why there is a line in the middle of the contour,I know that the matrix returned from contourf is a 2xn matrix wherein the first column in each set contains the contour level and the number of vertices at that level.So what I did was from the original contour matrix I removed those columns where it mentions the contour level and the number of vertices at that level.
I also read somewhere that the inputs to contourf should be strictly increasing or decreasing,since the input image contains rows and columns not in strict increasing/decreasing order,do you think that could be one reason as to why there is a line in the middle of the 3rd plot.
Any help will be appreciated.
  4 Kommentare
KSSV
KSSV am 8 Jul. 2021
Yes you will get like that....you eed to clean/ remove those data points.
Sparsh Garg
Sparsh Garg am 8 Jul. 2021
Thanks for the help KSSV,I replaced the points by NAN and that helps.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Contour Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by