MATLAB Coder: Toolbox Function

조회 수: 4 (최근 30일)
Nycholas Maia
Nycholas Maia 2018년 2월 8일
편집: Denis Gurchenkov 2019년 3월 19일
I'm developing my own Toolbox called 'Mix Toolbox'.
My folders struct is:
+mix/amp2dbfs.m
function [dbfs] = amp2dbfs(sample)
%AMP2DBFS return the sample amplitude value using dBFS scale
%
% USAGE:
% [dbfs] = amp2dbfs(sample)
coder.inline('never');
dbfs = 20 * log10(abs(sample));
end
I call this function typing:
out = mix.amp2dbfs(value);
I'm trying to compile this function to MEX. In the MATLAB Coder I got:
-> Generating trial code: OK
-> Building MEX: OK
-> Running test file: ERROR
The invoked code did not call entry-point function: 'amp2dbfs'.
I tested the generated MEX file and it works.
I think that this MATLAB Coder error is only about the call 'amp2dbfs' and not 'mix.amp2dbfs'.
My question is: Is there a way to remove the final error in "Running test file" process?

채택된 답변

Denis Gurchenkov
Denis Gurchenkov 2018년 2월 22일
편집: Denis Gurchenkov 2019년 3월 19일
MATLAB Coder App does not support generating code for an entry-point function that is nested inside a package. I can think of the following workarounds:
  • use the command-line interface ("codegen") -- cd to +mix folder, call codegen from there
  • move amp2dbfs to outside of +mix
  • Create a separate entry point function (e.g. "main.m") that calls mix.amp2dbfs and generate code for that entry-point function.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Coder에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by