フィルターのクリア

Why do I get this error Code generation does not support display for MATLAB classes. 'dsp.HDLIFFT' is a class. ?

1 回表示 (過去 30 日間)
I am trying to call a function, which create dsp.IFFT system object, inside another for HDL Code generation.
My Code: %main function
function [out1,out2] = main(x,y,z)
%call subfunction 1
out1 = sub1(x);
%call subfunction 2
out2 = sub2(y,z);
end
subfucntion 2 codecode:
function [yOut,validOut] = HDLIFFT128(yIn,validIn)
persistent ifft128;
if isempty(ifft128)
ifft128 = dsp.HDLIFFT('FFTLength',128);
end
[yOut,validOut] = step(ifft128,yIn,validIn);
end

採用された回答

Walter Roberson
Walter Roberson 2016 年 7 月 13 日
The connection between your two routines is not clear.
I suspect the problem might be because you have not put semi-colon on the end of your assignments to out1, so you are requesting that the result be displayed. If the result is not numeric then the coder will not know how to display it.
Note that you do not assign to out2 in your main function.
  2 件のコメント
Pablo Medina
Pablo Medina 2016 年 7 月 13 日
Thanks!
The semi-colon works. But now I get this error:
The function 'HDLIFFT128' contains persistent variables 'ifft128' and has specialization 'HDLIFFT128_s1' associated with it. Function specializations containing persistent variables are not supported for fixed-point conversion. Consider rewriting your algorithm such that it does not use persistent variables within functions that require specialization.
Walter Roberson
Walter Roberson 2016 年 7 月 13 日
I would suggest breaking it up into two pieces, one of which constructs the ifft128 object, and the other of which expects that object to be always input.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePython Client Programming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by