How to solve this undefined problem?
显示 更早的评论
Now im facing
Error: Undefined function or variable n
the value n is actually i get it from the other file that prompt user to enter num of patients
n = input('Enter number of patients : ');
both files are located in the same file and the matlab is also opening the current file that located both files named start.
I also have try adding
n = p;
in the choiceThree file for trying to use a variable that has not been defined before this line of code executes. But the ouput still show out
Error: Undefined function or variable p
By the way, both files i got write
function output = start
in start file and
function output = choiceThree(n);
in choiceThree file
1 个评论
Matt J
2022-3-21
We need to see the innards of both functions to really know what's wrong.
回答(1 个)
Matt J
2022-3-21
0 个投票
I also have try adding n = p
The error message says that p is undefined. Therefore, you should be doing p=n.
类别
在 帮助中心 和 File Exchange 中查找有关 Programming 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!