Using Simulink from .m file
Show older comments
I have my whole code written in a gigantic .m file. In a certain process I am doing in my code, I want to call this block (shown in picture) and give it "F" and "Ma" and take its outputs back from simulink to my code's workspace. I am struggling to do this correctly and the sim command page is poorly written to help me with this. Any help is appreciated.

6 Comments
Paul
on 16 Jan 2023
Hi Ali,
Are the blocks for F and Ma both Constant blocks? If so, what is their respective "Constant value" fields? If not, what are those blocks?
Ali Almakhmari
on 16 Jan 2023
Edited: Ali Almakhmari
on 16 Jan 2023
Paul
on 16 Jan 2023
Yes, I understand what your're doing (I assume you have a good reason for doing step 3 in the .m file instead of in the simulation itself). To help you solve the problem, I'd need to know:
Are the blocks for F and Ma both Constant blocks? If so, what is their respective "Constant value" fields? If not, what are those blocks?
Ali Almakhmari
on 16 Jan 2023
I'm not asking about the values, I'm asking about the blocks themselves. Can you double click on each block and post a screenshot of the block parameters window that pops up for each? Image files can be uploaded using either the paperclip icon or the image icon (to the left of link icon) in the Insert menu.
Ali Almakhmari
on 17 Jan 2023
Accepted Answer
More Answers (0)
Categories
Find more on Simulink Environment Customization 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!