matla仿真相干合成一些常用代码
%% 显示程序运行时间
tic
toc
%%批量保存mat文件
name=['g=' num2str(gamma) 'a=' num2str(amp*100)''];
save(name,'m1');
%%归一化颜色图
max1=max(max(I1));
I1=I1/max1;
figure(1)
imagesc(I1),axis image,axis off
colormap(jet)
colorbar('Ticks',[0,0.2,0.4,0.6,0.8,1.0]);%%颜色栏
caxis([0 1]);%颜色范围
%%设置折线图格式
figure(3)
plot(x1,L1,'--','LineWidth',2);
hold on
plot(x1,L2,'LineWidth',2);
legend('same','difference');
%%打印图片300dpi
hfig = figure(1);
figWidth = 5; % 设置图片宽度
figHeight = 5; % 设置图片高度
set(hfig,'PaperUnits','inches'); % 图片尺寸所用单位
set(hfig,'PaperPosition',[0 0 figWidth figHeight]);
fileout = ['七路相同.']; % 输出图片的文件名
print(hfig,[fileout,'tif'],'-r300','-dtiff'); % 设置图片格式、分辨率