how to define time matlab for bar graph
2 ビュー (過去 30 日間)
古いコメントを表示
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
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');
回答 (1 件)
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
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?
参考
カテゴリ
Help Center および File Exchange で Graph and Network Algorithms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!