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일

0 개 추천

doc string
doc compose % after Stephen's comment , make sure to use "" - double quotes

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Characters and Strings에 대해 자세히 알아보기

질문:

2020년 6월 18일

편집:

2020년 6월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by