[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Ignorance
From: |
John W. Eaton |
Subject: |
Re: Ignorance |
Date: |
Mon, 5 Mar 2012 22:34:37 -0500 |
On 5-Mar-2012, Robert T. Short wrote:
| I don't know the dimensions or the direction a-priori. The obvious
| answer is 1:N followed by a repmat but there are so many cute little
| octave tricks that I was hoping there was something really clever.
Given
x = 1:4;
y = ones (3, 1);
z = ones (3, 4);
here are the ways I can think of:
Repmat:
repmat (x, [3,1])
Kron:
kron (x, y)
Indexing:
x(y,:)
Outer product:
y * x
Broadcasting:
z .* x
Are there any others?
jwe
- Ignorance, Robert T. Short, 2012/03/05
- Re: Ignorance, Jordi GutiƩrrez Hermoso, 2012/03/05
- Re: Ignorance, Robert T. Short, 2012/03/05
- Re: Ignorance, Robert T. Short, 2012/03/06
- Re: Ignorance, Jordi GutiƩrrez Hermoso, 2012/03/06
- Re: Ignorance, Robert T. Short, 2012/03/06