Getting error for this code as Index in position 1 exceeds array bounds. Pls tell solution
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(2 个)
Guillaume
2019-11-26
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!