when i plot my figure doesnt show line

1 回表示 (過去 30 日間)
Palvasha Turial
Palvasha Turial 2021 年 2 月 27 日
コメント済み: Star Strider 2021 年 2 月 27 日
x = 1:5
y = 6;9
plot(x,y)

回答 (1 件)

Star Strider
Star Strider 2021 年 2 月 27 日
Use a colon to create the vectors instead of a semicolon, and be sure the vectors are equal length:
x = 1:5;
y = 5:9;
plot(x,y)
alternatively, if you want to define ‘x’ and ‘y’ as 2-element vectors:
x = [1 5];
y = [6 9];
plot(x,y)
Both will work.
  6 件のコメント
Palvasha Turial
Palvasha Turial 2021 年 2 月 27 日
thank you all
Star Strider
Star Strider 2021 年 2 月 27 日
Please use a version of the code I provided. Those will work.
The code you are attempting to run will not work and will likely throw errors.
Please see Getting Started or MATLAB Onramp (or preferably both of these) to understand how MATLAB works and how to write useful scripts.

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

カテゴリ

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

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by