필터 지우기
필터 지우기

How can I start the cumulative from a specific year?

조회 수: 3 (최근 30일)
Pul
Pul 2021년 12월 4일
댓글: Pul 2021년 12월 4일
Hello everyone,
I would need that my cumulative sum to start from 2015 instead of 1998; how can I do it?
load('DATI_ECM_GIORNALIERI')
C1 = cumsum(DATIECMWFgiornalieri{:, 4})
Thank you!

채택된 답변

Voss
Voss 2021년 12월 4일
load('DATI_ECM_GIORNALIERI')
idx = find(DATIECMWFgiornalieri{:,1} == 2015,1);
C1 = cumsum(DATIECMWFgiornalieri{idx:end, 4});
  댓글 수: 1
Pul
Pul 2021년 12월 4일
Thank you.
But how can I plot it with "LARSEN", if the number of data is different?
load ('larsen_daily')
loaf('LARSEN')
DTv = datetime(DATIECMWFgiornalieri{:,1:3});
smb=table2array(DATIECMWFgiornalieri(:,4))
for i =1:8402
if isnan(smb(i))
smb(i)=0;
end
end
Cum=cumsum(smb)
Cum_smbp=DATIECMWFgiornalieri;
Cum_smbp(:,4)=array2table(Cum);
plot(larsen_daily.TOA5,LARSEN, 'DisplayName','AWS');
hold on
plot(DTv,table2array(Cum_smbp(:,4)),'m', 'DisplayName','ECMWF');
plot(DTv,table2array(Cum_smbp(:,4),Cum_smbp.SMB_larsenmm(1:8042),'m', 'DisplayName','ECMWF'));
legend('Location','best')
plot(DTv, C1);
hold on
plot(larsen_daily.TOA5, A);
Thank you.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by