What is the Fixed-Point function replacement for atan?

2 次查看(过去 30 天)
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-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
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