Given cout matrix, plot contours
Show older comments
I am trying to recreate what the MATLAB contour, contourf, etc. functions do, except I don't want to create it from a grid. I actually have a vector of contours that is formatted exactly like the cout in the typical function call
[cout,hout] = contour(...)
The first column in cout lists the contour level and number of points that define the contour (for example [55;337] which means that the first 55-dB contour has 337 points). Then after the next 337 columns of X-Y coordinates, I get the next contour (for example [60;123] which means 60-dB contour has 123 points).
In essence I want to reverse the process. This format is how MATLAB stores the data to create contour plots, but I want to plot the contours given that I have them stored in the proper format in the cout handle.
The key here is that I have multiple contour "islands" (i.e. two distinct contours associated with the same decibel level) and I want to be able to plot them together as one contour with a single label, but without trying to connect them. If I had the grid, I would just use the contour function and let MATLAB's internal functions take care of the contour formatting. But I only have the vector of contour coordinates.
I tried to open the contour function's source code in MATLAB to see how they do it, but this just calls another function contourHGUsingMATLABClasses. I tried to open this one and I could not access it.
Any help would be much appreciated.
Answers (0)
Categories
Find more on Contour Plots 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!