Draw a line

53 ビュー (過去 30 日間)
Vibol TEAV
Vibol TEAV 2011 年 6 月 5 日
回答済み: Steven Lord 2022 年 11 月 7 日
I'm new to Matlab, I wanna draw a simple line x=4, or y=9. Someone kindly help me?

採用された回答

Matt Fig
Matt Fig 2011 年 6 月 5 日
line([4 4],[0 10],'color','b') % Blue line from (4,0) to (4,10)
line([0 10],[9 9],'color','r') % Red line from (0,9) to (10,9)
axis([0 10 0 10]) % Set the axis limits
You can do the same thing with the PLOT command.
  1 件のコメント
Vibol TEAV
Vibol TEAV 2011 年 6 月 5 日
Great, this is what I'm looking for. Thanks a million!!!

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

その他の回答 (1 件)

Steven Lord
Steven Lord 2022 年 11 月 7 日
If you're using release R2018b or later you can use the xline or yline functions.

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by