How to add only two choices for an input parameter ?
Ältere Kommentare anzeigen
I would like a function to accept only 'string1' or 'string2' for param3 i.e.:
output = fun(param1, param2, param3)
What should I add to param3 ?
Thank you
Akzeptierte Antwort
Weitere Antworten (1)
John D'Errico
am 5 Mai 2018
0 Stimmen
You cannot "add" something to param3.
You CAN test to see if param3 is anything else, and then return an error.
Kategorien
Mehr zu Characters and Strings finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!