Ruby | Matrix scalar() function
The scalar() is an inbuilt method in Ruby returns an N x N diagonal matrix where each diagonal element is value. Syntax: mat1.scalar(N, value) Parameters: The function accepts twos mandatory parameters N and value where N is the size of the Identity matrix and value is the value to be assigned to th