Create a 3-by-3-by-2 cell array of characters.
3×3×2 cell array
A(:,:,1) =
'a' 'b' 'c'
'd' 'e' 'f'
'g' 'h' 'i'
A(:,:,2) =
'j' 'k' 'l'
'm' 'n' 'o'
'p' 'q' 'r'
Rotate the cell array by 270 degrees.
3×3×2 cell array
B(:,:,1) =
'g' 'd' 'a'
'h' 'e' 'b'
'i' 'f' 'c'
B(:,:,2) =
'p' 'm' 'j'
'q' 'n' 'k'
'r' 'o' 'l'
The function rotates each page of the array independently. Since a full 360 degree rotation (k = 4
) leaves the array unchanged, rot90(A,3)
is equivalent to rot90(A,-1)
.