Filter löschen
Filter löschen

How can break a 1D array to matrix?

2 Ansichten (letzte 30 Tage)
Zara Khan
Zara Khan am 30 Dez. 2020
Kommentiert: Image Analyst am 30 Dez. 2020
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.

Antworten (1)

Image Analyst
Image Analyst am 30 Dez. 2020
Try this:
m = reshape(v, 320, []);
where v is your vector and m is your 2-D matrix.
  2 Kommentare
Zara Khan
Zara Khan am 30 Dez. 2020
m is becoming a size of 320 X 480
Image Analyst
Image Analyst am 30 Dez. 2020
So do you want the left half of that
leftHalfImage = m(:, 1:240);
or the right half image
rightHalfImage = m(:, 241:end);

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by