How to convert C code to SImulink Model

8 ビュー (過去 30 日間)
deepika ravi
deepika ravi 2020 年 9 月 8 日
コメント済み: Walter Roberson 2020 年 9 月 9 日
I have a C Code for each model for our project.Can it be converted to Simulink Model automatically in Matlab or Should I use any functions for it?

回答 (1 件)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2020 年 9 月 8 日
Yes, it is feasible with some restrictions. You'd need to convert to S-functions.
  2 件のコメント
deepika ravi
deepika ravi 2020 年 9 月 9 日
Can i able to get the exact simulink model, or only an function block of the c code
Walter Roberson
Walter Roberson 2020 年 9 月 9 日
You get a function block that can call the C code.
I do not know of any program that can translate C into equivalent MATLAB or Simulink -- at least that does not cheat by using the Simulink ability to inject C code.
C uses pointers a lot, and there are a lot of C data structures that would require that handle classes be generated for them. For example a simple linked list in C would require a handle class be generated because MATLAB does not have pointers.

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

カテゴリ

Help Center および File ExchangeEvent Functions についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by