How can I reshape a matrix into a square?
1 view (last 30 days)
Show older comments
How can I reshape a matrix into a square by deleting rows/columns, but cannot use loops or if statements, example: 4x6 into a 4x4 or 3x2 into a 2x2?
0 Comments
Answers (1)
Image Analyst
on 29 Oct 2013
If you have the Image Processing Toolbox, you can use imresize()
out = imresize(originalMatrix, [desiredRows, desiredColumns]);
Or you can use interp2().
0 Comments
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!