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)

回答(2 个)

KSSV
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
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
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)

标签

Community Treasure Hunt

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

Start Hunting!

Translated by