How to make text conditional statements

complete total beginner here, but im trying to write a script that tells u how many bones in a limb but need help writing the seond line

回答 (1 件)

ClementJ
ClementJ 2022 年 5 月 14 日

0 投票

Hi,
Maybe use '\n' in your line 2:
prompt = 'Enter Bady Part : \n';
g = input(prompt,'s');
if g == 'hand'
disp('27')
elseif g == 'finger'
disp('3')
end

カテゴリ

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

タグ

質問済み:

2022 年 5 月 14 日

回答済み:

2022 年 5 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by