Undefined function or Variable error
1 次查看(过去 30 天)
显示 更早的评论
Hi,
I create a function to use the Mid-point formula to calculate the integral value, but it keeps showing undefined error. I wonder where is the problem, and how I can fix it? Thanks!
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1370839/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1370844/image.png)
0 个评论
回答(1 个)
Walter Roberson
2023-4-30
x = a:h:b;
However, any current version of MATLAB may have problems with you replacing the function handle f with the result of invoking the function handle. Use different variable names for the function handle and the result of evaluation.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!