matlab自写矩阵实现旋转
clear clc matrix_data =imread('D:\Google_Download\2.jpg'); %matrix_data = rgb2gray(matrix_data); [a,b,c] = size(matrix_data); result_matrix = zeros(b,a,c); for i=1:a for j=1:b for k=1:c result = i*[0;1]+j*[-1;0]; result_matrix(result(1)+b+1,result(2),k) = matrix_data(i,j,k); end end end result_matrix = uint8(result_matrix); figure imshow(matrix_data); figure
imshow(result_matrix );
原理