This text contains non-empty top-level expressions. It appears to be a script.

조회 수: 11 (최근 30일)
sonali panda
sonali panda 2019년 9월 19일
답변: Ryan Baird 2022년 11월 18일
After running the below code i am getting an error "This text contains non-empty top-level expressions. It appears to be a script."
x=real(signal);
l=length(x);
xin2(1)=1;
eqin(1)=x(1);
for i=1:(l-1)
eqin(i+1)=x(i+1)-xin2(i)+eqin(i);
xin2(i+1)=sign(eqin(i+1));
end
can anyone tell me what to change in the code so as to convert this code to verilog ....
  댓글 수: 2
darova
darova 2019년 9월 19일
Can you attach your whole script? Which line does the error appears on?
sonali panda
sonali panda 2019년 9월 19일
this is the whole script..and the error is "This text contains non-empty top-level expressions. It appears to be a script."

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

답변 (1개)

Ryan Baird
Ryan Baird 2022년 11월 18일
HDL Coder is expecting a function, rather than a script:
https://www.mathworks.com/help/matlab/matlab_prog/create-functions-in-files.html

카테고리

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