필터 지우기
필터 지우기

why doesn't this code work when asking for the month of the date?

조회 수: 2 (최근 30일)
leon
leon 2017년 7월 28일
답변: leon 2017년 7월 29일
clear
clear all
clc
prompt = ['Please enter the starting date mm/dd/yyyy: \n' ... '(Ex. 07/27/2004 or 7/27/2004) \n\n'];
%
% my intended input is 7/11/2016
%
D = input(prompt,'s');
D
[DayNumber] = weekday(D)
datestr(D)
m = month(D,'name')
  댓글 수: 4
leon
leon 2017년 7월 29일
its not in my script. it must be in the script of the month function.

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

채택된 답변

leon
leon 2017년 7월 29일
% I wanted to simply output the entire name of the month.
% I found another way to do it using m = datestr(D, 'mmmm')
% Which works fine

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by