【发布时间】:2019-03-27 05:46:49
【问题描述】:
我使用 Matlab coder 生成以下函数的 C 代码:
function [out] = myresample(in)
out = resample(in,4644,1000,10);
end
并通过codegen myresample -args {coder.typeof(0, [1 Inf]), 0} -config cfg生成代码,其中cfg = coder.config('lib'),cfg.DynamicMemoryAllocation = 'AllVariableSizeArrays'。
但它报告错误为:
??? The number of terms N must be constant.
我很困惑为什么它是错误的。有趣的是,当我将功能更改为
function [out] = myresample(in)
out = resample(in,10,10,10);
end
它有效。
我发现some links 解释了如何生成resample 的代码。但这似乎不适用于我的情况。
我使用 Matlab 2017b。
谢谢。
【问题讨论】:
标签: matlab matlab-coder