How can i produce a plot that represents each month of the year showing the total of the different values?

조회 수: 2 (최근 30일)
I have a dataset with different days,months and years that all produce the total of the different individual values. If i was to represent the total value for each month in that year.
cyclist_M = zeros(12,1);
for i=1:1:12
start_P=i+(i-1)*3; %start pt of the month
end_P=start_P+3;
cyclist_M(i,1)=sum(cyclistVec_year_2017(start_P:end_P,1));
end
%Now to visualize the data
month =(1:11)';
figure(1);bar(month,cyclist_M);title('Total cyclist per month in 2017');xlabel('Month');ylabel('Total Cyclist');grid on;
  댓글 수: 4
Jan
Jan 2022년 11월 25일
@Kernisha: Please post some code, which create example data. Then suggesting a solution is much easier.
Kernisha
Kernisha 2022년 11월 25일
편집: Jan 2022년 11월 26일
%Obtain data
date = EcoTotemBroadwayBicycleCountA2(:,1);
dateNum = datevec(date);
date_2017 = (dateNum(:,1)==2017);
year_2017 = date_2017
year_2017 = year_2017>0;
runT = EcoTotemBroadwayBicycleCountA2(:,5);
runTnum = cell2mat(runT);
runVec_year_2017=runTnum(year_2017);

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Calendar에 대해 자세히 알아보기

제품


릴리스

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by