Area for contour plot - object oriented
Show older comments
I am looking for a way to calculate the area of a contour plot, which uses an object oriented function. I have a table of objects of which I am importing a section of the values to create the contour plot and I am succesfully plotting the graph, so I know this section of the code works. I am sure it is a simple solution but all examples I can find refer to [X Y] = contour(A,B,C) system and I am unsure of how to translate.
Help would be appreciated.
Code:
function obj = contour(obj,ref)
if ~exist('ref','var'); ref = 1; end
obj.contourFig = figure();
obj.contourAx = axes(obj.contourFig);
[xValues,yValues] = meshgrid(obj.MyObjects(ref).xValues,obj.MyObjects(ref).yValues);
zMin = 10;
zInc = 10;
zMax = obj.MyObjects.maxPower;
zLevels = zMin:zInc:zMax;
contour(obj.contourAx,xValues,yValues,obj.MyObjects(ref).powerData,zLevels);
grid off
title(obj.MyObjects.filename)
end
1 Comment
Star Strider
on 13 Aug 2021
.
Answers (1)
Categories
Find more on Line Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!