help-octave
[Top][All Lists]
Advanced

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

late Re: A Simple Matrix Construction Question


From: alrl1
Subject: late Re: A Simple Matrix Construction Question
Date: Wed, 5 Feb 2003 14:09:42 MET

Sorry about the delay, but I think my answer worths it:
If you pretend to do the following:

        A_mxn = B_mxc .* C_cxn

and C is a 1xn row/column vector, you can do this

        A_mxn = B_mxc * diag(C_1xn)

instead of 

        A_mxn = B_mxc .* C_1xn(1:c,1)

It's the solution to a problem I had some days ago.
> There is probably a really simple way to do the
> following, but I'm suffering from a mental block.
> 
> I have a row array 'Y' of arbitrary length, 1xn.
> 
> I want to create an mxn matrix where all of the rows
> are the same as 'Y'.
> 
> Of course, I want to do this without resorting to
> loops.
> 
> Thanks in advance.
>




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



reply via email to

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