How to use Num2str?

1 次查看(过去 30 天)
Tran Hoa
Tran Hoa 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 中查找有关 Programming 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by