Simulink function Block / num2str
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello everybody,
I have created a simulink model(with a function Block) and would like to use 2 parameters as input which search automatically in a resistance matrix a resistance value as output. My problem is that I can´t convert a double value into a string via num2str.
Error Message: "The function 'num2str' is not supported for standalone code generation."

I wanted to solve the problem with another function which should convert my double value into a string, but it isn´t working as well.
Error Message: Inferred size for data 'str' is empty, which is invalid for a Simulink signal.

Please Help, Thank you'!
0 comentarios
Respuestas (1)
Walter Roberson
el 3 de Nov. de 2017
Editada: Walter Roberson
el 3 de Nov. de 2017
Remember, once you initialize a variable, it can never get any larger unless you coder.varsize() it.
Your code Double2String appears to work only for integers. For integers you can use int2str() -- it is supported for code generation. Unfortunately sprintf() is not supported for code generation and num2str is not supported for code generation.
cvklpstunc is correct that characters are not supported as signals (unless perhaps as some kind of custom signal), but you can transfer uint8 or uint16 around and char() them as needed.
0 comentarios
Ver también
Categorías
Más información sobre Sources en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!