Files
mql5-skills/skills/mql5/references/docs/06-matrix/0289-matrix-matrix-initialization-matrix-full.md
T
2026-06-23 21:47:51 +08:00

60 lines
959 B
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Full
The static function creates and returns a new matrix filled with given value.
```
static matrix matrix::Full(
  const ulong   rows,      // number or rows
  const ulong   cols,      // number of columns
  const double  value      // value to fill
   );
 
static vector vector::Full(
  const ulong   size,      // vector size
  const double  value      // value to fill
   );
 
```
Parameters
rows
[in]  Number of rows.
cols
[in]  Number of columns.
value
[in]  Value to fill all the matrix elements.
Return Value
Return a new matrix of given rows and columns, filled with specified value.
MQL5 example:
```
  matrix full=matrix::Full(3,4,10);
  Print("full = \n", full);
/*
full = 
   [[10,10,10,10]
    [10,10,10,10]
    [10,10,10,10]]
*/
```
Example
```
np.full((2, 2), 10)
array([[10, 10],
       [10, 10]])
```