フィルターのクリア

Plot against varying index

20 ビュー (過去 30 日間)
Nick DeMarchis
Nick DeMarchis 2019 年 6 月 12 日
回答済み: Steven Lord 2019 年 6 月 12 日
Hi there!
I am dealing with two subplots, but the indecies of one vary with the indecies of another by M, and I'm just using the command
plot(y)
. For example, some matrix deals with the times 1, 2, 3 while the other deals with the times 1, 3, 5. How can I make it so that these two subplots display relative to time and not just their index? Thanks.

回答 (1 件)

Steven Lord
Steven Lord 2019 年 6 月 12 日
If you look at the Description section of the plot function documentation page, you're using the fifth syntax for plot:
"plot(Y) creates a 2-D line plot of the data in Y versus the index of each value.
  • If Y is a vector, then the x-axis scale ranges from 1 to length(Y)."
Instead, you want to use the first syntax:
"plot(X,Y) creates a 2-D line plot of the data in Y versus the corresponding values in X."
Call plot with two inputs.

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by