Suppose I have a matrix $M$ of $5\times4$ dimension (this is represent an image) :
M = [3 4 8 9;
1 6 7 3;
9 8 3 1;
1 2 2 0;
7 2 3 5];
I would like to rotate it around the origin $(0,0)$ with an angle of 45°.
From what I have found on the net , I have to multiply $M$ by Rotation Matrix $R$ is as follow :
R = [ cosd(45) -sind(45);
sind(45) cosd(45)]
Now do I simply multiply M by R and get a rotated matrix ??? like this :
rotM = R*M
I think I will have a problem of dimensions ? please how to rotate a matrix $5\times4$ by 45° around the origin $(0,0)$?
UPDATED
Here is an example of an Image (like M) that is rotated 45° around the center of the image :

What I want to be specific is to get a rotation around the origin (0,0) of 45° (or different angle).
PS: imrotate, rot90, flip* and rotate is not suitable here, thank you in advance.
Okey, I am answering myself since I was not 'clear' about what I want to get.
When I used a M matrix , I make reference to an Image Matrix.
So by rotation I mean create a real rotation by 45° in order to get something like the on in the following figure.
Any way here is a snippet that I succeeded to do and its result in the picture :
Image :