필터 지우기
필터 지우기

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