06-25-2012 04:14 PM
I consider myself a beginner at LabVIEW. With that said, I have a 3D array (x,y,z) where x and y both range from 0-400 and z ranges from 0-13. I want to multiply all of the x's and y's under each z, by a different constant. For example, x=0-400, y=0-400 and z=0, I want to multiply both x and y by 0.4. Then for x=0-400, y=0-400 and z=1 I want to multiply x and y by 0.43 (random cosntant), and so on.
How can I do this?
Thanks in advance!
06-25-2012 04:46 PM
06-25-2012 04:47 PM
Can you attach a simple VI containing your 3D array as a diagram constant?
06-25-2012 05:07 PM
I actually asked the wrong question. If this thread needs to be deleted and I need to start another one, just let me know.
This is what I'm trying to do. I have a 3D array (x,y,z) where x and y are pixel locations of an image (rows and columns ranging from 0-400) and z is wavelength (ranging from 0-13). For each combination of x,y and z there is a value. I want to hold z constant at 0 (z=0) and multiply every value at every pixel location by a constant.
For example x=0-400, y=0-400 and z=0. I want to multiply the value at every combination of x and y by a constant while holding z at 0. Then move onto z=1 and multiply every combination of x and y by a different constant.
I attached an image of an indicator from the 3D array below. The three white boxes are the x y and z and the fourth grey box is the value I want to change for each combination of x and y for z=0-13.
06-25-2012 05:12 PM
X, y and z shouldn't be multiplied by the constant, only the value at the location of x, y and z.
06-26-2012 12:09 AM
Hi Kelly,
did you notice message #2? It does exactly what you're asking for. Just replace the "random" function by your own factors...
06-26-2012 01:21 AM
@GerdW wrote:
It does exactly what you're asking for.
Are you sure? I don't think it reassembles the output array in the same order as the input array
06-26-2012 01:56 AM
06-26-2012 02:00 AM
HI Kelly,
see the attachement hope that helps.
06-26-2012 08:09 AM
See the attached image. This will first take a slice of 3D array, which is 2D array at specified z, then multiplies the entire data set by 10, the replace the existing data set by the new data set.
If you want to repeat this step on every z, you can use a For loop and a shift register to do it.