[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Arguments out?
From: |
Vic Norton |
Subject: |
Arguments out? |
Date: |
Thu, 11 Dec 2003 10:23:48 -0500 |
I'm afraid I don't understand how output arguments work in octave. I
am writing a routine, simp, to solve the linear programming problem
minimize
c * x
subject to
A * x = b
prod( x(I) >= 0 ) == 1
The function should look like this
[ x, pi, fail ] = simp( A, b, c, I ) # pi * b == c * x
with nargout = 3. But, for nargout = 0, 1, 2, I would like it to return
simp( A, b, c, I ) # nargout == 0, return ans = x
x = simp( A, b, c, I ) # nargout == 1
[ x, fail ] = simp( A, b, c, I ) # nargout == 2
Is this possible? Or do I have to use
[ x, fail, pi ] = simp( A, b, c, I )
in order that the nargout = 0, 1, 2 returns be what I want?
Regards,
Vic
--
*---* mailto:address@hidden
| Victor Thane Norton, Jr.
| Mathematician and Motorcyclist
| phone: 419-353-3399
*---* http://vic.norton.name
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------
- Arguments out?,
Vic Norton <=