How to use Num2str?

15 visualizaciones (últimos 30 días)
Tran Hoa
Tran Hoa el 26 de Mayo de 2018
Comentada: Majid Farzaneh el 26 de Mayo de 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

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by