I coded this and it types me error

조회 수: 1 (최근 30일)
flashpode
flashpode 2021년 7월 14일
댓글: Sulaymon Eshkabilov 2021년 7월 14일
Hi, I was coding and when it puts me error
M_conjunt = [];
M_D_AIS1 = [];
M_D_AIS2 = [];
for i=1:1:N & j=1:1:P here is the error
seq1=AIS1(i);
seq2=AIS2(j);
linia1=convertStringsToChars(seq1);
linia2=convertStringsToChars(seq2);
if linia1 == linia2
M_conjunt = [M_conjunt,i];
end
end
for i=1:1:N & j=1:1:P
Error: Incorrect use of '=' operator. To assign a value to a variable, use '='. To compare
values for equality, use '=='.
anyone knows why it is an error with the j and not with the i
Thank youuu

채택된 답변

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021년 7월 14일
편집: Sulaymon Eshkabilov 2021년 7월 14일
The loop operation canNOT be assigned twice in one for. Your code has to be in this format:
for i=1:N % You can skip step size of 1
for j=1:P
...
end
end
  댓글 수: 3
dpb
dpb 2021년 7월 14일
"The loop operation canNOT be assigned twice in one for. ..."
Fixup of typo/missing negation that was intended -- dpb
Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021년 7월 14일
Thanks @dpb! Good catch. I was making illegit statements with my silly typo.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by