【发布时间】:2020-03-21 14:36:04
【问题描述】:
我想将一个 uint8 数组作为参数传递给我的 S-Function:
inParam = char(uint8(1:7))
在 S-Function 中我做了以下操作
UINT8_T *inParam = (UINT8_T *)mxGetPr(ssGetSFcnParam(S, PARAM_IN_PORT_NR)); //;
但我看到实际上数组元素存储为 2 个字节。
UINT16_T *inPorts = (UINT16_T *)mxGetPr(ssGetSFcnParam(S, PARAM_IN_PORT_NR)); //
// I can loop through the data
// This is only a snippet
*(inPorts++);
这是为什么呢?所有的 Matlab 版本都会出现这种情况吗?
【问题讨论】:
标签: matlab s-function