How can I create a string with sprintf based on these data?
2 次查看(过去 30 天)
显示 更早的评论
The goal is to create a string which reads 'day, month, day(num), year' example: 'Sun, Nov 12, 2017' I will link what I have so far down below.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/170486/image.png)
The months are given as a chart which I need to index, so say if the month is 1, the final string would read 'Jan'.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/170487/image.png)
thats what i have so far but it keeps reading error. Thanks in advance.
0 个评论
回答(1 个)
Walter Roberson
2017-12-1
m = m_name(mm, :);
And remember to put in the appropriate commans in formatSpec
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 String Parsing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!