I was wondering how to divide two arrays
a = [1,2,3,4,5]
b = [2,4,6,8,15]
to get
a/b = [0.5,0.5,0.5,0.5,0.3]
Thanks in advance for the help.
I was wondering how to divide two arrays
a = [1,2,3,4,5]
b = [2,4,6,8,15]
to get
a/b = [0.5,0.5,0.5,0.5,0.3]
Thanks in advance for the help.
Most operations in IDL are performed element-wise, so doing c = a / b
will do what you want here.
Just express the arrays as floating variables or doubles, then you will get the desired results. Otherwise, the results will come as 0.0 as it rounds up to the lowest integer. I hope it will work.