MATRIX
Generates a random matrix with values between 0 and 1.Params:row : Scalarnumber of rowscolumn : Scalarnumber of columnsReturns:out : MatrixRandomly generated matrix
Python Code
import numpy as np
from flojoy import flojoy, Matrix, Scalar
@flojoy
def MATRIX(row: Scalar = 100, column: Scalar = 100) -> Matrix:
"""Generates a random matrix with values between 0 and 1.
Parameters
----------
row : Scalar
number of rows
column : Scalar
number of columns
Returns
-------
Matrix
Randomly generated matrix
"""
np.random.seed()
mat = np.random.random_sample(row, column)
return Matrix(m=mat)
Example
Having problems with this example app? Join our Discord community and we will help you out!
In this example, MATRIX
node generates 8x8 matrix and passes it MATRIX_VIEW
node.