disp function error in matlab coder

disp(["Generation #", int(g)]);
the above line is showing error in my code
shows following error
Error in GeneticAlgorithm (line 11)
disp(["Generation #", int(g)]);
any suggestions for this error

Respuestas (1)

Adam
Adam el 14 de Oct. de 2019

0 votos

disp is not supported by Coder. sprintf should work though.

2 comentarios

aarthy reddy R
aarthy reddy R el 14 de Oct. de 2019
can u kindly help me out for using disp function
because i am getting errors by using sprintf function
Adam
Adam el 14 de Oct. de 2019
I don't know what
int(g)
is supposed to represent. There isn't an int() function in base Matlab. I also don't know what you are doing with sprintf to give you errors since you didn't post it.
In general sprintf can very simply directly replace disp, but I don't know what your disp function is trying to output since I don't know what int( ) is.
sprintf( "Generation #%i", g )
should theoretically work fine though.

Iniciar sesión para comentar.

Categorías

Más información sobre Install Products en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 14 de Oct. de 2019

Comentada:

el 14 de Oct. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by