how to define time matlab for bar graph

2 ビュー (過去 30 日間)
fastjokerB
fastjokerB 2019 年 12 月 2 日
コメント済み: fastjokerB 2019 年 12 月 2 日
I want to display the graph by time, but I can't define the time so the graph is incorrect.
this is time variables
ChargeTime=[14.25;14.30;14.35;14.40;14.45;14.50;14.55;15.00;
15.05;15.10;15.15;15.20;15.25;15.30;15.35;15.40;15.45;15.50;
15.55;16.00;16.05;16.10;16.15;16.20;16.25;16.30;16.35;16.40]
power [6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;0;0;0;0;0]
  2 件のコメント
Tiago Dias
Tiago Dias 2019 年 12 月 2 日
Hello, your ChargeTime is not time, is just a number.
If you are fine with being a number just do
plot(ChargeTime,power,'*')
If u need time with days and hours and minutes:
t1 = datetime('26-09-2018 00:00:00','Format','dd-MM-uuuu HH:mm:ss','Format','dd-MM-uuuu HH:mm:ss');
fastjokerB
fastjokerB 2019 年 12 月 2 日
hello, thank you for your answer. yes it is not time. how can I define time? 14.25 hours at 16.45 hours until the time changes. The story of the event comes to 3 vehicles such parking station and these vehicles are charging over time. I want to show the power change graphically.

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

回答 (1 件)

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 12 月 2 日
ChargeTime=[14.25;14.30;14.35;14.40;14.45;14.50;14.55;15.00;
15.05;15.10;15.15;15.20;15.25;15.30;15.35;15.40;15.45;15.50;
15.55;16.00;16.05;16.10;16.15;16.20;16.25;16.30;16.35;16.40];
power=[6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;0;0;0;0;0];
bar(power)
xticks([14.25;14.30;14.35;14.40;14.45;14.50;14.55;15.00;
15.05;15.10;15.15;15.20;15.25;15.30;15.35;15.40;15.45;15.50;
15.55;16.00;16.05;16.10;16.15;16.20;16.25;16.30;16.35;16.40])
xlim([14 16]);
This way?
  3 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 12 月 2 日
編集済み: KALYAN ACHARJYA 2019 年 12 月 2 日
ChargeTime=[14.25;14.30;14.35;14.40;14.45;14.50;14.55;15.00;
15.05;15.10;15.15;15.20;15.25;15.30;15.35;15.40;15.45;15.50;
15.55;16.00;16.05;16.10;16.15;16.20;16.25;16.30;16.35;16.40];
power=[6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;6.6;0;0;0;0;0];
bar(power)
xticklabels({'14.25','14.30','14.35','14.40','14.45','14.50','14.55','15.00','15.05','15.10','15.15','15.20','15.25','15.30','15.35','15.40','15.45','15.50','15.55','16.00','16.05','16.10','16.15','16.20','16.25','16.30','16.35','16.40'})
Is this? If not can you show the expected results (you can use paint tool) or are you want time format in axis?
fastjokerB
fastjokerB 2019 年 12 月 2 日
thank you, but I wrote a code in matlab and when I run this code I want this graph to run time-dependent.

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

カテゴリ

Help Center および File ExchangeGraph and Network Algorithms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by