shrey
shrey

Reputation: 223

Laguerre polynomials in MATLAB

I tried using the .. command in MATLAB to generate Laguerre polynomials but I keep getting this error every time:

enter image description here

I found this in the help section: enter image description here

Since I have defined x as symbolic I shouldn't be getting this error.

Also on website I found this which says that the function does not run in MATLAB.enter image description here

Can anyone help? Thanks in advance

Upvotes: 1

Views: 1433

Answers (2)

horchler
horchler

Reputation: 18484

In R2014b+, there is a laguerreL function available directly from within Matlab. However, a version of this function was introduced to MuPAD in R2009a. You can call the MuPAD version from within Matlab

syms x;
feval(symengine,'laguerreL',2,x)

or

evalin(symengine,'laguerreL(2,x)')

Both return x^2/2 - 2*x + 1.

You can read more about interacting with MuPAD functionality from Matlab here. However, I'd recommend browsing and searching the archived documentation for your specific version or using your built-in HTML documentation (e.g., doc mupad or doc 'calling mupad').

Upvotes: 1

anquegi
anquegi

Reputation: 11522

Like you say, and the matlab help says this function only works inside mupad, maybe in later versions it works in matlab console.

If you want to use it, write mupad in Matlab Command window and then use it in the mupad, matlab will return you the result as I show in the picture

enter image description here

Upvotes: 2

Related Questions