フィルターのクリア

choose which function to run it

6 ビュー (過去 30 日間)
Ahmed Amin
Ahmed Amin 2021 年 5 月 6 日
コメント済み: Dharmendar 2023 年 10 月 18 日
How can i make user choose which function that will be called
Ex: to run function 1 please enter 1
to run function 2 please enter 2 ..etc
  1 件のコメント
Dharmendar
Dharmendar 2023 年 10 月 18 日
1

サインインしてコメントする。

採用された回答

Chunru
Chunru 2021 年 5 月 7 日
You can use switch:
f = input('Which function to use? ');
switch f
case 1
func1;
case 2
func2;
otherwise
error('Wrong choice');
end
Of cource, you can also use if..elseif..else..end

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by