Simulink MATLAB Function fully interpreted in MATLAB

조회 수: 3 (최근 30일)
Piotr Pawlowski
Piotr Pawlowski 2019년 8월 5일
댓글: Piotr Pawlowski 2019년 8월 8일
Hi, I have some problem with MATLAB Function Simulink block.
I added this block to my simulink model and provided three inputs. All I want to do is to process those inputs at fixed sample time (say 0.1s) and cook out some outputs, all within MATLAB. Simulink constantly shows errors with code generation, even simple functions like size(x). Is there any way to process input data from simulink signal fully on MATLAB?
Thanks in advance

채택된 답변

Jyotsna Talluri
Jyotsna Talluri 2019년 8월 8일
Hi,
Some functions are not supported in MATLAB function block. Instead you can use S function block in Simulink which can incorporate a MATLAB code. Inputs from Simulink are automatically passed to S-function. We can specify sample time in code itself.
To know about S-functions refer to the below link
  댓글 수: 1
Piotr Pawlowski
Piotr Pawlowski 2019년 8월 8일
Thanks very much. Just like I thought. I will give a shot to S-functions :)

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink Environment Customization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by