Clear Filters
Clear Filters

Hi how to insert .m file into .slx file ? Please help me with clear explaination

14 views (last 30 days)
I have a sample_1000kW.m file and I have to insert this in sample_1000kW.slx file both are in same location.
  1 Comment
Samhita
Samhita on 13 May 2018
Thanks for understanding my problem Walter, your explanation is very short, detail explanation is appreciated. I was able to create MATLAB function block but I couldn't call that file in Simulink.

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 29 Apr 2018
You cannot do that directly.
Rename the sample_1000kW.m and function to a name that does not match the name of your model, because invoking a model has a higher priority than calling a .m of the same name.
Then create a MATLAB Function Block, and have that MATLAB Function Block call your function.
  2 Comments
Samhita
Samhita on 2 May 2018
Thanks for understanding my problem, your explanation is very short so please explain in clear that how to create MATLAB function and then how to call that function in Simulink file.
Walter Roberson
Walter Roberson on 13 May 2018
To call a MATLAB Function Block in Simulink, connect it to an input source and to an output. Then run the model.

Sign in to comment.

More Answers (0)

Categories

Find more on Modeling in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!