フィルターのクリア

How to plot XY graph for a changing Y value with fixed X intervals

1 回表示 (過去 30 日間)
Mahmoud
Mahmoud 2015 年 3 月 14 日
コメント済み: dpb 2015 年 3 月 15 日
If I am getting y1, y2, yn as value with no specific relationship between them and x is from 0 to 10 where the x interval is fixed and is equal to 0.5. how can I assign x1 to y1, x2 to y2 automatically to plot it in xy graph? for example, y1 = 2, y2 = 0.5, y3 = 3, . . yn= some number

採用された回答

dpb
dpb 2015 年 3 月 14 日
Don't assign the y values to multiple variables(*), create an array instead. Then simply
plot(x,y)
where
x=0.5*[1:10];
(*) This is one of the FAQ topics as inexperienced users often see that as the approach but it rarely if ever is...see the FAQ
In your case, all you need is a simple array of values.
  2 件のコメント
Mahmoud
Mahmoud 2015 年 3 月 15 日
it is not working with me, can you be more specific. I am new to matlab.
dpb
dpb 2015 年 3 月 15 日
What isn't working? Can't see what you've done from here. Post your code that demonstrates the problem.

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

その他の回答 (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