Zeros

Die statische Funktion erstellt und retourniert eine neue Matrix, die mit Nullen gefüllt wurde.

static matrix matrix::Zeros(
  const ulong  rows,     // Zeilenanzahl
  const ulong  cols      // Spaltenanzahl
   );
 
static vector vector::Zeros(
  const ulong  size,     // Vektorgröße
   );
 

Parameter

rows

[in]  Zeilenanzahl.

cols

[in]  Spaltenanzahl.

Rückgabewert

Eine neue Matrix mit angegebenen Zeilen- und Spaltenanzahl, die mit Nullen gefüllt ist.

MQL5 Beispiel:

  matrix zeros=matrix::Zeros(34);
  Print("zeros = \n"zeros);
/*
zeros = 
   [[0,0,0,0]
    [0,0,0,0]
    [0,0,0,0]]
*/

Python Beispiel:

np.zeros((21))
array([[ 0.],
       [ 0.]])