www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/SpecifyDifferentNumberofOutputsthanndimsXExample.m
%% Multiple Output Arguments %% % Create a 3-D array and assign the length of each dimension to a separate % variable. Each output argument corresponds to one dimension of |A|. A = ones(3,4,5); [sz1,sz2,sz3] = size(A) %% % Specify only two output arguments when computing the size of |A|. Since a % third output argument is not specified, the lengths of the second and % third dimensions of |A| are collapsed into |sz2|. [sz1,sz2] = size(A) %% % Specify more than three output variables when computing the size of |A|. % The fourth and fifth output arguments are set to 1. [sz1,sz2,sz3,sz4,sz5] = size(A)