Borrar filtros
Borrar filtros

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

19 visualizaciones (últimos 30 días)
DUMITRU ROBERT GUGIU
DUMITRU ROBERT GUGIU el 19 de Dic. de 2020
Respondida: Matt Gaidica el 19 de Dic. de 2020
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

Respuesta aceptada

Matt Gaidica
Matt Gaidica el 19 de Dic. de 2020
print(['HSIGN_calma' (caption1(t)) datestr(now,'yyyymmdd_HHMMSS') '.png'],'-dpng');

Más respuestas (0)

Categorías

Más información sobre Interactive Control and Callbacks en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by