错误使用 plot
矢量长度必须相同。
出错 Asia_main (line 112)
plot(x,p1,'-b',x,p2,'--g',x,p3,':r',x,p4,'*y');
这个是画图时候的语句
KL_MLE_Average = mean(KL_MLE);
KL_ADME_Average = mean(KL_ADME);
KL_QMAP_Average = mean(KL_QMAP);
KL_CDME_Average = mean(KL_CDME);
x=1:Data_size;
figure('NumberTitle','off','Name','样本数据不同时的KL距离');
%p1=KL_MLE_Average
%p1=20*log(KL_MLE_Average)/log(8);%log原来以10为底,20倍
p1=20*log10(KL_MLE_Average);
hold on;
%p2=KL_QMAP_Average;
p2=20*log10(KL_QMAP_Average);
%p2=20*log(KL_QMAP_Average)/log(8);
hold on;
%p3=KL_ADME_Average;
p3=20*log10(KL_ADME_Average);
%p3=20*log(KL_ADME_Average)/log(8);
hold on;
%p4=KL_CDME_Average;
p4=20*log10(KL_CDME_Average);
%p4=20*log(KL_CDME_Average)/log(8);
hold off;
plot(x,p1,'-b',x,p2,'--g',x,p3,':r',x,p4,'*y');
hold off;
xlabel('Date Size');
ylabel('KL divergence(dB)');
legend('MLE','QMAP','ADME','CDME');
figure(2);
position_m=1:1:Data_size;
boxplot(KL_MLE,'colors','b','positions',position_m);
hold off;
xlabel('Data Size');
ylabel('KL divergence');
%set(gca,'XTickLabel',{''});
legend(findobj(gca,'Tag','Box'),'MLE')
figure(3);
position_c=1:1:Data_size;
boxplot(KL_ADME,'colors','r','positions',position_c);
hold off;
xlabel('Data Size');
ylabel('KL divergence');
legend(findobj(gca,'Tag','Box'),'ADME');
figure(4);
position_e=1:1:Data_size;
boxplot(KL_QMAP,'colors','g','positions',position_e);
hold off;
xlabel('Data Size');
ylabel('KL divergence');
legend(findobj(gca,'Tag','Box'),'QMAP');
figure(5);
position_b=1:1:Data_size;
boxplot(KL_CDME,'colors','y','positions',position_b);
hold off;
xlabel('Data Size');
ylabel('KL divergence');
legend(findobj(gca,'Tag','Box'),'CDME');
矢量长度必须相同。
出错 Asia_main (line 112)
plot(x,p1,'-b',x,p2,'--g',x,p3,':r',x,p4,'*y');
这个是画图时候的语句
KL_MLE_Average = mean(KL_MLE);
KL_ADME_Average = mean(KL_ADME);
KL_QMAP_Average = mean(KL_QMAP);
KL_CDME_Average = mean(KL_CDME);
x=1:Data_size;
figure('NumberTitle','off','Name','样本数据不同时的KL距离');
%p1=KL_MLE_Average
%p1=20*log(KL_MLE_Average)/log(8);%log原来以10为底,20倍
p1=20*log10(KL_MLE_Average);
hold on;
%p2=KL_QMAP_Average;
p2=20*log10(KL_QMAP_Average);
%p2=20*log(KL_QMAP_Average)/log(8);
hold on;
%p3=KL_ADME_Average;
p3=20*log10(KL_ADME_Average);
%p3=20*log(KL_ADME_Average)/log(8);
hold on;
%p4=KL_CDME_Average;
p4=20*log10(KL_CDME_Average);
%p4=20*log(KL_CDME_Average)/log(8);
hold off;
plot(x,p1,'-b',x,p2,'--g',x,p3,':r',x,p4,'*y');
hold off;
xlabel('Date Size');
ylabel('KL divergence(dB)');
legend('MLE','QMAP','ADME','CDME');
figure(2);
position_m=1:1:Data_size;
boxplot(KL_MLE,'colors','b','positions',position_m);
hold off;
xlabel('Data Size');
ylabel('KL divergence');
%set(gca,'XTickLabel',{''});
legend(findobj(gca,'Tag','Box'),'MLE')
figure(3);
position_c=1:1:Data_size;
boxplot(KL_ADME,'colors','r','positions',position_c);
hold off;
xlabel('Data Size');
ylabel('KL divergence');
legend(findobj(gca,'Tag','Box'),'ADME');
figure(4);
position_e=1:1:Data_size;
boxplot(KL_QMAP,'colors','g','positions',position_e);
hold off;
xlabel('Data Size');
ylabel('KL divergence');
legend(findobj(gca,'Tag','Box'),'QMAP');
figure(5);
position_b=1:1:Data_size;
boxplot(KL_CDME,'colors','y','positions',position_b);
hold off;
xlabel('Data Size');
ylabel('KL divergence');
legend(findobj(gca,'Tag','Box'),'CDME');