comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Multiplication turning array into scalar -- who wants to try?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Multiplication turning array into scalar -- who wants to try? [message #53261] Sat, 31 March 2007 20:40
swingnut is currently offline  swingnut
Messages: 30
Registered: September 2005
Member
JOURNALING AT IDL PROMPT:

temp=[0.0,-1.0,0.0]
print,size(temp)
; 1 3 4 3
temp2=-25.0
print,size(temp2)
; 0 4 1
print,temp2/ABS(temp2)
; -1.00000
temp2=temp2/ABS(temp2)
print,SIZE(temp2)
; 0 4 1
print,temp2*temp
; 0.000000 1.00000 0.000000
temp=temp2*temp
print,temp
; 0.000000 1.00000 0.000000
print,SIZE(temp)
; 1 3 4 3

OUTPUT OF SEQUENCE OF PRINT STATEMENTS IN MY CODE:

;----------
;Adjusting density power law in increments of [0.000000 , -1.00000 ,
0.000000 ]
;adjustmentIncrement =
; 0.000000 -1.00000 0.000000
;SIZE of adjustmentIncrement =
; 1 3 4 3
;-----
;deltaVirtHeight =
; -0.0678234
;SIZE of deltaVirtHeight =
; 1 1 4 1
;-----
;signOfDifference = deltaVirtHeight/ABS(deltaVirtHeight) =
; -1.00000
;SIZE of signOfDifference =
; 1 1 4 1
;-----
;Multiply signOfDifference with each element of adjustmentIncrement,
i.e.,
;adjustmentIncrement[i]=adjustmentIncrement[i]*signOfDiffere nce,
i=0,1,2:
;adjustmentIncrement =
; 0.000000 1.00000 0.000000
;SIZE of adjustmentIncrement =
; 1 3 4 3
;-----
;But if we do
adjustmentIncrement=adjustmentIncrement*signOfDifference, it becomes a
scalar?
;adjustmentIncrement =
; 0.000000
;SIZE of adjustmentIncrement =
; 1 1 4 1
; % Attempt to subscript LOCDENSPL with <INT ( 1)> is out
of range.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: for cordy: really inspiring movies - ehmu moz - (1/1)
Next Topic: Re: Multiplication changes array dimensions since a scalar and a 1x1 array are not the same

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:48:50 PDT 2025

Total time taken to generate the page: 0.00617 seconds