Question regarding optimization function fsolve

Is there any function to solve non-linear trigonometric equations in MAT LAB other than fsolve?
What is the '@' anonymous in the '@function ' ? is there anything that we can replace the @ with ---?
implementation of fsolve function in MAT LAB simulinc is getting problem, how can we generate C code for this optimization function?

 Réponse acceptée

Walter Roberson
Walter Roberson le 28 Jan 2019

0 votes

fzero if it is a function of one variable .
The trick to using anonymous functions in aa MATLAB Function Block is to create a second function that does the work.
result = MySolve(uu)
...
function result = MySolve(uu)
ff = @(xx) appropriate code
xx = fsolve(ff, x0)
...
The @ cannot be in a direct function block but it can be aa layer down .

2 commentaires

There is no code generation support for fsolve.
You may need to convert to fminbnd or fminsearch of the square of the function .
thank you

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Optimization dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by