help-octave
[Top][All Lists]

## Re: late Re: A Simple Matrix Construction Question

 From: John W. Eaton Subject: Re: late Re: A Simple Matrix Construction Question Date: Wed, 5 Feb 2003 10:42:24 -0600

```On  5-Feb-2003, David Bateman <address@hidden> wrote:

| If this is what you want to do, why not do for example
|
| m = 4;
| n = 5;
| y = rand(1,n);
| x = y(ones(m,1),:);
|
| where x will now be a m by n matrix with m copies of y,
| one per row. Indexing should definitively be more
| computationally efficient than doing a matrix multiply
| which is O(n^3).

Indexing is not necessarily more efficient.  See

http://www.octave.org/mailing-lists/help-octave/2003/133

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
-------------------------------------------------------------

```