如何在MATLAB中获取轴的上限(和下限)? [英] How do i get the upper (and lower) limits of an axis in MATLAB?
本文介绍了如何在MATLAB中获取轴的上限(和下限)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在MATLAB图形中找到轴的最小值和最大值?
How do I find the minimum and maximum of the axis in a MATLAB plot?
推荐答案
Here's how you can do it for the current axes (i.e. 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 x 2数组,其中包含各个轴的最小值和最大值.您可以查看有关轴属性的文档以获取更多信息.
Each variable above will be a 1-by-2 array containing the minimum and maximum values for the respective axis. You can check the documentation on axes properties for more information.
这篇关于如何在MATLAB中获取轴的上限(和下限)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文