LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Converrt a list into frequncy of occurance

Hi,
this is a simple problem but i'm sure there must be an icon to cover this.

Say i have a 1D array of numbers for arguements sake lets say:

1,1,2,2,2,2,2,36,59,100,100

how can i convert them into a 2D format that has them in the follwoing format

1,2
2,5
36,1
59,1
100,2

basically a 2D array with the value opposite the data value depicting how many times it occurs??
I've already sorted the array, so all the numbers are next to each otehr already.

Many thanks
John Pierson.
0 Kudos
Message 1 of 9
(4,051 Views)
Hi John,
attached is a picture with one solution.
Hope it helps.

Mike
0 Kudos
Message 2 of 9
(4,041 Views)
Use the Histogram VI in the Mathematics palette. Here is a demo VI. It assumes positive integers in your list. If the list contains negative values or non-integer values this will not work.

Lynn
Message 3 of 9
(4,026 Views)
Sorry, should have mentioned i'm running LV 8.2, any chance you could convert it from LV 8.5??
- sorry i can't read it.
Many thanks.
John P.
0 Kudos
Message 4 of 9
(4,017 Views)
John,

Here is the 8.2 version.

Lynn
0 Kudos
Message 5 of 9
(4,010 Views)

Hi John,

here is another version with histogram.

Mike

0 Kudos
Message 6 of 9
(3,987 Views)
Thank you both very much, i treid to get it converted here in the institution as i know lv 8.5 can *save as* Lv 8.2, but everyone had gone home for the day already!
John P.
0 Kudos
Message 7 of 9
(3,975 Views)


John Pierson wrote:
Thank you both very much, i treid to get it converted here in the institution as i know lv 8.5 can *save as* Lv 8.2, but everyone had gone home for the day already!
John P.



Hi John,

what do you mean? Iit should be saved for 8.0, so you can open it with 8.2.

Mike

0 Kudos
Message 8 of 9
(3,971 Views)
Hi, sorry i meant johnston furtehr up, it won't open but its all sorted now.
chears all.
0 Kudos
Message 9 of 9
(3,880 Views)