フィルターのクリア

how to make a code that guess the color of the string variable stored ?

1 回表示 (過去 30 日間)
Muhammad
Muhammad 2022 年 4 月 20 日
編集済み: Arif Hoq 2022 年 4 月 20 日
mywords = "sulaman is here";
ht = text(0.8,0.8,mywords,'color','b')
now i want to make the code that take the guess from the user
whats my favourite color ?
if user input blue then disp "you are right" if wrong then "try again"

採用された回答

Arif Hoq
Arif Hoq 2022 年 4 月 20 日
編集済み: Arif Hoq 2022 年 4 月 20 日
try this:
mywords = "sulaman is here";
ht = text(0.8,0.8,mywords,'color','b');
A = input('whats my favourite color ? ','s');
str='blue';
if strcmp(A,str)==1
disp('you are right')
else
disp('try again')
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStructures についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by