MATLAB: Why doesn’t this code work when asking for the month of the date

bugdatemonthtime

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')

Best Answer

% 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