From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Find min value of array in time...

Solved!
Go to solution

First of all this is not "finding the min value in the array"

This is:

I have an array which changes its values every iteration and I want to compare the new values with the previous values and make a new array with the minimal values...

 

In C++ it would be like this:

 

 

int main(){

  int array[8];

  int min[8];

  int i;

 

  for(i=0;i<8;i++){

    min[i]=1000000;//Initialize minimun array with a high value

  }

 

  while(1){

    array=update_array();

    for(i=0;i<8;i++){

      if(array[i]<min[i]){

        min[i]=array[i];

      }

    }

    //do stuff....

  }

  return 0;

}

 

Im new to labview and it still confuses me a lot...

 

thanks in advance.

0 Kudos
Message 1 of 2
(2,151 Views)
Solution
Accepted by topic author joecarl

Use of the regular Max & Min function (not Array Max & min as you are aware) with arrays and a shift register will do job nicely.  Max & Min, like most numeric functions, is polymorphic and works witt arrays as well as scalars.

 

Lynn

 

MinMax.png

0 Kudos
Message 2 of 2
(2,143 Views)