run m.file Same time with simulink

Hi.I created a m.file that define a variable resistor.I want to use this variable resistor in a simulink file in simpower system.my m.file is : if(current>160) R=log(current) else R=0 end 'current' is a signal in my simulink file.I need to run this m.file in Same time with my simulink.thus R can be a variable resistor in my simulink file.how can i do it?please help me.

답변 (1개)

Mischa Kim
Mischa Kim 2014년 2월 2일

0 개 추천

Hello behzad, check out Guy and Seth's blog on this topic.

댓글 수: 2

behzad
behzad 2014년 2월 3일
Hi Mischa.I saw this link.but in this topic,the parameters have a constant value.but in my project, 'R' is a function of current and changes continuously.
Mischa Kim
Mischa Kim 2014년 2월 3일
편집: Mischa Kim 2014년 2월 3일
I see. In this case you might want to use an embedded MATLAB function. In the Simulink library browser go to > Simulink > User-Defined Functions and select a MATLAB function block. Embedded MATLAB function are, as the name implies, automatically and directly integrated in(to) a Simulink model.

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

카테고리

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

태그

질문:

2014년 2월 2일

편집:

2014년 2월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by