Filter löschen
Filter löschen

Is there a way to exclude variables from a string array after they've been chosen using menu function?

5 Ansichten (letzte 30 Tage)
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.

Akzeptierte Antwort

KSSV
KSSV am 3 Sep. 2021
Bearbeitet: Walter Roberson am 3 Sep. 2021
Read about setdiff. Or use strcmp get the position and remove the string.

Weitere Antworten (0)

Kategorien

Mehr zu Characters and Strings finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by