Ptp

Rückgabe des Wertebereichs einer Matrix/eines Vektors oder der angegebenen Matrixachse, entspricht Max() - Min(). Ptp - Peak to peak (Spitzenwert zu Spitzenwert).

double vector::Ptp();
 
double matrix::Ptp();
 
vector matrix::Ptp(
  const int  axis      // Achse
   );

Parameter

axis

[in]  Achse. 0 — horizontale Achse, 1 — vertikale Achse.

Rückgabewert

Vektor mit Wertebereichen (Maximum - Minimum).

Beispiel

   matrix matrix_a={{10,3,2},{1,8,12},{6,5,4},{7,11,9}};
   Print("matrix_a\n",matrix_a);
 
   vector cols_ptp=matrix_a.Ptp(0);
   vector rows_ptp=matrix_a.Ptp(1);
   double matrix_ptp=matrix_a.Ptp();
 
   Print("cols_ptp  ",cols_ptp);
   Print("rows_ptp  ",rows_ptp);
   Print("ptp value  ",matrix_ptp);
 
   /*
   matrix_a
   [[10,3,2]
    [1,8,12]
    [6,5,4]
    [7,11,9]]
   cols_ptp [9,8,10]
   rows_ptp [8,11,2,4]
   ptp value  11.0
   */