12-06-2020 03:34 PM
All cluster elements are outputs from the subVI. I need to add an element of BMI to the original cluster and an element of the category of BMI (healthy, obese, etc). So for example, for pt one, the SubVI produces (pt number, age, weight, height, gender) after the code each pt cluster should have (pt number, age, weight, height, gender, +BMI, + BMI category).
I actually got the category part, now I have an array of categories, but now I need to remove one of the categories and count how many patients of each category there are in that array. Any advice on how to do it? I've been trying to use shift registers and remove from the array function, but no luck so far?
Also, how do I use bundle by name to add that BMI category element to the original array of clusters?
12-06-2020 03:56 PM - edited 12-06-2020 04:02 PM
If you want the output cluster to have different elements, you need to create a new cluster type and bundle the relevant fields. Sometimes it is easier to just reuse the same cluster. Make sure it contains all needed fields from the beginning. You can hide certain fields if they are not needed for a certain instance.
Here is a draft (note that you need to do more detailed cluster and operations,of course). Note that the BMI field is disabled (i.e. cannot be operated at run time and is also colored like an indicator)
Why would you need to remove a category to count how many? To count you don't need to modify the input data. If you have a recent LabVIEW version 2019+, I probably would do a Map based approach.
12-06-2020 07:40 PM
Thank you for the picture, I got it to work, using a bit different approach. And it is one of the assignments to remove BMI of 0. I need to count the categories and then plot a histogram. I am trying to use General Histogram VI, but not working. As a matter of fact, I need 3 histograms in one VI, the user has to switch between them in the front panel. Any additional advice would be appreciated. Thank you for your help so far.
Plot a Histogram that will show the number of patients in each category;
a. Patients by BMI category (Underweight. Heathy, Overweight & Obese)
b. Patients by BMI category and gender (I.E. so there are eight bins)
c. Patients by BMI category and age using the following bins for age
i. 16 to 25
ii. 26 to 40
iii. 41 to 65
iv. Older than 65
The Front Panel will contain one Histogram Plot. The user is able to switch between the different histogram information.
12-06-2020 11:16 PM
Don't overcomplicate it with fancy terms such as histogram. All you need is an integer array with an element for each count, then graph it on a bar graph style plot. Right?
12-06-2020 11:41 PM
I wish, how would I get an integer array with an element for each count? And I believe we need an actual histogram, Im trying to use histogram express VI or general histogram VI, but it isn't really user friendly, so can't get what I need it to do
12-07-2020 12:50 AM
An integer array displayed in a bar graph *is* a histogram.
12-07-2020 01:34 AM
I am trying to create an array which associates BMI and age, which array function should I use inside the for loop, so every iteration adds a BMI with age-associated with it - through the indexing tunnel?
12-07-2020 01:56 AM
I have an appended array of age and BMI associated of that specific patient. How do I remove the patient (patients BMI and patients age) if BMI equals to 0, and output an array of age-associated with BMI (for only patients who have a BMI above 0)?
12-07-2020 02:00 AM - edited 12-07-2020 02:04 AM
Hi taras,
please keep things in one place: no need to start new threads for the (basically) same topic…
@taras01 wrote:
I am trying to create an array which associates BMI and age, which array function should I use inside the for loop, so every iteration adds a BMI with age-associated with it - through the indexing tunnel?
How do you want to "associate" a BMI value to an age? Which kind of "association" to you want to realize?
@taras01 wrote:
I have an appended array of age and BMI associated of that specific patient. How do I remove the patient (patients BMI and patients age) if BMI equals to 0, and output an array of age-associated with BMI (for only patients who have a BMI above 0)?
Which kind of patients have a BMI of zero?
After all those questions you really should be able to attach your current VI so we can suggest possible improvements. You already know we will not solve your homework for you…
12-07-2020 02:46 AM
This is not exactly homework. I have genuine questions, but figure some out as I go. 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?