Please help, I keep getting this error... Error using plot Not enough input arguments.
1 次查看(过去 30 天)
显示 更早的评论
Months=["Jan";"Feb";"March";"April";"May";"June";"July";"Aug";"Sept";"Oct";"Nov";"Dec"];
EnergyDailyAve = [33.677 76.714 69.677 64.800 49.871 59.533 49.290 45.516 31.033 29.258 44.233 23.419]';
xticklabels(Months)
plot(Months,EnergyDailyAve)
0 个评论
回答(2 个)
KSSV
2023-2-22
Months=["Jan";"Feb";"March";"April";"May";"June";"July";"Aug";"Sept";"Oct";"Nov";"Dec"];
EnergyDailyAve = [33.677 76.714 69.677 64.800 49.871 59.533 49.290 45.516 31.033 29.258 44.233 23.419]';
plot(EnergyDailyAve)
xticklabels(Months)
4 个评论
KSSV
2023-2-22
Months=["Jan";"Feb";"March";"April";"May";"June";"July";"Aug";"Sept";"Oct";"Nov";"Dec"];
EnergyDailyAve = [33.677 76.714 69.677 64.800 49.871 59.533 49.290 45.516 31.033 29.258 44.233 23.419]';
plot(EnergyDailyAve)
% xticklabels(Months)
set(gca,'XTickLabel',Months),set(gca,'XTick',1:numel(Months))
Stephen23
2023-2-22
Rather than fiddling around with text and tickmarks, let MATLAB do it for you:
V = [33.677;76.714;69.677;64.800;49.871;59.533;49.290;45.516;31.033;29.258;44.233;23.419];
D = datetime(2023,1,1):calmonths(1):datetime(2023,12,31);
plot(D,V)
另请参阅
类别
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!