What does Matlab do with blank values?
显示 更早的评论
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.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Whos 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!