A lot (or most or all?) of the configuration of a simulink file can be done programmatically. Is there a way to convert an existing simulink slx file into an m file that contains all (important) steps necessary to build the slx file? I do not care so much about the visual documentation that the simulink file inherently comes with (routing of signals, position of blocks). So, an m file containing all commands to build an slx file is enough for me. The advantage would be that one can more easily track the text-based m file in programs like git (I am aware that there are ways to track simulink files as well but I prefer text-based files).

 採用された回答

R
R 2024 年 4 月 19 日

0 投票

It is not possible to convert a .SLX file into a .M file directly. You can only generate C, C++, or HDL / VHDL from Simulink model using Simulink Coder.
The only way to achieve this is by programming the simulink model into a .M script manually.

3 件のコメント

Friedrich Tuttas
Friedrich Tuttas 2024 年 4 月 19 日
I know that I can do this manually. With my question, I mean to ask whether there is an automatic way of converting a simulink file into an m script that would create an identical simulink file.
R
R 2024 年 4 月 19 日
There's no method available for achieving this automatically as of now.
Friedrich Tuttas
Friedrich Tuttas 2024 年 4 月 19 日
That is unfortunate. Thanks for the answer, though!

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

その他の回答 (1 件)

Kiran Kintali
Kiran Kintali 2024 年 4 月 21 日

1 投票

Correction in the above thread / Accepted Ansswer.
Simulink Coder and embedded Coder products support C, C++ code generation from Simulink.
However, MATLAB Coder and HDL Coder products directly support code generation C, C++ and VHDL/Verilog/SystemVerilog directly from MATLAB without requiring to model your algorithm graphically in Simulink.

カテゴリ

ヘルプ センター および File ExchangeProgrammatic Model Editing についてさらに検索

製品

リリース

R2023a

質問済み:

2024 年 4 月 16 日

回答済み:

2024 年 4 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by