Example Code

Median and Quartile Calculator (Q1, Q2, Q3) using LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview
This VI calculates the first second and third quartiles (Q1, Q2, Q3) based on the third method dicussed here: http://en.wikipedia.org/wiki/Quartile

The second quartile can also be called the median.

There are multiple ways to calculate quartiles, this only implements one of them..

 
Description
 LabVIEW does already have a VI for calculating the median (called "Median.vi"), but it was convenient to include a G implementation of it here.

                                     
Requirements

  1. LabVIEW 2014(or compatible)


Steps to Implement or Execute Code

Just Input the data and run the VI, you can see the Q1, median and Q3 output.

Additional Information or References

Block Diagram

block diagram.JPG

 **This document has been updated to meet the current required format for the NI Code Exchange.**

Craig H. | CLA CTA CLED | Applications Engineer | NI Employee 2012-2023

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.