Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

why showing assignment dimension mismatch?

1 Ansicht (letzte 30 Tage)
Rezaur Rahman
Rezaur Rahman am 23 Feb. 2016
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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 Kommentar
Star Strider
Star Strider am 23 Feb. 2016
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;

Antworten (1)

MHN
MHN am 23 Feb. 2016
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