Disp function with matlab coder

8 visualizaciones (últimos 30 días)
Chuck37
Chuck37 el 1 de Dic. de 2016
Respondida: Vishal Neelagiri el 5 de Dic. de 2016
I'm experimenting with a simple hello world function to see how the coder works.
disp('Hello world')
The mex version works, but when I make a standalone executable there is no output. In fact, the generated code for the function itself is completely empty ({}), like the disp() was purposely skipped over. Is this the expected behavior, or is there some setting I can change?
EDIT: I just tried fprintf(1,'Hello world'), and the converted code contains "cfprintf()". So still, purposely suppressing output? BTW, this is on Linux/2016b.

Respuesta aceptada

Vishal Neelagiri
Vishal Neelagiri el 5 de Dic. de 2016
The 'disp' function is not supported to generate C/C++ code from MATLAB code. You can refer to the following documentation link for a list of functions that support code generation:
https://www.mathworks.com/help/rtw/ug/create-a-protected-model-using-the-model-block-context-menu.html

Más respuestas (0)

Categorías

Más información sobre MATLAB Coder 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