How to use fsolve

After that I get my target equation which has only 1 Unknown. So something like:
eqn=[x^2];
solution=fsolve(@(x) eqn, startx);
Unfortunatlly that does not work. Thank You very much!

댓글 수: 1

Stephen23
Stephen23 2018년 4월 12일
편집: Stephen23 2018년 4월 12일
The fsolve help states that the first input must be "specified as a function handle or function name", and all of the examples show fsolve being used with function handles. You should learn about function handles:
Also note that the square brackets are totally superfluous:

답변 (1개)

Torsten
Torsten 2018년 4월 12일

0 개 추천

eqn5 = @(x)x^2+1;
solution = fsolve(eqn5, startx);
Best wishes
Torsten.

이 질문은 마감되었습니다.

질문:

2018년 4월 12일

마감:

2018년 4월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by