Programmatically set StorageClass to ImportFromFile on signals

3 ビュー (過去 30 日間)
Tobias Johansson
Tobias Johansson 2023 年 3 月 3 日
回答済み: Jasvin 2023 年 3 月 6 日
Hi,
I'm porting some custom Matlab functions/scripts from 2018b to 2020b. These are used when generating C code from Simulink to an embedded target. I have a custom block in Simulink where I programmatically draw a line between an inport and Matlab Function block, and set its storage class to ImportFromFile:
set(lineHandle, 'SignalObjectPackage', 'mpt');
set(lineHandle, 'StorageClass', 'ImportFromFile (Custom)');
This code worked fine in 2018b. But in 2020b I get this error message:
"ImportFromFile" is not a valid storage class name for signals.
I have looked in the documentation but can't find any relevant information on why this is no longer working.
Best regards,

回答 (1 件)

Jasvin
Jasvin 2023 年 3 月 6 日
You can refer to the "Configure Code Generation Settings for Signals Programmatically” section in the below documentation link. It has detailed steps for achieving exactly what you are asking for in the R2020b version.

カテゴリ

Help Center および File ExchangeSimulink Coder についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by