Linking Simulink with m.file in MATLAB

Hi, I have the model of a power system in Simulink. I need to use some variable values in simulink to write down a linear programming (Linprog)in an m.file and use the results again in the Simulink. I know that I should extract the inputs used for the Linprog from simulink to workspace. Can anyone tell me how I should call those variables from workspace and how to return the results to Simulink?
Thanks Mitra

답변 (1개)

Kaustubha Govind
Kaustubha Govind 2013년 4월 29일

0 개 추천

You need to create a Simulink block that will execute your MATLAB code as part of the model. Please see the section MATLAB Function Blocks for a list of available options.

댓글 수: 1

mitra
mitra 2013년 5월 13일
Actually, the Simulink m.file block is not capable of addressing the optimization programming (linprog). As I heard, I need to generate a m.file outside the simulink environment and call the simulink variables. However, I don't know the details!!

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Modeling에 대해 자세히 알아보기

질문:

2013년 4월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by