how to define time matlab for bar graph

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

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일

1 개 추천

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

fastjokerB
fastjokerB 2019년 12월 2일
thank you very much but it is not working. this look like this. I want to see time variables and there is not 14.55pwr.JPG
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.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

질문:

2019년 12월 2일

댓글:

2019년 12월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by