Quantcast
Channel: MATLAB Central Newsreader Recent Posts
Viewing all articles
Browse latest Browse all 19628

repeating array elements

$
0
0
% First way:
[m n] = size(A);
B = reshape(A,1,m,1,n);
B = repmat(B, [2 1 2 1]);
B = reshape(B,[m n]*2)

% Second way
B = kron(A,ones(2))

% Bruno

Viewing all articles
Browse latest Browse all 19628

Trending Articles