Day Function not Working

Hello!
I have a cell array (question_display_time) filled with dates in the following format string = 'yyyy-mm-dd HH:MM:SS.FFF'.
When I try to run the day function Matlab returns the following: Undefined function 'day' for input arguments of type 'cell'.
When I try to run it on a sample string I get the following Undefined function 'day' for input arguments of type 'char'.
Am I doing something wrong? I thought this would be a simple function to grab the date with!
What I have tried: dayDate = cellfun(@day, question_display_time) day(string,'yyyy-mm-dd HH:MM:SS.FFF') day('2013-05-05 12:33:33.1234')
Any ideas? :)

 채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 8월 30일

0 개 추천

day('2013-05-05 12:33:33','yyyy-mm-dd HH:MM:SS')

댓글 수: 3

Mary
Mary 2013년 8월 30일
편집: Mary 2013년 8월 30일
I still get the undefined function 'day' for input arguments of type char with this answer...
>> day('2013-05-05 12:33:33','yyyy-mm-dd HH:MM:SS') Undefined function 'day' for input arguments of type 'char'.
Type
which day
what do you get?
Mary
Mary 2013년 8월 30일
C:\Program Files\MATLAB\R2013a\toolbox\finance\calendar\day.m
it exists - I found an easier method to do this without using the day function
days = datestr(question_display_time,'dd')
Thank you for your help and quick responses

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

질문:

2013년 8월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by