フィルターのクリア

How do I plot a horizontal line

4 ビュー (過去 30 日間)
Alex Vasin
Alex Vasin 2019 年 4 月 9 日
回答済み: madhan ravi 2019 年 4 月 9 日
s=0.5:0.001:1;
f=yline(0.25);
plot(s,f)
How do I get this to produce a horizontal line at y=0.25 for the interval 0.5 <= s <= 1? Every time I run the script I get a blank graph.
Thanks

採用された回答

KSSV
KSSV 2019 年 4 月 9 日
s=0.5:0.001:1;
f=repmat(0.25,1,length(s));
plot(s,f)

その他の回答 (1 件)

madhan ravi
madhan ravi 2019 年 4 月 9 日

Using plot here is pointless when you can directly:

yline(.25)
xlim([.5,1])

カテゴリ

Help Center および File ExchangeLabels and Annotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by