[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: efficient way to fill a matrix based on a pattern?
From: |
CdeMills |
Subject: |
Re: efficient way to fill a matrix based on a pattern? |
Date: |
Thu, 2 Sep 2010 00:05:23 -0700 (PDT) |
Jordi Gutiérrez Hermoso wrote:
>
>
>> omega = rho.^toeplitz(1:n)
>>
>> where you've previously defined rho and n?
>
> Oops, off-by-one error. Should be:
>
> omega = rho.^toeplitz(0:n-1)
>
>
Faster:
omega = toeplitz(rho.^(0:n-1));
regards
Pascal
--
View this message in context:
http://octave.1599824.n4.nabble.com/efficient-way-to-fill-a-matrix-based-on-a-pattern-tp2426331p2484975.html
Sent from the Octave - General mailing list archive at Nabble.com.