LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

split 2D array to make a xy graph

Solved!
Go to solution

I need to plot some points in these graphs, but I don't know how to do this. In this example that I send, I need to plot all this points, but don't need to plot straight for the first point of the next value. I need to split the array of input.

Download All
0 Kudos
Message 1 of 7
(5,854 Views)

@Andrebiffe wrote:

but don't need to plot straight for the first point of the next value. I need to split the array of input.


Can you explain what that means?

What is "straight"?

What is the "first point of the next value"?

There are millions of different ways to split an array.

 

(none of your local variables or sequence structures are necessary, see e.g. here)

 

 

Message 2 of 7
(5,834 Views)

Ok, sorry I forgot to translate the names.

The array mean temperature, is the mean of all columns of temperature in the file txt. And the mean sensors, is the mean of all columns of sensors in wavelength. The first point of the next value is the initial value for the next sensor, by example, the value 100.003(last point) connects the point in the value 20.0062 (first point), and I don't wanna this. I need to connect the dots of the coordinates, but I need to be separated, because if you run the vi, you will see that the temperature values are repeated, are five values that are repeated 3 times. I need to generate 3 separate lines, ie if I separate these arrays and plot them I get what I need, but none of my ideas work.

Download All
0 Kudos
Message 3 of 7
(5,819 Views)

You can create new plots whenever the x value drop or you could just add NaN values to create a gap (see attached rewrite)

 

(Note that I removed the useless local variables and sequence structure)

Download All
Message 4 of 7
(5,801 Views)

Wow man, your ideia is much better!!! =D Not wanting you to explore, you could explain in more detail what you did? On the question of using complex numbers, in cleaning the code I had already thought of that, but like everything I do has to be self-explanatory for the other people who work with those seen earlier had preferred that way, but what you did was great !! And there is still the possibility of these lines with different colors?

0 Kudos
Message 5 of 7
(5,793 Views)
Solution
Accepted by topic author Andrebiffe

@Andrebiffe wrote:

And there is still the possibility of these lines with different colors?


You simply need to create seperate plots for each segment. If we can assume that all segments have the same length, the code can be dramatically simplified, e.g. as follows. If we cannot assume that, you could try to modify my previous code. Shouldn't be too difficult. 😉

Message 6 of 7
(5,776 Views)

Man you're a genius that is helping a beginner =D THANKS VERY MUCH!!!!

0 Kudos
Message 7 of 7
(5,762 Views)