change char class to string class

2 次查看(过去 30 天)
How to change the output from char class to string class ?
function Out=bestSection(Number,Letter,Grades)
[~,ind]=max(Grades);
Out=[num2str(Number(ind)),Letter(ind)];
end
  1 个评论
Stephen23
Stephen23 2020-6-18
The most robust and efficient solution is to use sprintf, which also lets you specify the numeric conversion format.

请先登录,再进行评论。

采纳的回答

madhan ravi
madhan ravi 2020-6-18
编辑:madhan ravi 2020-6-18
doc string
doc compose % after Stephen's comment , make sure to use "" - double quotes

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Characters and Strings 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by