Matlab Coder Error: Cannot Process Options

I am getting a cyptic error when compiling very simple test code. I am running Matlab on a mac.
>> coder -args { 0 } HW -report
Cannot process options.
function ans = HW(x)
ans = x*2;
end
Running mex -setup returns
>> mex -setup
Options files control which compiler to use, the compiler and link command
options, and the runtime libraries to link against.
Using the 'mex -setup' command selects an options file that is
placed in /Users/Joseph/.matlab/R2012a and used by default for 'mex'. An options
file in the current working directory or specified on the command line
overrides the default options file in /Users/Joseph/.matlab/R2012a.
To override the default options file, use the 'mex -f' command
(see 'mex -help' for more information).
The options files available for mex are:
1: /Applications/MATLAB_R2012a.app/bin/mexopts.sh :
Template Options file for building gcc MEX-files
0: Exit with no changes
Enter the number of the compiler (0-1):

 채택된 답변

Kaustubha Govind
Kaustubha Govind 2012년 5월 29일

0 개 추천

You need to run the "codegen" command, not the "coder" command:
>> codegen -args {0} HW -report

추가 답변 (1개)

Walter Roberson
Walter Roberson 2012년 5월 25일

0 개 추천

-args has to go after the function it applies to.
coder HW -args {0} -report

댓글 수: 2

Joseph Cullen
Joseph Cullen 2012년 5월 26일
It makes no difference whether or not the -args is before or after the function. Any other ideas?
>> coder HW -args { 0 } -report
Cannot process options.
Walter Roberson
Walter Roberson 2012년 5월 26일
I would be curious as to whether the problem disappears if you have no spaces in the args, {0} instead of { 0 } ?

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터 및 File Exchange에서 MATLAB Coder에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by