www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/CloneSizeFromExistingArrayzerosExample.m
%% Clone Size from Existing Array %% % Create an array of zeros that is the same size as an existing array. A = [1 4; 2 5; 3 6]; sz = size(A); X = zeros(sz) %% % It is a common pattern to combine the previous two lines of code into % a single line: X = zeros(size(A));