Fixed point tool conversion

1 回表示 (過去 30 日間)
Giuseppe Galioto
Giuseppe Galioto 2019 年 12 月 21 日
回答済み: stozaki 2020 年 1 月 17 日
Hi there,
How can I convert just a subsystem and not the entire model with the fixed point tool?
The tool, when I try to simulate, converts the overall system in fixed point, which is not my purpose.
Thanks in advance

回答 (2 件)

Asvin Kumar
Asvin Kumar 2019 年 12 月 26 日
You can convert a particular subsystem to Fixed Point by selecting it under System Under Design while preparing the system. Check out the example at https://www.mathworks.com/help/releases/R2018a/fixedpoint/ug/tutorial-steps.html#bs4b8ai for more details.
  3 件のコメント
Asvin Kumar
Asvin Kumar 2020 年 1 月 6 日
I see. Is there any way you know to reproduce this issue? So that I can check it out on my end. Or anyone else from the community can confirm.
Evangelos Denaxas
Evangelos Denaxas 2020 年 1 月 15 日
What could be happening here is that fixed-point leaks out from the system under design by following data type propagation rules. So things that outside your system under design are not "converted" per se but rather propagating the data types they get as input. In order to avoid any of these unexpected issues you may want to properly isolate your system under design with a block called "data type converter". If you put one of these blocks to each line going in and out of your SUD then you'll minimize the chances of fixed-point trickling outside your system.

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


stozaki
stozaki 2020 年 1 月 17 日
Please try following script.
model = 'modelName'; % define your model name
sud = [model '/sud']; % define system under design as sybsystem block path
opt = fxpOptimizationOptions(); % Specify options for data type optimization
allowableWL = (10:20); % set allow word length
opt.AllowableWordLengths = allowableWL;
tol = 0.1; % define tolerance
opt.addTolerance([model '/diff'], 1, 'AbsTol', tol); % set tolerance
opt.addTolerance([model '/diff'], 2, 'AbsTol', tol); % set tolerance
opt.UseParallel = false;
optRes = fxpopt(model, sud, opt); % execute
Regards,
Shuhei

カテゴリ

Help Center および File ExchangeFixed-Point Designer についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by