Sir plz help me to rectify this error
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
kaavya subramani
am 6 Aug. 2016
Kommentiert: kaavya subramani
am 11 Aug. 2016
X=reshape(x,size(Y));
where x=1; and Y=256 * 256 uint8
I got the error like this
"To RESHAPE the number of elements must not change."
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 6 Aug. 2016
Since x=1, you can use ones():
X = ones(size(Y)); % X is a double
If x is not one, but some other scalar, then you can use.
X = x * ones(size(Y)); % X is a double
If you want X to also be uint8, pass that class in:
X = ones(size(Y), 'uint8'); % Now X will also be uint8
Weitere Antworten (1)
Walter Roberson
am 6 Aug. 2016
You cannot reshape a scalar into a 256 by 256 matrix. reshape() cannot create new data.
Perhaps you want
X = repmat(x, size(Y));
0 Kommentare
Siehe auch
Kategorien
Mehr zu Digital Filter Analysis 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!