Why the interpreted MATLAB function block is giving a different result from the Fcn block ?????

조회 수: 5 (최근 30일)
Hi everyone,
I used the same mathematical expression to perform a calculation using the interpreted MATLAB function block and the Fcn block.
As you will see in the model, which is attached to this question, the two results are completely different.
Can someone give me an explanation to this ? Which is the correct one of the two results ?.
Thank you very much in advance.

채택된 답변

Swarooph
Swarooph 2016년 9월 9일
When I run your model, I get 2 warnings as follows:
You can see that the outputs of the functions are complex. Fcn block as far as I know doesn't support complex input/output signals (only real numbers). Although I have to say the documentation doesn't explicitly say that. the interpreted Matlab function does allow for output to be complex. You can set that using the Output signal type option discussed here .
  댓글 수: 1
kamal kiki
kamal kiki 2016년 9월 9일
I took your advice and I have changed the type of the signal output to complex in the interpreted Matlab function block. Now the result given by the interpreted Matlab function is a complex number of which the imaginary part is the absolute value of the result given by the Fcn block.
Thank you very much Swarooph.

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by