Home »
Public Forums »
archive »
Re: Help : Scalar operations
Re: Help : Scalar operations [message #14811] |
Sat, 27 March 1999 00:00 |
korpela
Messages: 59 Registered: September 1993
|
Member |
|
|
In article <36FD0F88.7D9BFAA0@info.fundp.ac.be>,
VU KHAC Tri <tvk@info.fundp.ac.be> wrote:
>
> I have a 3D matrix and have to execute a scalar operation on the all
> elements (floating-point number) of this matrix. It seems very simple to
> do with:
> for...
> for...
> for...
> Then, I see that this doing takes so much time (about 1 minute) since
> the matrix is of the size 100*100*100.
There are very few scalar operations on a matrix that you need to
do loops for... What scalar operation is it?
Scalar addition and multiplication are easy.
IDL> a=fltarr(100,100,100)
IDL> a=a+1 ; Adds 1 to every element of a
IDL> a=a*10 ; Multiplies every element of a by 10
Eric
--
Eric Korpela | An object at rest can never be
korpela@ssl.berkeley.edu | stopped.
<a href="http://sag-www.ssl.berkeley.edu/~korpela">Click for home page.</a>
|
|
|
Current Time: Fri Oct 10 06:54:56 PDT 2025
Total time taken to generate the page: 0.64060 seconds