フィルターのクリア

Plotting a line in matlab

3 ビュー (過去 30 日間)
Aftab Ahmed Khan
Aftab Ahmed Khan 2014 年 8 月 12 日
コメント済み: Aftab Ahmed Khan 2014 年 8 月 12 日
Hi everyone, I am trying to draw a stright line beneath this graph for comparison evaluation but this code doesn't work for me. Any help guys.
xline = linspace(1,14,14);
xline = 1e6*xline;
yline = xline;
plot(xline,yline,'-r*','LineWidth',4);
  1 件のコメント
Ben11
Ben11 2014 年 8 月 12 日
It does work for me; it looks like multiplying xline by 1e6 makes the line disappear out of your figure because your units are in Mbps. What if you don't multiply xline by 1e6?

サインインしてコメントする。

採用された回答

Joseph Cheng
Joseph Cheng 2014 年 8 月 12 日
I do not think you need to do the 1e6*xline as the current plot you have looks to be already scaled to Mbps. Also since you're plotting a lines in two different commands you'll need to use the command 'hold on'.
such as:
figure,plot([1:10],[1:10].^2);
hold on
plot([1:10],[1:10]);
  1 件のコメント
Aftab Ahmed Khan
Aftab Ahmed Khan 2014 年 8 月 12 日
Just needed to remove the 1e6, its working now. Here it is, Thanks

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by