Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
218 views
in Technique[技术] by (71.8m points)

function - Using Simulink Block in MATLAB

I want to use a Simulink Block (MATLAB Function) like a function in MATLAB. This means that I already have a complex Simulink Model and I just want to use some of the blocks of the Model in Matlab.

Example for the Simulink Model

question from:https://stackoverflow.com/questions/65886031/using-simulink-block-in-matlab

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

If you want to run a simulink model from MATLAB, use the command sim('YourSimulinkModel.slx'), And in your simulink model, use the block To Workspace (address: simulink/Sinks/To Workspace). to export the results of simulink model to the MATLAB Workspace after execution.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...