[Top][All Lists]

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

Re: row vectors changed to column vectors?

From: Christoph Dalitz
Subject: Re: row vectors changed to column vectors?
Date: Tue, 10 Feb 2004 20:07:08 +0100

On Tue, 10 Feb 2004 17:46:55 +0100
"Christian T. Steigies" <address@hidden> wrote:
> > >BTW, if you are creating vectors by doing things like
> > >
> > >  clear a;
> > >  for i = 1:N
> > >    a(i) = something();
> > >  end
> > >
> > >then you should probably rethink your method, because this type of
> > >loop the vector A to be resized N times, which will be slow.
> Yes, it is slow, what do you suggest? Should I create a matrix with
> zero(N,1) first? Looks as if it is just a few ms difference.
If your matrix entries can be computed in some way, might look for a way
to create your matrix with builtin vector/matrix operations, eg. 
could be created with (1:n).^2.

You can find more suggestions in
(it is in German, but the formula are understandable supralingual)

Hope this helps,


Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

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