[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: nonlinear equation help
From: |
Przemek Klosowski |
Subject: |
Re: nonlinear equation help |
Date: |
Fri, 02 Sep 2011 15:58:16 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:6.0) Gecko/20110816 Thunderbird/6.0 |
On 09/02/2011 03:38 PM, fv2005 wrote:
function y = f(x)
...
y(1) = w5 - x(1)*(wb+x(2)+x(3));
y(2) = x(1)*(x(2)+lb) - 72*lm;
y(3) = x(1)*(x(3)+rb) - 72*rm;
endfunction
[x, info] = fsolve (@f, [1; 3]);
When i run this script i got this error:
error: A(I): Index exceeds matrix dimension.
By your fsolve() invocation, the parameter vector length is 2, but in
the function you use x(3).
When you call [x, info] = fsolve (@f, [1; 3]);
it still doesn't work, but the error message is different, at least :)