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 Center および File ExchangeMatrices and Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by