Use of Evalin in matlab

for ii=1:1:5
xa(ii)=(2*ii+1)/4/pi*int(int(sin(thea)*dot([sin(thea)*cos(phia) sin(thea)*sin(phia) cos(thea)],vam)*evalin(symengine,'orthpoly::legendre(ii, cos(thea))'),thea,0,pi),phia,0,2*pi)
end
Here come the error Warning: Explicit integral could not be found. I think that is the function 'orthpoly::legendre' contains 'ii' which is the variable in 'for'. Is there any way to deal with 'ii' in evalin statement. Thanks

Réponses (1)

Azzi Abdelmalek
Azzi Abdelmalek le 9 Juin 2013

0 votes

evalin(symengine,sprintf('orthpoly::legendre(%d, cos(thea))',ii),thea,0,pi),phia,0,2*pi)

4 commentaires

Xin
Xin le 9 Juin 2013
Sorry to bother you. It doesn't work. Any other method? Thanks
Azzi Abdelmalek
Azzi Abdelmalek le 9 Juin 2013
What is your error messages
Xin
Xin le 9 Juin 2013
Modifié(e) : Xin le 9 Juin 2013
Error using mupadengine/evalin
Too many input arguments.
Thanks
feval(symengine, 'orthpoly::legendre', ii, cos(thea))

Connectez-vous pour commenter.

Catégories

En savoir plus sur Programming dans Centre d'aide et File Exchange

Question posée :

Xin
le 9 Juin 2013

Community Treasure Hunt

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

Start Hunting!

Translated by