Getting error for this code as Index in position 1 exceeds array bounds. Pls tell solution

1 visualización (últimos 30 días)
a=imread('baboon.jpg');
disp(a);
imshow(a);
for i=1:1:512
for j=1:1:512
b{i,j,1} = dec2bin(a(i,j),8);
end
end
disp(b)

Respuestas (2)

Guillaume
Guillaume el 26 de Nov. de 2019
Most likely, your image is smaller than 512x512.
If that's not the problem then give us the entire text of the error message.

Asha D.
Asha D. el 29 de Nov. de 2019
Thank you.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by