disp function error in matlab coder
조회 수: 6 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
답변 (1개)
Adam
2019년 10월 14일
disp is not supported by Coder. sprintf should work though.
댓글 수: 2
Adam
2019년 10월 14일
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.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!