please help me rectify the error
for i = 1 : 18
if vegetation(i,1) == 5 && land_cover_type == 32
high = 0.2632; low = 0.7095;
elseif vegetation(i,1) > 5 && vegetation(i,1) < 11 && land_cover_type == 21
high = 0.3468; low = 0.6514;
elseif vegetation(i,1) > 11 && vegetation(i,1) < 23 && land_cover_type == 32
high = 0.2740; low = 0.7260;
elseif vegetation(i,1) > 11 && vegetation(i,1) < 23 && land_cover_type == 23
high = 0.3853; low = 0.6147;
elseif vegetation(i,1) > 11 && vegetation(i,1) < 23 && land_cover_type == 33
high = 0.3774; low = 0.6226;
end
HIGH(i,1) = high
LOW(i,1) = low
end
my error is
??? Operands to the || and && operators must be convertible to logical scalar values.
Error in ==> Untitled7 at 12
elseif vegetation(i,1) > 5 && vegetation(i,1) < 11 && land_cover_type == 21

댓글 수: 2

David Sanchez
David Sanchez 2014년 6월 23일
What are the type of your variables? Could you please paste here the output/value of vegetation(i,1) and land_cover_type?
Elysi Cochin
Elysi Cochin 2014년 6월 23일
편집: Elysi Cochin 2014년 6월 23일
vegetation and land_cover_type are of double datatype in the range [21 33] and [4 19] respectively

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

 채택된 답변

Image Analyst
Image Analyst 2014년 6월 23일

1 개 추천

Use the debugger. You'll discover that land_cover_type is a vector, not a single number.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Specialized Power Systems에 대해 자세히 알아보기

태그

질문:

2014년 6월 23일

답변:

2014년 6월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by