Converting Matlab code to C code

Thread Starter

harold_potter

Joined Aug 6, 2019
3
Hi. I am currently trying to convert a matlab code (which rotates images) to c code but i'm having some trouble. In code, there is a part like this
Code:
 a = degree*pi/180;
        R = [+cos(a) +sin(a); -sin(a) +cos(a)];

        % Figure out the size of the transformed image
        [m,n,p] = size(image);
        dest = round( [1 1; 1 n; m 1; m n]*R );
        dest = (dest-min(dest))+1;
        imagerot = zeros([max(dest) p],class(image));
So, dest is 4x2 matrix and min(dest) should give us 1x2 matrix, and to perform the subtraction we need two same sized matrices, right? So how is this made in the code. Same thing goes for zeros([max(dest) p] too. If max is an array, how is this possible?
I found code on the internet and since I don't have a matlab, I can't debug or try it.
 
Top