How to convert .slx model to .m or .p or . mlx or .mex?

30 views (last 30 days)
I am using Library Compiler to cinvert a matlab model to Python.
But the model that I have is in .slx format and the App requires me .m or .p or . mlx or .mex
Is that any ways to use Library COmiler with .slx format?
or how to convert .slx to one of the following foramts (.m or .p or . mlx or .mex)?
  2 Comments
Ameer Hamza
Ameer Hamza on 19 Oct 2020
slx is a simulink model file. Why do you want to compile it to python library? How do you intend to use it?
Ro Os
Ro Os on 19 Oct 2020
Hi Ameer,
Thank you for your reply.
I want to convert this simulink model file .slx to a python code.
I tried to converted first to .c code by using Matlab Coder app and then to convert it to Python, but the converted .c code contains a lot of errors.
Is that any way to converted the simulink model .slx to a python code?

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 19 Oct 2020
You would need Simulink Coder, which would generate C or C++ code that you would call from Python.
  2 Comments
Ro Os
Ro Os on 19 Oct 2020
Hi Walter,
Thank you for your answer.
I have generated a c code using simulink coder, but the result contains a lot of errors, which the generated c code is not able to compile becasue of the errors.
is that any method of converting simulink model to a python code?
Walter Roberson
Walter Roberson on 19 Oct 2020
No, MATLAB does not provide any method of converting Simulink models to Python code. It also does not provide any method of converting Simulink models to .mex* or to dll's. MATLAB Compiler SDK is not usable for Simulink models.

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!