Can someone tell me why I keep getting parse and syntax errors here?

clear, clc
temp = input('Please enter the outside-air temperature in fahrenheits');
if temp >= 80
disp('Please wear shorts.')
elseif temp > 60
disp('It is a beautiful day')
else
disp('Please wear a jacket or coat')
end

回答 (1 件)

per isakson
per isakson 2018 年 5 月 25 日
編集済み: per isakson 2018 年 5 月 25 日

0 投票

To make your code more readable, I formatted it and in that process added a closing end. Now, your code works just fine
Please enter the outside-air temperature in fahrenheits>> 67
It is a beautiful day
>>
Answer: An end to close the if-statement is missing

カテゴリ

ヘルプ センター および File ExchangeProgramming についてさらに検索

タグ

質問済み:

n
n
2018 年 5 月 25 日

編集済み:

2018 年 5 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by