LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array manipulation

Solved!
Go to solution

Hi!

A brief intro to my problem first:

A portion of the project I'm working on creates an XY graph to show the sound wave that is being acquired/read, easy enough. Now I need to change the graph so that it takes the 4 parameters: total time, seconds to ignore at the start of the file and at the end and finally, parts of the file that need to be ignored in between. I need to show the parts of the file that need to be ignored in red. 

My idea was to initialize an array with the boolean constant true so that it shows up in green and then maybe use the insert into array function to insert a false boolean constant at the parts that need to be ignored so that those parts show up as red. 

I ran into a problem because one of the parameters is an unsigned long integer while the first 2 parameters are dbl. I can't create an array, what is the right way to go about creating a waveform graph that shows the parts of the file that are ignored in red and the parts that need to be considered as green?

 

Thanks!

M

 

0 Kudos
Message 1 of 3
(2,385 Views)
Solution
Accepted by topic author Ben-Da-Nee

If you want everything in a single array, you should have no problems converting your unsigned integers into doubles so they can be in a double array.

 

What the real question you should be asking is how to display a waveform of data where different parts of it are different colors.  The answer to that question is to create two waveforms to plot where one is green and one is red.  For the bad parts, where the boolean is False, replace those elements in the array of the "green, good waveform" with NaN.  For the good parts, where the boolean is True, replace those elements in the array of the "red, bad waveform" with NaN.

0 Kudos
Message 2 of 3
(2,378 Views)

Thank you! That makes much better sense than what I had in mind.

0 Kudos
Message 3 of 3
(2,358 Views)