Conversion to char from logical is not possible.
31 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Ludovico Iannizzotto
le 29 Mar 2020
Commenté : Ludovico Iannizzotto
le 29 Mar 2020
Hi,
I am trying to solve the following integral with MATLAB_R2019b.
I= @(x)((x.^(3).*exp(-x))/(x.^(3)+D(i))), ['ArrayValued';true];
L = integral(I,0,Inf);
but I get the following error:
I =
function_handle with value:
@(x)((x.^(3).*exp(-x))/(x.^(3)+D(i)))
Error using vertcat
The following error occurred converting from logical to char:
Conversion to char from logical is not possible.
Error in untitled3 (line 6)
I= @(x)((x.^(3).*exp(-x))/(x.^(3)+D(i))), ['ArrayValued';true];
Can someone help? Thank you.
2 commentaires
Rik
le 29 Mar 2020
It looks like ['ArrayValued';true] is executed separately from the rest. It is also unclear to me what this code is supposed to be doing.
Réponse acceptée
Rik
le 29 Mar 2020
You need to pass the option as a parameter to the integral function instead of defining it earlier.
I= @(x)((x.^(3).*exp(-x))/(x.^(3)+D(i)));
L = integral(I,0,Inf, 'ArrayValued';true);
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!