replicate a matrix, make it bigger, but don't tile

1 view (last 30 days)
Hi, How do I replicate a matrix and double its size without tiling the way repmat does? So how do I get [1,2;3,4] to be [1,1,2,2;3,3,4,4]? Do I have to loop and assign each element or is there a function that would so this? Ray

Answers (1)

Image Analyst
Image Analyst on 20 Mar 2014
If you have the Image Processing Toolbox:
out = imresize(in, [desiredNumberOfRows, desiredNumberOfColumns], 'nearest');

Categories

Find more on Mathematics and Optimization in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!