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,

 채택된 답변

bym
bym 2012년 1월 17일

0 개 추천

sprintf('today is %s',datestr(now()))

추가 답변 (1개)

Thomas
Thomas 2012년 1월 17일

0 개 추천

Use:
str=['Today is ',date]

카테고리

도움말 센터File Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

질문:

2012년 1월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by