(1)MATLAB绘制曲线时如何将曲线背景设置为白色
figure('color',[1 1 1]);
MATLAB代码中加入这句话就会使绘制的曲线背景是白色
(2)如何绘制曲线
figure
plot(smooth(Pf,20),smooth(Pz_withoutquantization,20),'r') %绘制曲线,横坐标是Pf,纵坐标是Pz_withoutquantization,'r'表示颜色red
hold on
plot(smooth(Pf,20),smooth(Pd,20),'b') %绘制曲线,横坐标是Pf,纵坐标是Pd,'b'表示颜色blue
hold on
plot(smooth(Pf,20),smooth(Pz_quantization,20),'g')
hold on
str=sprintf(' ROC diagram,SNR=-6db');
title(str);//设置曲线的标题
xlabel('False alarm probability(Pfa)'); //X坐标轴的名称
ylabel('Detection probability(Pd)');//Y坐标轴的名称
legend('directly spectrum sensing','corperative spectrum sensing without non-uniform quantization','corperative specturm sensing with non-uniform quantization');
//每个曲线的名称
legend(