Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

why showing assignment dimension mismatch?

1 visualización (últimos 30 días)
Rezaur Rahman
Rezaur Rahman el 23 de Feb. de 2016
Cerrada: MATLAB Answer Bot el 20 de Ag. de 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 comentario
Star Strider
Star Strider el 23 de Feb. de 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;

Respuestas (1)

MHN
MHN el 23 de Feb. de 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

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by