How can I give user defined Yes No for multiple set of code?

1 回表示 (過去 30 日間)
RAHUL KUMAR
RAHUL KUMAR 2018 年 9 月 7 日
回答済み: Dennis 2018 年 9 月 7 日
%Enter Initial coordinates as Matrix for triangle u = input('Enter the triangle Matrix:\n');
%Enter Initial coordinates as Matrix for quadrilateral u = input('Enter the quadrilateral Matrix:\n');
For these two, I want to create a Yes/No command. For case one if a user gives yes then ask for traingle matrix. If no then ask the user for second case which is quadrilateral matrix. I don't want infinite loop. Please help?

採用された回答

Dennis
Dennis 2018 年 9 月 7 日
a=input('Do you like triangles? Y/N','s');
if strcmpi(a,'y')
%triangles
elseif strcmpi(a,'n')
%no triangles
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEncryption / Cryptography についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by