LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array with different time & values

Hello to all,
 
How can Plot a 2D array based on time-column value?
 
I have a 2D array with;
Column 0, is time 1 with its corresponding intensity being in column 1.
Column 2, is time 2 with its corresponding intensity being in column 3.
Column 4, is time 3 with its corresponding intensity being in column 5.
 
I want to place a pointer on each time column which will plot its corresponding intesity value when the counter matches the time of the column.
 
Is this the way to do it? If not...
Is this possible to do? If so how...
 
Thanks-N-Advance
 
0 Kudos
Message 1 of 11
(3,774 Views)
Hello FredFred,

I'm not sure I understood what you need to do. I ploted the three intensity relatively to there time assuming this is what you were asking for...

Tell me if I am missing the point Smiley Surprised

We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Message 2 of 11
(3,770 Views)
It would be much easier if you changed your 2D array into 2 columns only, the first column is time and the second column is intensity.  Then sort the array by the first column.  Match the timer to the value of the first row, first column.  When there is a match, plot the data from column 2.  Increment the row number and start looking for a match with the next row first column.  And so on.  When matching times, you don't want to use the equal function.  You seldom get a match when using floating point numbers because of internal representation not being exact.  Use greater than and less than instead, or the range function.  Like matching to 0.02, use greater than 0.019 and less than 0.021.  Set a flag to only plot each point once.  Clear the flag when incrementing to the next row.  Try this and then repost your vi if you still have questions.  Also, put a delay in the loop, 1 millisecond is fine.
- tbob

Inventor of the WORM Global
Message 3 of 11
(3,765 Views)

It is similar to what I want but, i want to use one plot only to represent all of the activities going on.

To explain the main picture behind this...

Each column of time represents the time and intensity value for which a heat detector captured data.

Theses detectors sit on a matrix of 10x10.

What i want to do is plot data when the detector times match the counter that i have. If one or more detectors matches the time, plot its intensity value and plot zeros for the rest.

0 Kudos
Message 4 of 11
(3,754 Views)
tbob,
thanks for your response, but, i want to keep the data in the same format for each time & intensity column represents a detector's activity.
 
Do you think it is possible what i want to do?
0 Kudos
Message 5 of 11
(3,751 Views)
Well, then tbob's idea was the one to follow...

Use the reshape array to have just 2 columns and sort your array on the first column (time) Smiley Indifferent that might be a bit tricky to do...
and then plot

Message Edité par TiTou le 03-13-2006 10:21 PM


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Message 6 of 11
(3,744 Views)
I cannot convert it to 2 columns for each column has its own significance...
0 Kudos
Message 7 of 11
(3,741 Views)

This seemed like a good challange and it was.  I believe this is what you want.  I didn't use Elapsed Time.  Instead I created my own timer with a shift register and a 10mS delay.  The time increment is 10 mS, so all time values had to be converted to the nearest 10mS value.  If you want better resolution, change the 10 to 1 for the delay value, and change the 100 to 1000 for the first multiplier at the top left.  But this will give you a very big plot.

Message Edited by tbob on 03-13-2006 03:08 PM

- tbob

Inventor of the WORM Global
Message 8 of 11
(3,731 Views)


FredFred a écrit:
What i want to do is plot data when the detector times match the counter that i have. If one or more detectors matches the time, plot its intensity value and plot zeros for the rest.


Ok, then I haven't understood what you mean mean by this...

It that better ?

oups... I ' too late Smiley Sad

Message Edité par TiTou le 03-13-2006 11:28 PM


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Message 9 of 11
(3,724 Views)
Well, your's helps a bit, but how will i know which column the data is from?
0 Kudos
Message 10 of 11
(3,712 Views)