Import multiple functions to Simulink

I would like to import multiple functions that I used in my workspace to simulink via the simin block.
Assume the functions are
y = x^2+x^4+3x+3
z = 3*y^2+x^6;
they were defined as follows
syms y x z
y = x^2+x^4+3x+3;
z = 3*y^2+x^6;
I want to use them in simulink, but I beleive they must be non-infinite values. How can I import their values, for instance, from 1 to 10 only?
TIA

답변 (1개)

Walter Roberson
Walter Roberson 2022년 10월 14일

0 개 추천

You cannot import those into Simulink. Those are not functions, those are symbolic expressions, but nothing in the symbolic toolbox is supported in Simulink.

댓글 수: 3

Adham Elkhouly
Adham Elkhouly 2022년 10월 14일
Thank you for you reply. Do you think I should define two matrices carrying the corresponding values from 1 to 10 and import them or is there a more elegant way to do it?
Walter Roberson
Walter Roberson 2022년 10월 14일
More "elegant" might be to use matlabFunction writing to a file and calling the file from a MATLAB function block.
Adham Elkhouly
Adham Elkhouly 2022년 10월 14일
Thank you for suggesting a more "elegant" way

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

카테고리

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

제품

릴리스

R2021b

질문:

2022년 10월 14일

댓글:

2022년 10월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by