MATLAB Answers

function coder.newtype not supported for code genertion

3 views (last 30 days)
Tamar Harpaz
Tamar Harpaz on 17 Apr 2019
Commented: Ryan Livingston on 19 Apr 2019
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

Answers (1)

Ryan Livingston
Ryan Livingston on 17 Apr 2019
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 Comments
Ryan Livingston
Ryan Livingston on 19 Apr 2019
Rather than:
hrtfDB= load ('ReferenceHRTF.mat');
hrtfData=coder.const(hrtfDB.hrtfData);
Try using:
hrtfDB = coder.load ('ReferenceHRTF.mat');
hrtfData = hrtfDB.hrtfData;

Sign in to comment.

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!