필터 지우기
필터 지우기

matlab coder--error while converting .m file.

조회 수: 3 (최근 30일)
ECE09 ITBHU
ECE09 ITBHU 2011년 7월 28일
I am trying to convert .m to .c but i ma getting following error----
>>this text contains some non-empty top-level expressions.It appears to be a script.
my .m starts with %comments and then some functions calling as per user-based inputs.

채택된 답변

Kaustubha Govind
Kaustubha Govind 2011년 7월 28일
You need to define your MATLAB code as a function (it appears what you have now is a script). See Basic Parts of a Program File. You need to use the function keyword and specify any input/output arguments along with the function name.

추가 답변 (1개)

Arthur
Arthur 2013년 4월 7일
Hello, i've gotta the some problem, but in other conversion type. I'm trying to convert a floating point code to fixed point format code. For that, i'm using a Test Bench Code, just like the tutorial below suggests.
The same error happens: the Builder sees the .m file of the testbench as a script. Although, i can't use it as a function because it would contradict the tutorial above. What should I do?
  댓글 수: 1
Kiran Kintali
Kiran Kintali 2013년 4월 8일
Hi Arthur,
Can you try making the script into a void void function (a function with no inputs or outputs)?
If you can send me your code I can give more concrete answer. (<mailto:kiran.kintali@mathworks.com kiran.kintali@mathworks.com>)

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

카테고리

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