What is the Fixed-Point function replacement for atan?

조회 수: 2 (최근 30일)
priya agarwal
priya agarwal 2014년 1월 15일
답변: Paul Bayendang 2014년 4월 11일
I am converting my matlab function to vhdl. What is the function replacement for atan so that it can be converted to fixed point? And also another error is reported. error : Undefined function or variable 'epsilon_out'. The first assignent to a local variable determines its class. how to remove this.

채택된 답변

Tim McBrayer
Tim McBrayer 2014년 1월 15일
The list of functions supported for HDL code generation is in the HDL Coder documentation. As you have discovered, atan and atan2 are not supported. If you know your input range you can build a lookup table to approximate a function to a suitable precision.
The error message mentioning epsilonout is simply due to the presence of the earlier errors. Once you have valid implementations/replacements for atan and atan2, you won't encounter any issue with epsilonout.
  댓글 수: 2
priya agarwal
priya agarwal 2014년 1월 15일
thank you. I'll try to build a lookup table.
priya agarwal
priya agarwal 2014년 1월 23일
편집: priya agarwal 2014년 1월 23일
I made the lookup table in simulink. But how do I call this simulink block in my Matlab function?

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

추가 답변 (2개)

Bharath Venkataraman
Bharath Venkataraman 2014년 1월 20일
You can also try using cordicatan2, which gives you a CORDIC based inverse tangent value.

Paul Bayendang
Paul Bayendang 2014년 4월 11일
1) Also figuring a work around for atan function
2) atan2 function is supported, as far as r2012a

카테고리

Help CenterFile Exchange에서 Code Generation에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by