Plotting graph using arrays

12 ビュー (過去 30 日間)
Shantanu Vachhani
Shantanu Vachhani 2017 年 10 月 25 日
コメント済み: Jackson Brandeberry 2020 年 10 月 23 日
x=zeros(1,10);
x(2:4) =1;
y= linspace(0,10,10);
plot(y,x)
I want a straight vertical line but matlab is giving me a slant line.Any solution?
  1 件のコメント
Jackson Brandeberry
Jackson Brandeberry 2020 年 10 月 23 日
How do you then find the equation of the graph?

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

回答 (1 件)

KSSV
KSSV 2017 年 10 月 25 日
x = [1 1 2 3 4 4 5 6 7 8 9 10] ;
y = [0 1 1 1 1 0 0 0 0 0 0 0] ;
plot(x,y)

カテゴリ

Help Center および File ExchangeGraph and Network Algorithms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by