Solve nonlinear equations in app designer

Let's say I need to solve nonlinear equations below in app designer.
function F = root2d(x)
F(1) = 3*x(1)^2+5*x(2)^3-15;
F(2) = 4*x(1)^3-7*x(2)^2+18;
end
I can solve it in app designer if I use this function as an external function and call it form the file. But in my case I need to be able to change coefficents of x(1) and x(2) also. These coefficients can be entered by users of my app so I need to use this function as an internal function (private or public). As an internal function I cannot write a useful code. This is my first question in MATLAB central so it is possible that I cannot explain my problem well. I hope that it is clear. I need your helps.
Thank you already,

 Respuesta aceptada

Matt J
Matt J el 23 de Mayo de 2019
Editada: Matt J el 23 de Mayo de 2019
Have your app code invoke fsolve as follows
fsolve(@(x)root2d(x,c) ,___________ )
where
function F = root2d(x,c)
F(1) = c(1)*x(1)^2+c(2)*x(2)^3-c(3);
F(2) = c(4)*x(1)^3-c(5)*x(2)^2+c(6);
end

Más respuestas (0)

Categorías

Más información sobre Develop Apps Using App Designer en Centro de ayuda y File Exchange.

Preguntada:

el 23 de Mayo de 2019

Comentada:

el 23 de Mayo de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by