本博客中输出版本号和日期的子函数,今天才发现忘记上代码了,这里补上
function banner() %% ------------------------------------------------------------------------ %% Output Info about matlab %fprintf(' *********************************************************** '); [v, d] = version; fprintf(' MATLAB Version: %20s ', v); fprintf(' Released Date: %17s ', d); time_stamp = datestr(now, 31); [wkd1, wkd2] = weekday(today, 'long'); fprintf(' Now is %20s, and it is %7s ', time_stamp, wkd2); %% ------------------------------------------------------------------------
运行效果如下:
还有其它参数,具体可参考帮助文件。