代码中有函数或变量“p”无法识别,优化误差

am为函数z的最大值对应的横坐标值,代码没有错误,但是运行总是错误

답변 (1개)

Tushar
Tushar 2023년 3월 23일

0 개 추천

Hi,
The error message you are seeing is likely due to the fact that the variable p is not defined before it is used in the code. Specifically, the line am = fsolve(fun2, p(2)/(p(1)+p(2))); is trying to use the value of p before it has been assigned a value.
To fix this error, you can define p before using it in the code.
Hope it helps!

카테고리

도움말 센터File Exchange에서 启动和关闭에 대해 자세히 알아보기

제품

릴리스

R2022a

태그

질문:

2022년 12월 2일

답변:

2023년 3월 23일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!