【发布时间】:2021-06-04 21:23:25
【问题描述】:
如何在 MATLAB 图中找到轴的最小值和最大值?
【问题讨论】:
标签: matlab
如何在 MATLAB 图中找到轴的最小值和最大值?
【问题讨论】:
标签: matlab
以下是对当前坐标区执行此操作的方法(即gca):
xLimits = get(gca,'XLim'); % Get the range of the x axis
yLimits = get(gca,'YLim'); % Get the range of the y axis
zLimits = get(gca,'ZLim'); % Get the range of the z axis
上面的每个变量都是一个 1×2 数组,其中包含相应轴的最小值和最大值。您可以查看the documentation on axes properties了解更多信息。
【讨论】:
如果您介意使用属性方式使用
xlim ylim 或 zlim 检索最小值和最大值或
xlim([minValue maxValue]) 设置限制。
有关其他参数,请参阅set or query axis limits。
【讨论】: