It rotates a matrix anti-clockwise by 90 degrees for a specified number of times.
y = rot90(x)
y = rot90(x,k)
A matrix or 2-d array which will be rotated by 90 degrees.
A positive integer to indicate how many times the given matrix is to be rotated by 90 degrees.
A matrix representing output obtained after rotating the input matrix k times by 90 degrees.
It rotates a matrix k times in anti-cockwise direction by 90 degrees. If the input parameter is misssing in the input, it value is taken as 1 and the input matrix is rotated by 90 degree. If k=2,3 or 4, the given matrix is rotated by 180, 270 or 360 degrees. If the value of k is greater than 4, the remainder of k when divided by 4 is taken as the value of k. That is if k=11, then k is taken as 3, that is the input matrix will be rotated by 270 degree.