help with matlab error
12 次查看(过去 30 天)
显示 更早的评论
Just need help with the problem
1st part of code is in the attahcment and heres the second part
I am getting an error that says "variable reshas an incorrect value" and "output arguement xroot and maybe others not assigned to during call to PA_secant" and "not enough output arguements"
8 个评论
Walter Roberson
2019-4-25
When I run your code with those parameters, I do not get any error message.
"Variable res has an incorrect value" looks like it might be from the automatic grading system.
回答(1 个)
Cris LaPierre
2019-5-11
编辑:Cris LaPierre
2019-5-11
It looks like your teacher is using MATLAB Grader for this problem. Because of variable scope in a function, MATLAB Grader is calling your function with inputs your teacher defines, and assessing the outputs. It can not check any other variables. The outputs are captured in variables your teacher has named, which is why you see an error message about a variable your code does not create.
It would appear the output variable they named res is not being assigned the expected value by your function. The inference, then, is that your function has not been properly implemented.
I think it's safe to assume res = residual. Check how you are calculating your residual. Compare to your notes from class. If there is any feedback provided in this assessment test, use that to help find your mistake.
0 个评论
社区
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!