monthnum2name

版本 1.01 (1.7 KB) 作者: John McDowell
Simple function to convert month number to month name. Saves user having to manually generate datestrings/datetimes and extract the month.
17.0 次下载
更新时间 2020/7/10

查看许可证

% J.McDowell - 10/07/20
% Simple function to convert month number to month name (eg [7] to 'July').
% Multiple numeric inputs are accepted (eg [5,8] outputs {'May','August'}).

%% Inputs

% MonthNumber: Numeric array of integers within the range 1 to 12.
% Multiple numeric inputs accepted in the form [m1,m2,mn...].

% MonthFormat: Character array that must equal either 'First','Short' or
% 'Long'. Input is not case sensitive and abbreviations are accepted.
% 'First' will output the first letter of the month (eg 'S' for September).
% 'Short' will output the first 3 letters of the month (eg 'Jun' for June).
% 'Long' will output the full month name (eg 'January' for the 1st month).

%% Outputs

% MonthName - character or cell array (if multiple numeric inputs given) of
% month names in the user specified Format.

引用格式

John McDowell (2024). monthnum2name (https://www.mathworks.com/matlabcentral/fileexchange/77981-monthnum2name), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2020a
兼容任何版本
平台兼容性
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.01

Updated description.

1.0.0