How to use Num2str?

5 vues (au cours des 30 derniers jours)
Tran Hoa
Tran Hoa le 26 Mai 2018
Commenté : Majid Farzaneh le 26 Mai 2018
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

Réponse acceptée

Majid Farzaneh
Majid Farzaneh le 26 Mai 2018
Modifié(e) : Majid Farzaneh le 26 Mai 2018
Hi, Don't use space between num2str and '('. This will work:
disp (['Iteration ' num2str(it) ': Best cost = ' num2str(Bestcosts(it))]);
  5 commentaires
Tran Hoa
Tran Hoa le 26 Mai 2018
Excellent. It is done. Thank you very much Majid Farzaneh.
Majid Farzaneh
Majid Farzaneh le 26 Mai 2018
You're welcome

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by