Error: Unrecognized function or variable 'FunExample2'. / Error in Newton Root (line 15)
1 次查看(过去 30 天)
显示 更早的评论


I am not very familiar with MATLAB, but use it as a tool in my Numerical Methods class. I have taken a C class before so I do have a general idea of how to debug, but I really have no idea with this one.
0 个评论
回答(1 个)
Walter Roberson
2020-10-22
You have stored FunExample2 and FunDerExample2 inside the same file NewtonRoot.m .
There are valid reasons to do something like that, but a side effect of doing that is that it is difficult to get a handle to any function other than the first one from outside of the function file, such as at the command line.
You should put FunExample2 into FunExample2.m and FunDerExample2 into FunDerExample2.m
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Numerical Integration and Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!