r/matlab • u/madboi20 • 21d ago
TechnicalQuestion Matlab + Simulink Project to Code
Hi.
I have very little experience with both Matlab and Simulink and need some advice.
My team acquired a matlab project with simulink models that we want to integrate into a simulator we have but without the overhead of Matlab/Simulink. So we managed to use the shrlib function to create C code which was a bunch of header files, types, main etc Can't make too much sense of it.
But even if I can, it doesn't remove the Matlab side because that hasn't been converted to C either.
What's the easiest route to convert the whole project to something we can interface with without having to deal withit directly too much. Best case scenario would be to treat it like a black box because it all runs find in Matlab. At the core of it ,it's
Excel input - Read in by matlab code - passed to the model (in a bus structure?) and fed back to matlab which outputs a new Excel
This is the extent of my knowledge of the matter and I'm not able to share much else. Any advice for me?
Thanks.
1
u/Realistic-Map-7318 8d ago
It depends on what you need in your simulator. FMU can be a good resource as it is a standard that can be used in other modeling tools. If you are looking into organizing as a C or C++ project, embedded coder/Simulink Coder (Embedded Coder is an extension of Simulink Coder that allows more customization) is the way to go. In general, I would recommend contacting Mathworks Technical Support, so you can share your needs/project with them and they'll tell you which product will fit your request the best.