MATLAB Answers

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

1 view (last 30 days)
Asha D.
Asha D. on 26 Nov 2019
Answered: Asha D. on 29 Nov 2019
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)

  0 Comments

Sign in to comment.

Answers (2)

Guillaume
Guillaume on 26 Nov 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.

  0 Comments

Sign in to comment.


Sign in to answer this question.