help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

## Re: Urgent help for fsolve

 From: Søren Hauberg Subject: Re: Urgent help for fsolve Date: Sun, 25 Sep 2011 20:55:15 +0200

```søn, 25 09 2011 kl. 11:50 -0700, skrev skazmi:
> i am trying to optimize these two non-linear equations,
>
> i dont know where is the bug can any one help.

I don't know what kind a problem you are seeing, but perhaps you just
need to declare 'one' and 'two' global inside the function as well?

global x y
function [one, two] = f (x, y)
global x y
one = (x^-1.3)*P - 1.2*(1-y)^-3.6;
two = 2+3*y-x;
three = [one two]'
return;
endfunction

[[x, y], fval, info] = fsolve (@f, [1; 2])

/Søren

>
> global x y
> function [one, two] = f (x, y)
>   one = (x^-1.3)*P - 1.2*(1-y)^-3.6;
>   two = 2+3*y-x;
>   three = [one two]'
> return;
> endfunction
>
> [[x, y], fval, info] = fsolve (@f, [1; 2])
>
>
> --
> View this message in context:
> http://octave.1599824.n4.nabble.com/Urgent-help-for-fsolve-tp3841920p3841920.html
> Sent from the Octave - General mailing list archive at Nabble.com.
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave

```

reply via email to

 [Prev in Thread] Current Thread [Next in Thread]