Info

この質問は閉じられています。 編集または回答するには再度開いてください。

why showing assignment dimension mismatch?

1 回表示 (過去 30 日間)
Rezaur Rahman
Rezaur Rahman 2016 年 2 月 23 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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
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
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

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by