LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do i convert an array to the format an intensity graph requires?

i have a 2D Array which has the columns X, Y, Value, which need to be put into an intensity graph. The intensity graph needs it in a format where the indexes of the elements (Value,) in the 2D array corresponds to the plot locations on the graph. Anyone know how i can do this conversion, any attempt i've made has failed miserably.
I have access to Matlab but have never used it before, would this be more appropriate?

Thanks for any help or suggestions you might have,

Rob
0 Kudos
Message 1 of 6
(3,867 Views)
I see what you mean! I'd probably use a 3D surface graph instead, BUT i have created an example (in LV 6.0) for you which converts your 2D array data into the format required for the intensity graph. The only problem is that if you dont have values for all the points, then you will have to fill in the 'blanks' with something - i have filled them in with 0.

The basic principle is that i find the max x and y values and create an array of this shape. Then i index this new array with the individual x and y values and replace the 0 value with the z value.

I hope this is what you want...

Kim
Message 2 of 6
(3,867 Views)
Thanks Kim, you're a star!

Hopefully the data won't have any/many non existant values making this perfect.
Attempts ive made have had similar problems plus one or two others.
I would have thought Labview would have had some built in function for this conversion, x y graphs have x y points so i'd have thought x y z graphs would have x y z co-ordinates!

Thank you very much

Rob
0 Kudos
Message 3 of 6
(3,867 Views)
*smiles*...am i a star or 4 stars?? Only joking.

Basically i think the problem is that the intensity graph is not a true x,y,z graph, but is more of a map. It doesn't plot points as such, with coordinates, but instead plots colours (z values) of a map. The 'map' happens to be called frequency (y) and time (x), but i think this is so we know which side is what. There may even be a conversion VI, but i couldn't find it, and didnt think the programming would be that difficult to just do myself, so i did!

Kim
Message 4 of 6
(3,867 Views)

Hi!

I´m trying to do the same, but my problem is that my "x" and "y" arrays are not integers. How can I solve this?

 

thanks!!

0 Kudos
Message 5 of 6
(3,549 Views)
An intensity graph does NOT take an x and a y array, but a plain 2D array where the array indices (always integer!) map to the x and y axis respectively. All you need to do is change the offset and multiplier for the x- and y-axis so the values correspond to your noninteger scaling.
 
See how far you get. 🙂
 
 
0 Kudos
Message 6 of 6
(3,537 Views)