[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
A(i,:) in .oct file?
From: |
John W. Eaton |
Subject: |
A(i,:) in .oct file? |
Date: |
Thu, 8 Feb 2001 21:37:58 -0600 |
On 7-Feb-2001, Paul Kienzle <address@hidden> wrote:
| Hi! How do I translate something like:
|
| g(i+1,:) -= l(i)*g(i,:);
|
| into a .oct file?
|
| for (j=0; j<g.columns(); j++) g(i+1,j) -= l(i)*g(i,j);
|
| works, but it isn't very elegant,
I can't think of a better way. Assuming g is a Matrix object, I think
you could use
g.insert (g.row(i+1) - l(i)*g.row(i), i+1, 0);
but that is going to generate some copies. Probably the loop is about
as good as you can do.
| and I do have a lot of them to do.
I suppose I would define a macro or inline function to hide the
details.
jwe
-------------------------------------------------------------
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
-------------------------------------------------------------