复现文章:Intelligent Reflecting Surface Enhanced Wireless Network via Joint Active and Passive Beamforming
绘制文章Fig.5 如下,存在偏差(找不出原因,应该是参数的问题)(左原图 右复现图)
1 创建注释函数:annotation()
函数详细介绍:https://ww2.mathworks.cn/help/matlab/ref/annotation.html?searchHighlight=ann&s_tid=gn_loc_drop
2 如何确定函数值注释位置参数
2.1 点击编辑--》进入图窗属性
2.2 点击插入,选择你要注释的符号,此处以椭圆为例
选择椭圆后,在曲线上意向位置画椭圆注释,在右侧属性检查器可看到注释的参数
根据右侧注释的参数值,填写到函数中,代码如下:(以下代码创建了四个椭圆注释)
dim1 = [0.3107,0.65, 0.0304,0.0714];
dim2 = [0.3143,0.48, 0.0304,0.0714];
dim3 = [0.5053,0.7452, 0.0304,0.0714];
dim4 = [0.5036,0.6405, 0.0304,0.0714];
annotation('ellipse',dim1);
annotation('ellipse',dim2);
annotation('ellipse',dim3);
annotation('ellipse',dim4);
运行结果如下:
完整注释如下:“
figure()
hold on;
grid on;
plot(IRS_num,Rate_IRS,'b-','LineWidth',2);
plot(FD_num,Rate_FD3,'m-.','LineWidth',2);
plot(HD_num,Rate_HD3,'r-.','LineWidth',2);
set(gca,'xtick',(0:200:1600));
xlabel('Number of elements/antennas at the IRS/AF relay,N');
ylabel('Achievable rate(bps/Hz)');
legend('IRS','FD AF relay','HD AF relay','LineWidth',2);
dim1 = [0.3107,0.65, 0.0304,0.0714];
dim2 = [0.3143,0.48, 0.0304,0.0714];
dim3 = [0.5053,0.7452, 0.0304,0.0714];
dim4 = [0.5036,0.6405, 0.0304,0.0714];
annotation('ellipse',dim1);
annotation('ellipse',dim2);
annotation('ellipse',dim3);
annotation('ellipse',dim4);
x1 = [0.3804,0.3464];
y1 = [0.8061,0.7524];
x2 = [0.4429,0.3571];
y2 = [0.4847,0.4976];
x3 = [0.4161,0.4732];
y3 = [0.8143,0.7881];
x4 = [0.5018,0.5089];
y4 = [0.549,0.6143];
textbox1 = [0.1929,0.8252,0.4143,0.0643];
textbox2 = [0.4554,0.4752,0.3965,0.0643];
str1 = '1 bps/Hz increease by doubling N ';
str2 = '2 bps/Hz increease by doubling N ';
annotation('textarrow',x1,y1')
annotation('textbox',textbox1,'String',str1,'FitBoxToText','on','EdgeColor','none');
annotation('textarrow',x2,y2);
annotation('textarrow',x3,y3);
annotation('textarrow',x4,y4);
annotation('textbox',textbox2,'String',str2,'FitBoxToText','on','EdgeColor','none');