build YYYYMMDD instead of YYYYMD, for YY and DD derived from one-digit outputs from datevec()
    6 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Marco
      
 el 30 de Abr. de 2014
  
    
    
    
    
    Comentada: Mischa Kim
    
      
 el 30 de Abr. de 2014
            Hello. I would like to produce a date (for instance: 7th of January 2014) string looking like '20140107' for representing YYYYMMDD, but a one digit M and D currently results in the unwanted string '201417', which is only YYYYMD.
[Y, M, D, H, MN, S] = datevec(now);
dateString =[num2str(Y),num2str(M),num2str(D)];
0 comentarios
Respuesta aceptada
  Phillip
      
 el 30 de Abr. de 2014
        Hi
dateString = datestr(now,'yyyymmdd')
Type
help datestr
to get more information
Regards, Phillip
0 comentarios
Más respuestas (1)
  Mischa Kim
    
      
 el 30 de Abr. de 2014
        
      Editada: Mischa Kim
    
      
 el 30 de Abr. de 2014
  
      Marco, how about
 dateString = datestr(now,'yyyymmdd');
2 comentarios
Ver también
Categorías
				Más información sobre Detection, Range and Doppler Estimation en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


