Hi,
using fsolve do the trick but I use a vector of equation. If i do it by hand its something like:
function fcns=eqns(z)
a=z(1);
b=z(2);
c=z(3);
d=z(4);
e=z(5);
f=z(6);
g=z(7);
h=z(8);
i=z(9);
j=z(10);
k=z(11);
l=z(12);
m=z(13);
o=z(14);
p=z(15);
q=z(16);
r=z(17);
s=z(18);
t=z(19);
u=z(20);
v=z(21);
w=z(22);
x=z(23);
y=z(24);
aa=z(25);
fcns(1) = a-(0.05*(1/10)/((0.05+5*(a+b))));
fcns(2) = b-(0.05*(1/10)/((0.05+5*(a+b+c))));
fcns(3) = c-(0.05*(1/10)/((0.05+5*(b+c+d))));
fcns(4) = d-(0.05*(1/10)/((0.05+5*(c+d+e))));
fcns(5) = e-(0.05*(1/10)/((0.05+5*(d+e+f))));
fcns(6) = f-(0.05*(1/10)/((0.05+5*(e+f+g))));
fcns(7) = g-(0.05*(1/10)/((0.05+5*(f+g+h))));
fcns(8) = h-(0.05*(1/10)/((0.05+5*(g+h+i))));
fcns(9) = i-(0.05*(1/10)/((0.05+5*(h+i+j))));
fcns(10) = j-(0.05*(1/10)/((0.05+5*(i+j+k))));
fcns(11) = k-(0.05*(1/10)/((0.05+5*(j+k+l))));
fcns(12) = l-(0.05*(1/10)/((0.05+5*(k+l+m))));
fcns(13) = m-(0.05*(1/10)/((0.05+5*(l+m+o))));
fcns(14) = o-(0.05*(1/10)/((0.05+5*(m+o+p))));
fcns(15) = p-(0.05*(1/10)/((0.05+5*(o+p+q))));
fcns(16) = q-(0.05*(1/10)/((0.05+5*(p+q+r))));
fcns(17) = r-(0.05*(1/10)/((0.05+5*(q+r+s))));
fcns(18) = s-(0.05*(1/10)/((0.05+5*(r+s+t))));
fcns(19) = t-(0.05*(1/10)/((0.05+5*(s+t+u))));
fcns(20) = u-(0.05*(1/10)/((0.05+5*(t+u+v))));
fcns(21) = v-(0.05*(1/10)/((0.05+5*(u+v+w))));
fcns(22) = w-(0.05*(1/10)/((0.05+5*(v+w+x))));
fcns(23) = x-(0.05*(1/10)/((0.05+5*(w+x+y))));
fcns(24) = y-(0.05*(1/10)/((0.05+5*(x+y+aa))));
fcns(25) = aa-(0.05*(1/10)/((0.05+5*(y+aa))));
end
And then I use:
guess=[ones(25,1)];
result=fsolve(@eqns, guess)
It solve in 2 sec. My only problem now is how to use a vector of equation (sym) inside the function because i generate my equations using this code:
for ii = 1:ntype ;
t(ii)-(0.05*(1/n)/((0.05+5*(matchnom(ii)))));
fct(ii)=ans;
end;
so simply how to use a vector of equation and not type in all the equation inside the function argument.
Thanks
