function coder.newtype not supported for code genertion

4 次查看(过去 30 天)
Hello friends,
Matlab coder asked me to make a input variable (for a function) as constant by using newtype.
After I did it, it says that the coder.newtype is not supported.
Anyone?
Thanks

回答(1 个)

Ryan Livingston
Ryan Livingston 2019-4-17
Can you elaborate on where you used coder.newtype? If using the codegen command you can:
codegen myFunction -args {coder.typeof(1,[10,20],[0,1])}
To pass a constant input use:
codegen myFunction -args {coder.Constant(magic(3))}
Lastly, can you copy and paste the exact error message you're getting? It seems like something we could improve.
  6 个评论
Tamar Harpaz
Tamar Harpaz 2019-4-19
Thanks again.
I implemented your advice.
but a little problem for that 2 first lines:
hrtfDB= load ('ReferenceHRTF.mat');
hrtfData=coder.const(hrtfDB.hrtfData);
The output of a call to 'load' is not assigned to a variable. Assign its output to a variable without subscripting when adding hrtfDB to the coder.const too.
Thanks
Ryan Livingston
Ryan Livingston 2019-4-19
Rather than:
hrtfDB= load ('ReferenceHRTF.mat');
hrtfData=coder.const(hrtfDB.hrtfData);
Try using:
hrtfDB = coder.load ('ReferenceHRTF.mat');
hrtfData = hrtfDB.hrtfData;

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 MATLAB Coder 的更多信息

标签

产品


版本

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by