Hi, I make 320 by 240 pixel matrices that I need to convert to 640 x 480. But, i want A(1,1) to go into B(1,1), B(1,2), B(2,1) and B(2,2) so that I am in effect doubling the size of the whole thing. is there a function that can do that?

Weitere Antworten (1)

Roger Stafford
Roger Stafford am 20 Mär. 2014

0 Stimmen

There is no specific function that does this, but you can use 'repmat' to accomplish that:
B = A(repmat(1:size(A,1),2,1),repmat(1:size(A,2),2,1));
or else you can use 'ceil' as follows:
B = A(ceil((1:2*size(A,1))/2),ceil((1:2*size(A,2))/2));
(Actually you are quadrupling the size of A.)

Kategorien

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by