Solving a system of equations in matlab
Afficher commentaires plus anciens
I'm trying to solve a system of equations in matlab that is parametrized in A. The equations are: x^2+Ay^2=12 x*y=3 and A is parametrized from 1/3 to 3.
my solution thus far:
I created a function file to solve for x and y x=x(1) and y=x(2)
function F = functionfile(x,A) F(1)=x(1).*x(1)- A.*(x(2).*x(2)) -12; F(2)=x(1).*x(2)-3; end
and I solve it in my main file:
x0=[1;1]; A=2; options=optimset('Display','off'); x=fsolve(@functionfile,x0,options,A);
My problem is, when I try to make A a vector of 1/3:1/3:3, it returns an error message that doesn't occur when I give A a single value. How do I fix this problem?
Réponse acceptée
Plus de réponses (1)
E
le 16 Mar 2013
0 votes
Catégories
En savoir plus sur Mathematics 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!