What does Matlab do with blank values?
Ältere Kommentare anzeigen
What does MATLAB do if a variable is left blank? Here's my situation. My program requests the user to input either "Yes" or "No" when asked a question. Using strcmp, if the answer is "Yes," I ask the user to input values for certain variables, which are used later in the program to test whether the solutions found are within certain ranges. In other words, I'm adding constraints to my solutions, but I only want the constraints if the user entered "Yes." The user can only input values for the variables mentioned above if (s)he enters yes-- but what if the answer is no? The variables will have no value assigned to them. Will MATLAB simply not evaluate the expressions that contain those variables? Or will it assign them an automatic value of zero? If the latter is true, I will need to add another layer of "if" statements, directing MATLAB whether to carry on with the constraints since a value of zero would still add constraints that I don't want.
I appreciate any help. If I'm not clear enough, I can post some code, although it's a bit long.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Whos 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!