WHY CAN'T I PLOT THIS WITH "DATETIME"?

7 ビュー (過去 30 日間)
Pul
Pul 2021 年 7 月 20 日
コメント済み: Star Strider 2021 年 7 月 21 日
Hello everyone,
I can't plot because of the error with "data time".
Does anyone know how I can solve this problem.
Thank you.

採用された回答

Star Strider
Star Strider 2021 年 7 月 20 日
The first column is not a valid datetime array. It first needs to be converted to one.
Try this —
LD = load('LARSEN_MMEQ1.mat');
LARSENMMEQ1 = LD.LARSENMMEQ1;
LARSENMMEQ1.Var1 = datetime(LARSENMMEQ1.Var1, 'InputFormat','MM/dd/yyyy');
x = LARSENMMEQ1.Var1;
y = LARSENMMEQ1.Var2;
figure
plot(x, y)
grid
producing —
.
  8 件のコメント
Pul
Pul 2021 年 7 月 21 日
Thank you very much.
You've been very kind.
Star Strider
Star Strider 2021 年 7 月 21 日
As always, my pleasure!
.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGrid Lines, Tick Values, and Labels についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by