Info
此问题已关闭。 请重新打开它进行编辑或回答。
why showing assignment dimension mismatch?
1 次查看(过去 30 天)
显示 更早的评论
i was trying to read binary data from an image.bt while reading data by randm array,d, after some time it shows 'Subscripted assignment dimension mismatch' at "bine(1,z)=data(t+z)". i have given my code below. can you please help me out..!!
data=binimage(196,1:200);
image=imread('car.png'); image=image(127:130,83:86);
temp= double(image);
d=[5,8,2,9,4,1,8,0,3,8,1,4,9,4,9,25,3]
k=1; z=0; t=0; bine=0;
for z=1:1:d(k,2)
bine(1,z)=data(t+z);
bine
k=k+1;;
end
1 个评论
Star Strider
2016-2-23
I cannot run your code, and since I can’t see if I get the error when I run it, I won’t list this as an Answer.
One problem is this line:
k++;
it is not MATLAB syntax. You would have to state it as:
k = k+1;
回答(1 个)
MHN
2016-2-23
this works correctly:
data = rand(1,200);
d=[5,8,2,9,4,1,8,0,3,8,1,4,9,4,9,25,3];
k=1;
for z=1:1:d(k,2)
bine(1,z)=data(z);
k=k+1;
end
0 个评论
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!