Why do I get an error when converting certain definite integrals to double data types in Symbolic Math Toolbox 5.6 (R2011b)?
Show older comments
I am evaluating an integral in the range [0..1], which cannot be determined analytically by the Symbolic Math Toolbox. Because of this, I am converting the result to a double data type. This only works with one of two expressions, so I have to use the VPA function for the second one.
Why is this the case? Is this a bug or expected behavior?
The steps I took were as follows:
syms x
workingCase = int( exp(sin(x)) , 0 , 1 );
double(workingCase)
Warning: Explicit integral could not be found.
ans = 1.6319
syms x
faultyCase = int( exp(sin(x)^(1/2)) , 0, 1 );
double(faultyCase)
Warning: Explicit integral could not be found.
Error using mupadmex
Error in MuPAD command: DOUBLE cannot convert the input expression into a double array.
If the input expression contains a symbolic variable, use the VPA function instead.
Error in sym/double (line 936)
Xstr = mupadmex('symobj::double', S.s, 0);
>> vpa(faultyCase)
ans = 1.9442688791385811674662257610601
Accepted Answer
More Answers (0)
Categories
Find more on Conversion in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!