# MATLAB: Error converting datetime to month names

errormonth

I want to convert numbers 1-12 to month names in a text string (January, February, etc…) I was using this:
for m = 1:12t = datetime(m,m,m)mon = month(t,'name')end
and it was working fine, however I tried this same exact thing and now it is no longer working, I am getting this error: Function 'subsindex' is not defined for values of class 'datetime'.
Does anyone know how to fix this, or another way to do this?