How to plot vectors with different lenght

조회 수: 1 (최근 30일)
aciara
aciara 2021년 3월 2일
답변: Rik 2021년 3월 2일
Hy Guys,
How can I plot vectors with different lenght? I have a sequence of financial data and I want to plot them in the following way:
  • x-axes = the time (In my case I have a span time that goes from January 2000 to October 2020, that is a 1x249 size vector)
  • y-axes = the values of my financial data, and I have data from January 2003 to October 2020, so a 1x213 size vector)
I want to plot them together and to leave a "white space" at the beginning, since I don't have data for that period.
Thank you for your help.

채택된 답변

Rik
Rik 2021년 3월 2일
You need to make sure your data matches up. You can either remove the x-values you don't have a y for, or add NaN values for those elements.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by