how can I get the fixed point number as "-981.0621" from hdlcoder?

hi. I'm trying to get the fixed point number from hdl coder. the number is negative fixed number as -981.0621.
%%Function
phi_xy=zeros(84,1);
function phi_xy=calc()
for ii=7
for jj=12
phi_xy((jj-1)*7 + ii)=-981.0621;
end
end
end
%%script
calc();
but Verification output is always
### Begin Fixed Point Simulation :
ans =
  -981
How can I get negative fixed number -981.0621 instead -981?

回答 (1 件)

Kiran Kintali
Kiran Kintali 2018 年 2 月 2 日
編集済み: Kiran Kintali 2018 年 2 月 2 日

0 投票

can you share design.m, testbench.m and matlab hdlcoder project file for this question?
thanks

カテゴリ

ヘルプ センター および File Exchange で Code Generation についてさらに検索

質問済み:

2018 年 2 月 2 日

編集済み:

2018 年 2 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by