问题
As stated, what is the easiest way to determine programmatically if a Matlab axes object is a 2D or 3D plot?
回答1:
Examine the output of [az,el] = view
. If it's 2D, then el == 90
.
回答2:
use: numel(axis)/2
it will return 2 for 2d and 3 for 3d.
来源:https://stackoverflow.com/questions/8064969/how-to-determine-if-axes-are-2d-or-3d-in-matlab