Area for contour plot - object oriented
显示 更早的评论
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 个评论
Star Strider
2021-8-13
.
回答(1 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!