Die statische Funktion erstellt und retourniert eine neue Matrix, die mit Einsen gefüllt wurde.
static matrix matrix::Ones( const ulong rows, // Zeilenanzahl const ulong cols // Spaltenanzahl ); static vector vector::Ones( const ulong size, // Vektorgröße );
Parameter
rows
[in] Zeilenanzahl.
cols
[in] Spaltenanzahl.
Rückgabewert
Eine neue Matrix mit gegebenen Zeilen und Spalten, gefüllt mit Einsen.
MQL5 Beispiel:
matrix ones=matrix::Ones(4, 4); Print("ones = \n", ones); /* ones = [[1,1,1,1] [1,1,1,1] [1,1,1,1] [1,1,1,1]] */
Python Beispiel:
np.ones((4, 1)) array([[1.], [1.]])