标签: string matlab simulink
在Simulink中,我知道如何定义一个Matlab函数,该函数将常量或信号作为输入并进行处理。我想问一下是否有可能在Matlab函数中输入(常量)字符串。我查看了库浏览器,找不到可以表示字符串的块。
答案 0 :(得分:3)
Simulink does not support chars。最简单的解决方法是使用值uint8('hello world')的常量块。在MatlabFunction Block中,您可以使用char(varname)将其转换回文本。
uint8('hello world')
char(varname)