LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Case Structures

Solved!
Go to solution

Hi taras,

 


@taras01 wrote:

I got an array of age and bmi associated together, but cannot pass that array into the histogram vi, because that Vi takes only 1d array and cannot pass two separate arrays into the histogram either. And bins do not allow more elements to be added. Is it even possible to add more elements to the bin? Can you please guide me on how to proceed in this situation?


We all could help you to proceed.

But you failed again in attaching your code as requested before…

 

Again I have to ask:

How are "age and BMI associated together" in an array?

How should that histogram look like? Why don't you follow Christians (Altenbach) good advice?

Which "bins" are you talking about? Why can't you add more elements?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 21 of 26
(849 Views)

It sounds like you want an X-Y Graph for BMI vs Age. That would make sense for several reasons like finding a general health trend of the population or the history of a specific patient with multiple BMI measurements at various ages.

 

Perhaps a patient is seen at several times but the BMI is not always measured at each visit?  Sounds "Real Worldly" to me.

 

LabVIEW Jedi mind trick: Replace your zeros with NaNs (Not a Number) and the graph ignores them!  This would be better done in the subvi by defaulting the value properly so ,do a comparison for BMI  NOT equal to 0 and replace the value with NaN if the result is FALSE Just use Select!

 

EXTRA CREDIT: explain What happens when the subvi gets fixed?  That NOT equal to 0 begins to make you look like a genius.  So, add a Bookmark on the BD explaining it.


"Should be" isn't "Is" -Jay
0 Kudos
Message 22 of 26
(842 Views)

Sorry, for not attaching the code. Here it is. I have all of the arrays computed at this point. I need to put two buttons histograms into one, so one histogram has 8 bins (differentiates btw gender and 4 categories for each gender). But the only way to store that info is to have a 2D array of BMI and gender of that BMI. But I cannot pass that array into histogram VI - bc it takes only a 1D array. I could create 8 bins, but the bins would go in pairs, because I cannot add an element of gender into that bin, so would just end up having 2 pairs of the same bin - which is useless. 

 

Also is there a way to make the bar width equal? Because the first and the last one show up as narrower? 

Download All
0 Kudos
Message 23 of 26
(822 Views)
Solution
Accepted by topic author taras01

@taras01 wrote:

Sorry, for not attaching the code. Here it is.


These are just useless pictures. Nothing to do with "code". (Code has a *.vi file extension!)

0 Kudos
Message 24 of 26
(815 Views)

I could not put out more code on the internet. I solved all of my issues. Thank you, everyone, for the help

0 Kudos
Message 25 of 26
(796 Views)

@taras01 wrote:

I could not put out more code on the internet. I solved all of my issues. Thank you, everyone, for the help


What a shame!

 

OP asked a well formed question...then bailed out with the simplistic idea. 

 

I guess you can still "lead a horse to water!"  <but you can't make them THINK!>


"Should be" isn't "Is" -Jay
0 Kudos
Message 26 of 26
(791 Views)