How do I translate "rec" from MuPAD to MATLAB Symbolic Math Toolbox?

8 views (last 30 days)
If I use "convertMuPADNotebook" on a MuPAD file that contains the rec command, such as
rec(y(n + 2) = y(n + 1) + 4*y(n), y(n))
I see
%CODE TRANSLATION ISSUE 1 - aux1
%ERROR : Unable to translate calls to the function 'rec'.
aux1 = 'aux1Untranslated' % MuPAD code: rec(y(n + 2) = y(n + 1) + 4*y(n), y(n))
In the translated file.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 26 May 2022
Currently "convertMuPADNotebook" does not translate "rec" from MuPAD to MATLAB. This issue has been reported to development and may change in a future release. To achieve this workflow use 
syms y(n) z
assume(n>=0 & in(n, 'integer'))
f = y(n+2) - y(n+1) - 4 * y(n)
fZT = ztrans(f,n,z)
syms yZT
fZT = subs(fZT,ztrans(y(n),n,z),yZT)
yZT = solve(fZT, yZT)
ySol = iztrans(yZT,z,n);
ySol = simplify(ySol)
ySol1 = simplify(subs(ySol,[y(0) y(1)], [0 1]))

More Answers (0)

Tags

No tags entered yet.

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!