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

답변 (1개)

Adam
Adam 2019년 10월 14일

0 개 추천

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

댓글 수: 2

aarthy reddy R
aarthy reddy R 2019년 10월 14일
can u kindly help me out for using disp function
because i am getting errors by using sprintf function
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.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Install Products에 대해 자세히 알아보기

태그

질문:

2019년 10월 14일

댓글:

2019년 10월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by