필터 지우기
필터 지우기

HOW TO INSERT THE DATE (DATETIME) IN THE PRINT?

조회 수: 19 (최근 30일)
DUMITRU ROBERT GUGIU
DUMITRU ROBERT GUGIU 2020년 12월 19일
답변: Matt Gaidica 2020년 12월 19일
clear all; clc;
%% parte dedicata a lettura dati OK !
ncfile='04072015A30122019.nc';
ncinfo(ncfile);
ncdisp(ncfile);
lon=ncread(ncfile,'lon');
lati=ncread(ncfile,'lat');
d=ncread(ncfile,'VHM0');
%% import time dimension DUBBI SUL 2 PUNTO !
time = ncread(ncfile,'time');
date_matlab = datetime(time, 'convertfrom','posixtime');
formatOut = ' dd, mm, yyyy HH:MM:SS.FFF';
formatOut = 'ddmmyyyy';
tt=datestr(time,formatOut);
gg=num2str(tt);
figure
for t=2:2:10
%:24:length(time)
startLoc = [1 1 t];
count = [Inf Inf 1];
d = ncread(ncfile,'VHM0',startLoc,count);
d=d';
xx=d;
hmax(t)=max(max(xx));
hmax= hmax'
clf
mymap=pcolor(lon,lati,xx);hold on
mymap.EdgeAlpha=0;
contourf(lon,lati,xx,7,'ShowText','on')
load coast
hold on
plot(long,lat+0.1,'black')
caxis([0 1])
sr=colorbar
sr.Label.String = 'm';
xlabel('longitudine');
ylabel('latitudine');
caption = sprintf('%s','Hs [m]' , date_matlab(t),'[UTC]',' Altezza max ', hmax(t));
caption1 = sprintf('%s', date_matlab(t));
title(caption,'FontSize', 10, 'FontWeight', 'bold', 'Color', 'b');
print(['HSIGN_calma' (caption1(t)) '.png'],'-dpng'); %% I WANT TO INSERT THE DATE HERE%%%
% % % VALOREMINIMO=min(min(d));
end
%
% end

채택된 답변

Matt Gaidica
Matt Gaidica 2020년 12월 19일
print(['HSIGN_calma' (caption1(t)) datestr(now,'yyyymmdd_HHMMSS') '.png'],'-dpng');

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by