How can i make a graph only with numerical values?

5 ビュー (過去 30 日間)
Jane
Jane 2011 年 10 月 25 日
Hello. I wonder if i can make a graph without any function about my data. I only have numerical values.
For example,
(x,y)=(1,3), (2,4), (5, 6)...
Value y is not a function of x.
In this situation, how can i draw a graph? Help me ! T.T

回答 (2 件)

Naz
Naz 2011 年 10 月 25 日
x=[1 2 3]; % or x=1:3
y=[3 4 6];
plot(x,y);
it will plot a sequence of points. If you dont want them to be connected, you can set some parameters, for example:
plot(x,y,'o');
You can further simplify to:
plot(y,'o')

Walter Roberson
Walter Roberson 2011 年 10 月 25 日
Perhaps a 2D spline would be appropriate for this situation.

カテゴリ

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