LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

mode of an array

Dear All

 

I am trying to work with "mode" subVI to estimate the mode of an input array which seems very obvious application. When I set the interval input to zero I would expect to have:

 

1)  In case of an array with one single element the output would be the same single value

2)  In case of an array with two entries the output would be one of these two

 

But apparently it does not work like that and even with an array with single element it returns "NaN".

I read the help file but it does not say anything about that.

 

Has anybody any comment?

 

Best regards

Afshin

0 Kudos
Message 1 of 8
(3,511 Views)

well the mode is the number that appears most frequant here is a vi I made...

 

 

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 2 of 8
(3,497 Views)

Looking at your VI, I see NI made a spelling mistake on that Mode VI.

 

What happened to the "L" in multimodal?

 

Message Edited by Ravens Fan on 06-26-2009 12:01 PM
Message 3 of 8
(3,487 Views)

I think it got absorbed by the round to nearest value funtion. Robot Very Happy

 

Felix

0 Kudos
Message 4 of 8
(3,484 Views)
lol
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 5 of 8
(3,481 Views)

Ravens Fan wrote:

Looking at your VI, I see NI made a spelling mistake on that Mode VI.

 

What happened to the "L" in multimodal?


 

 

 

This was reported to R&D (CAR 176914).  Thanks for pointing it out.

 

Chris M 

0 Kudos
Message 6 of 8
(3,463 Views)

Af_Dk wrote:

But apparently it does not work like that and even with an array with single element it returns "NaN".


This seems to be a bug. The first time it runs with a single element array input, the result is NaN. however, if you add a second element, run for a valid result, then run again with an array of size 1, the result is no longer NaN, but a cached result that no longer depends on the actual value of the single array element.

0 Kudos
Message 7 of 8
(3,460 Views)

Dear all

 

thank you all for your responses but I could not open your file because I use LV 8.2 and it is not compatible with that. Secondly I don't think taking a round off is a good idea because the output may not be included in the input array but the mode should be one of the elements in the array.

I also agree that this "mode" subVI is not working properly so if any one is supposed to report that to some where please report it.

 

Best regards

Afshin

0 Kudos
Message 8 of 8
(3,439 Views)