1로 채워진 새 행렬을 만들고 반환하는 정적 함수입니다.
static matrix matrix::Ones( const ulong rows, // 행의 수 const ulong cols // 열의 수 ); static vector vector::Ones( const ulong size, // 벡터 사이즈 );
매개 변수
rows
[in] 행 수
cols
[in] 열 수
반환값
1로 채워진 주어진 행과 열의 새로운 행렬.
MQL5 예:
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]] */
파이썬 예:
np.ones((4, 1)) array([[1.], [1.]])