How can break a 1D array to matrix?
Show older comments
I have a 1D array of length 153600 X 1. I want to break this array into 320 X 240 matrix how to do that . Value in the 1D array has been attached in a notepad.
Answers (1)
Image Analyst
on 30 Dec 2020
Try this:
m = reshape(v, 320, []);
where v is your vector and m is your 2-D matrix.
2 Comments
Zara Khan
on 30 Dec 2020
Image Analyst
on 30 Dec 2020
So do you want the left half of that
leftHalfImage = m(:, 1:240);
or the right half image
rightHalfImage = m(:, 241:end);
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!