How to use Num2str?

조회 수: 5 (최근 30일)
Tran Hoa
Tran Hoa 2018년 5월 26일
댓글: Majid Farzaneh 2018년 5월 26일
Hi,
I have researched Matlab. When I use Num2str,
disp (['Iteration ' num2str (it) ': Best cost = ' num2str (Bestcosts(it))]);
it happen a mistake
Error using num2str (line 41)
Not enough input arguments.
Please, help me solve this problem
Thank you

채택된 답변

Majid Farzaneh
Majid Farzaneh 2018년 5월 26일
편집: Majid Farzaneh 2018년 5월 26일
Hi, Don't use space between num2str and '('. This will work:
disp (['Iteration ' num2str(it) ': Best cost = ' num2str(Bestcosts(it))]);
  댓글 수: 5
Tran Hoa
Tran Hoa 2018년 5월 26일
Excellent. It is done. Thank you very much Majid Farzaneh.
Majid Farzaneh
Majid Farzaneh 2018년 5월 26일
You're welcome

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by