Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Calling a function in Simulink from Matlab

조회 수: 1 (최근 30일)
Vicente
Vicente 2015년 5월 3일
마감: MATLAB Answer Bot 2021년 8월 20일
Is it possible to define a function in an .m file, and then have it be called by any given Simulink block? Is it possible to create a user defined Simulink block containing the function written in the .m file? How could it be done? I have a .m file defining properties and functions that I would like to call in Simulink, and that was first intended to be called as a real time simulation, and signal processing. How can I make a real time simulation by defining some functions in Matlab and having them called in by some customized Simulink block?
Thank you.

답변 (1개)

KL
KL 2015년 5월 3일
편집: KL 2015년 5월 3일
This is what you're looking for?
  댓글 수: 1
Vicente
Vicente 2015년 5월 3일
This block you have shown me was what me and my friend tried using, but Simulink just appeared not to be able to process the .m file we created. It is a object oriented .m file that specified a series of constants and mathematical functions to our model. In pure Matlab environment, the code was working perfectly, but when we tried creating a custom block out of it, Simulink just wouldn't accept an object oriented .m file as input, and wouldn't call our functions. The last thing we are trying right now is this:
but we don't know if is there any way to come around this problem. Also, this was our last question to the community, which never received an answer:
Thank you for your assistance.

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by