No BSD License  

Highlights from
zoom on 2d by doublicating

1.0

1.0 | 2 ratings Rate this file 1 Download (last 30 days) File Size: 632 Bytes File ID: #12255

zoom on 2d by doublicating

by Nayef Nustafa

 

13 Sep 2006 (Updated 13 Sep 2006)

Zoom*2 by doublicating each piont on X & Y

| Watch this File

File Information
Description

This will zoom the image (2D Array) by factor of 2, and this is done by doublicating each point on the X-axis, and then doublicating each point on the Y-axis.

MATLAB release MATLAB 7 (R14)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
14 Sep 2006 Magnus Schaefer

I can“t comment on the usefulness of this, but the code alone justifies this rating...

No preallocation, unnecessary for-loops...

The one-liner
BIG=[reshape(repmat([reshape(repmat(IM,2,1),size(IM,1),[])]',2,1),2*size(IM,2),[])]';
speeds this up by a factor of roughly 530 on my machine...

14 Sep 2006 Duane Hanselman

The value of this submission is limited to the fact that it demonstrates how NOT to do something in MATLAB. This submission does NOT use MATLABs inherent array capabilities. Two sets of nested FOR loops are Two too many. I encourage the author to remove this file.

15 Sep 2006 Nayef Mustafa

thanks a lot for ur comments.
about the line provided by Magnus Schaefer, the matrix was rotated by 90 degrees.
Can u provid some help about this?

thanks in advance.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
transforms Nayef Nustafa 22 Oct 2008 08:39:08
zoom 2d doublicating Nayef Nustafa 22 Oct 2008 08:39:08
zoom 2d doublicating manuvtnitc VT 24 Sep 2009 05:10:29

Contact us at files@mathworks.com