error occuring

조회 수: 1 (최근 30일)
prem preet
prem preet 2011년 10월 22일
if (N_red = 3) & (difference_red<0.1)
unlike_red = 0.5
??? if (N_red = 3) & (difference_red<0.1) | Error: The expression to the left of the equals sign is not a valid target for an assignment.
can anyone suggest it plsss as soon as possible
  댓글 수: 1
Jan
Jan 2011년 10월 22일
"plsss as soon as possible" is not helpful in this forum. It does not sound polite, but pushy. In addition there is a high correlation between the appearence of "plzzz" and the "no_attempt" and "doit4me" tag, which are both desasterous.
If you want to be polite, accept an answer which solves the problem and thank the auther in the comment section. Just as a suggestion.

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

답변 (2개)

Grzegorz Knor
Grzegorz Knor 2011년 10월 22일
Should be:
if (N_red == 3) & (difference_red<0.1)
  댓글 수: 3
Jan
Jan 2011년 10월 22일
And my MLint has copied IA's recommendation also.
Grzegorz Knor
Grzegorz Knor 2011년 10월 22일
You are right.

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


Jan
Jan 2011년 10월 22일
Description of the problem:
N_red = 3
This assigns the value 3 to the variable N_red. But in an IF-condition you want to compare, such that the == operator is required.

카테고리

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