How to use 2 matrixes as the xlabel to a plot?

1 回表示 (過去 30 日間)
Fredrik Preus Dovland
Fredrik Preus Dovland 2020 年 9 月 21 日
コメント済み: Rik 2020 年 9 月 21 日
So I am going to plot using one matrix as the y values and two matrixes called: time, date for the x values. How do i combine the time and date matrixes to show as x values in the plot?

回答 (1 件)

Rik
Rik 2020 年 9 月 21 日
doc datetime
  2 件のコメント
Fredrik Preus Dovland
Fredrik Preus Dovland 2020 年 9 月 21 日
i couldnt get the datetime to work.
i wrote:
t = datetime(parkering.Dato{:},'dd.MM.yyyy.',inf)
Where 'parkering.Dato' is the date cell-array
Rik
Rik 2020 年 9 月 21 日
Your syntax suggests you're trying to input a cell array, which you're converting to a comma separated list. What inf is doing in your call is unclear to me. Have you done a basic Matlab course already? And have you read the documentation?
The syntax you showed is equivalent to this:
parkering.Dato={'20.09.1998.','30.01.2020.'};
t = datetime('20.09.1998.','30.01.2020.','dd.MM.yyyy.',inf)
Which syntax pattern is that supposed to fit?

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

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by