LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Mulitplying array with a constant

I'm collecting wavelength and power in a 2D array. I need to convert the wavelength to frequency. When I divide the wavelength array value into C (speed of light constant), the resulting frequency array is not correct. What is the proper method for scaling array with a constant?
0 Kudos
Message 1 of 4
(2,605 Views)
The right formula is:

wavelength = c / frequency

... just pay attention to have all terms measured in the same units.

Good Luck
0 Kudos
Message 2 of 4
(2,605 Views)
Sorry if I wasn't clear in my original question. Yes I'm aware of the relationship: wavelength = c/frequency or frequency = c/wavelength. I kept the units in meters so everything is fine there. The problem is that the array returns the starting frequency value corrrect. The next data in the array calculates the frequency value incorrectly. Secondly, the data I supplied is to six significant digit, but I also noticed labview extending the significant digit further out if I create and indicator on the input string, and expand the significant digit over six. I see other values added. Where do those come from??
0 Kudos
Message 4 of 4
(2,605 Views)
,

There are two ways to multiply arrays. First, you can multiply each element of the array with elements of another array (must be of the same size.) The second is to multiply all elements of an array by a single element (constant).

I suspect that you are trying to do the second, but have accidently used the first method. I suggest the following: Delete your constant, change to the wire tool, right click on the array input to the multiply and Create a Constant. Then, drag the element out of the constant. Of course, there is another way to create the constant and make it the right type, but that's my suggestion. Anyway, you connect the single element constant to your divide operator and your done.

Good luck

PS: If this doesn't help, let me k
now and I'll create a sample VI for you.
0 Kudos
Message 3 of 4
(2,605 Views)