Re: How to create a matrix out of a vector
- From: "Konrad Viltersten" <tmp1@xxxxxxxxxxxxxx>
- Date: Thu, 10 Nov 2005 08:55:37 +0100
>>> one of the many solutions
>>> v=1:4;
>>> m=repmat(v,10,1)
>>
>> Thank you. When you mention "one of many" i get
>> curious - what more is there?
>>
> Some more of the many solutions:
> % using kronecker tensor product
> kron(ones(1,20),v')
> % this is what happens inside repmat
> v(ones(1,20),:)'
Ok, got it. The last one is what i actually use most of the time
since i never remember the special name but always remember
some algebra.
Thanks!
> it´s easier to follow when you or someone else is debugging
> the code.
What debugging? My code never needs debug. I always get it
right the first time, you know. ;)
--
Vänligen
Konrad
---------------------------------------------------
Sleep - thing used by ineffective people
as a substitute for coffee
Ambition - a poor excuse for not having
enough sense to be lazy
---------------------------------------------------
.
- References:
- Re: How to create a matrix out of a vector
- From: us
- Re: How to create a matrix out of a vector
- From: Konrad Viltersten
- Re: How to create a matrix out of a vector
- Prev by Date: Re: plotting two datas
- Next by Date: Re: Repeated Question...
- Previous by thread: Re: How to create a matrix out of a vector
- Next by thread: Proper syntax for saving figures
- Index(es):
Relevant Pages
|