Is there a way to exclude variables from a string array after they've been chosen using menu function?
2 次查看(过去 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!