www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/CreateVectorFromArrayWithSingletonDimensionsExample.m

    %% Create Vector from Array with Singleton Dimensions
% Create a 1-by-1-by-5 array of ones.

% Copyright 2015 The MathWorks, Inc.

mat = repmat(1,[1,1,5])

%%
% Condense the data in the third dimension to create a 5-by-1 column vector.
squeeze(mat)