Ruby | Matrix conj() function
The conj() is an inbuilt method in Ruby returns the conjugate matrix.
Syntax: mat1.conj()
Parameters: The function does not accepts any parameter.
Return Value: It returns the conjugate matrix.
Example 1:
# Ruby program for conj() method in Matrix # Include matrix require "matrix" # Initialize a matrix mat1 = mat1 = Matrix[[1, Complex(2, 1)], [Complex(8, -9), 18]] # prints the conjugate matrix puts mat1.conj() |
chevron_right
filter_none
Output:
Matrix[[1, 2-1i], [8+9i, 18]]
Example 2:
# Ruby program for conj() method in Matrix # Include matrix require "matrix" # Initialize a matrix mat1 = Matrix[[Complex(2, 5), 1, 5], [Complex(12, 1), 1, 5], [11, 2, Complex(6, -1)]] # prints the conjugate matrix puts mat1.conj() |
chevron_right
filter_none
Output:
Matrix[[2-5i, 1, 5], [12-1i, 1, 5], [11, 2, 6+1i]]
Recommended Posts:
- Ruby | Numeric conj() function
- Ruby | Complex conj function
- Ruby | Matrix tr() function
- Ruby | Matrix t() function
- Ruby | Matrix det() function
- Ruby | Matrix row() function
- Ruby | Matrix lup() function
- Ruby | Matrix eql? function
- Ruby | Matrix inv() function
- Ruby | Matrix zero() function
- Ruby | Matrix I() function
- Ruby | Matrix zero?() function
- Ruby | Matrix conjugate() function
- Ruby | Matrix imaginary() function
- Ruby | Matrix regular?() function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



