Why this variable doesn't appear?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello everyone,
I'm trying to do a cumulate of 'DATI_ECM_GIORNALIERI' but the variable doesn't appear.
Then, I only have to plot it (eg Cum_Giul.SMB_mpmm) instead of DATIECMWFgiornalieri.SMB_mpmm, as you can see at the end of the plot.
Thank you very much.
clear all
close all
load('GIULIA_MMEQ1.mat');
A=GIULIAMMEQ1.Var4;
B=str2double(A);
NEW= B * 10 * 0.35;
C=GIULIAMMEQ1.Dec1997;%array2table
C=replace(C,"';","");
C=datetime(C,'InputFormat','dd MMM yyyy'); %convert to datetime format
plot(C,NEW)
load('DATI_ECM_GIORNALIERI')
DTv = datetime(DATIECMWFgiornalieri{:,1:3})
Cum_Giul=retime(DATIECMWFgiornalieri,'daily', @(x)sum(x,'omitnan'))
figure
yyaxis left
plot(C,NEW, 'DisplayName','AWS')
yyaxis right
plot(DTv, DATIECMWFgiornalieri.SMB_mpmm,'m', 'DisplayName','ECMWF');
% plot(DTv, DATIECMWFgiornalieri.SMB_mpmm,'m-*', 'DisplayName','ECMWF');
Ax = gca;
Ax.YAxis(2).Color = 'm';
legend('Location','best')
댓글 수: 0
채택된 답변
Walter Roberson
2021년 8월 26일
DATIECMWFgiornalieri is a table() object. You cannot retime() a table() object. You need to take that Dtv you created and
Cum_Giu = retime(table2timetable(DATIECMWFgiornalieri, 'RowTimes', DTv), 'daily', @(x)sum(x,'omitnan'))
댓글 수: 8
Walter Roberson
2021년 8월 26일
Cum_Giu = retime(table2timetable(DATIECMWFgiornalieri, 'RowTimes', DTv), 'daily', @(x)sum(x,1,'omitnan'))
CTv = Cum_Giu.Properties.RowTimes;
yyaxis left
plot(CTv, Cum_Giu.SMB_mpmm, 'm', 'DisplayName','ECMWF');
yyaxis right
plot(C,NEW, 'DisplayName','AWS')
Ax = gca;
Ax.YAxis(2).Color = 'm';
legend('Location','best')
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!