How to convert C code to SImulink Model
17 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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?
0 comentarios
Respuestas (1)
Sulaymon Eshkabilov
el 8 de Sept. de 2020
Yes, it is feasible with some restrictions. You'd need to convert to S-functions.
Here are some docs: https://in.mathworks.com/help/simulink/sfg/s-function-examples.html
2 comentarios
Walter Roberson
el 9 de Sept. de 2020
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.
Ver también
Categorías
Más información sobre Event Functions en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!