how can I plot x,y with showing the gap because there are missing data

2 ビュー (過去 30 日間)
reyadh Albarakat
reyadh Albarakat 2015 年 5 月 11 日
コメント済み: Star Strider 2015 年 5 月 11 日
Hi guys, I am beginner in Matlab I want to plot x axis for years starts from 1982-2014 and I have missing data in (1994) and (2000). I wanted to plot x,y with showing gap which represented by 1994 and 2000.
Thank you
Reyadh

採用された回答

Star Strider
Star Strider 2015 年 5 月 11 日
Insert NaN in place of the missing data in your dependent variable ‘y’ vector. Be sure that the lengths of your x and y vectors are the same.
  2 件のコメント
reyadh Albarakat
reyadh Albarakat 2015 年 5 月 11 日
Hi Star Strider What about the x axis, should I write 1994 and 2000?
Reyadh
Star Strider
Star Strider 2015 年 5 月 11 日
Yes. Include the years as you would normally plot them.
For example:
x = [1993 1994 1995]
y = [2.31 NaN 4.65]
The same for 2000. If there are more than one entry for each year, for instance for each month, then you would enter a NaN value in y for each missing data point. Both your x and y vectors must have equal numbers of elements.

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by