how i can use symbolic variables in embeded matlab block in simulink?

I want to find definite integral of an exponential function in simulink. I have performed this task in matlab .m file. as
syms y f=exp((-y.^2)/2); F=int(f); Fb=subs(F,'y',Inf); Fa=subs(F,'y',sqrt(SNR)); def=Fb-Fa; out=def*(1/sqrt(2*pi)) now i am trying to run this code in embeded matlab function in a simulink file as user defined function.Simulink model is giving me this error "Command-duality is not supported. Function 'Embedded MATLAB Function' (#148.30.37), line 3, column 1: "syms y""
please help me out in declaring symbolic variable in simulink file.

 채택된 답변

Friedrich
Friedrich 2013년 4월 11일
편집: Friedrich 2013년 4월 11일
Hi,
try at the top
coder.extrinsic('syms')
Maybe you also need to do that with subds, int exp etc.

댓글 수: 2

Undefined function or variable 'coder'.
Seems like you are using an older version of MATLAB. Try
eml.extrinsic
instead.

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by