Inserting current date in string

Hi,
I have a string such as follows:
st = 'Today is January 17 2012'
How can I automatically insert today's date in this string without manually typing it into the string. I am looking for something of the form:
st = 'Today is datestr(now)' - but obviously this does not produce the desired result.
Thanks,

 Respuesta aceptada

bym
bym el 17 de En. de 2012
sprintf('today is %s',datestr(now()))

Más respuestas (1)

Thomas
Thomas el 17 de En. de 2012
Use:
str=['Today is ',date]

Categorías

Más información sobre Characters and Strings en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 17 de En. de 2012

Community Treasure Hunt

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

Start Hunting!

Translated by