Skip to content

Tag Archives: Ruby Matrix-class

The identity() is an inbuilt method in Ruby returns an Identity matrix of N X N size. Syntax: mat1.identity(N) Parameters: The function accepts a mandatory… Read More
The diagonal is an inbuilt method in Ruby returns a matrix with diagonal elements as the given values. Syntax: mat1.diagonal(val1, val2, val3 …) Parameters: The… Read More
The []() is an inbuilt method in Ruby returns the element at the i-th row and the j-th column. Syntax: mat1[i, j] Parameters: The function… Read More
The zero?() is an inbuilt method in Ruby returns a boolean value. It returns true if it is a zero matrix, else it returns false.… Read More
The vstack() is an inbuilt method in Ruby returns a new matrix resulting by stacking vertically the receiver with the given matrices. It requires a… Read More
The upper_triangular?() is an inbuilt method in Ruby returns a boolean value. It returns true if it is a lower-triangular matrix, else it returns false.… Read More
The unitary?() is an inbuilt method in Ruby returns a boolean value. It returns true if it is a unitary matrix, else it returns false.… Read More
The trace() is an inbuilt method in Ruby returns the trace i.e., sum of diagonal elements of the matrix. Syntax: mat1.trace() Parameters: The function needs… Read More
The tr() is an inbuilt method in Ruby returns the trace i.e., sum of diagonal elements of the matrix. Syntax: mat1.tr() Parameters: The function needs… Read More
The to_s() is an inbuilt method in Ruby returns a string containing the matrix as the object. Syntax: mat1.to_s() Parameters: The function needs the matrix… Read More
The to_matrix() is an inbuilt method in Ruby returns a matrix which is self only. Syntax: mat1.to_matrix() Parameters: The function needs the matrix which is… Read More
The to_a() is an inbuilt method in Ruby returns an array which has all the elements of the matrix row-wise. Syntax: mat1.to_a() Parameters: The function… Read More
The t() is an inbuilt method in Ruby returns the transpose of the matrix. Syntax: mat1.t() Parameters: The function needs the matrix to be transposed.… Read More
The row() is an inbuilt method in Ruby returns a vector that contains all the elements in the given row-number. Syntax: mat1.row(num) Parameters: The function… Read More
The round() is an inbuilt method in Ruby returns all the values of the matrix rounded to the given number of digits after decimal point.… Read More

Start Your Coding Journey Now!