我想得到每一个theta值下的h矩阵,并且把它存到不同的excel中,但是运行出来的结果只显示了180度对应的h矩阵

我自己编的程序如下:
close all;
clear;
clc;
inputImage = imread('D:\COLOR\pps\frame30.jpg');
subplot(2,2,1);imshow(inputImage);
title('Input RGB image');
f = im2double(inputImage);%转换为双浮点类型R=f(:,:,1);G=f(:,:,2);B=f(:,:,3);for i=1:1:1200for j=1:1:1920r(i,j)=log(R(i,j)/G(i,j));b(i,j)=log(B(i,j)/G(i,j));endendfor theta=0:1:180%得各角度投影灰度图
for i=1:1:1200for j=1:1:1920t(i,j)=r(i,j).*cosd(theta)+ b(i,j).*sind(theta);h(i,j)=exp(t(i,j)); %指数化,引21% xlswrite('D:\COLOR\saxx.xlsx',h);
% if theta>180
% break
endend
end
% title(['Inv. Image using ' num2str(theta) ]);
% imwrite(image,['D:\COLOR\sa',num2str(theta),'.jpg']);%储存在sa中
% drawnow;
subplot(2,2,2);imshow(r);
title('log R/G');
subplot(2,2,3);imshow(b);
title('log B/G');
subplot(2,2,4);
x=mat2gray(h);%转为灰度图,引用20-引18
imshow(x);
title('invariant image');