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

    %% Clone Size from Existing Array
% Create a cell array of empty matrices that is the same size as an existing array.

% Copyright 2015 The MathWorks, Inc.

A = [7 9; 2 1; 8 3];
sz = size(A);
C = cell(sz)
%%
% It is a common pattern to combine the previous two lines of code into a single line.
C = cell(size(A));