Is there a way to exclude variables from a string array after they've been chosen using menu function?
3 ビュー (過去 30 日間)
古いコメントを表示
Materials = ["Aluminum";"Cadmium";"Iron";"Tungsten";string(newMaterial)];% newMaterial is Copper in this case
Choice1 = menu('Please choose the alloy''s first component',Materials);
Choice2 = menu('Please choose the alloy''s second component',Materials);
What I need to do is remove the variable chosen in Choice1 from the options of materials to choose in Choice2. I can't seem to find the command/function that will allow me to do this.
0 件のコメント
採用された回答
KSSV
2021 年 9 月 3 日
編集済み: Walter Roberson
2021 年 9 月 3 日
Read about setdiff. Or use strcmp get the position and remove the string.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!