"Double" inverting "symbolic"

1 view (last 30 days)
JUSTIN
JUSTIN on 24 Apr 2014
When I ran a simple exercise of integration of defined functions as below,
clear all;
syms z tau;
deltav=tau^(1/(3*z))-tau^(1/(4*z));
deltax=1/(0.5+12*z)*(tau^(1/(3*z))-tau^(1/(4*z)));
a=1;
b=9;
tau=0.5;
mu_vx=int(deltav*deltax,a,b);
mu_x2=int(deltax^2,a,b);
ratio=double(mu_vx/mu_x2);
I got error message from MATLAB by saying _ _ "??? 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."** _ _
So I plug in the expression of "deltav" and "deltax" in to integration, and run
clear all;
syms z tau;
deltav=tau^(1/(3*z))-tau^(1/(4*z));
deltax=1/(0.5+12*z)*(tau^(1/(3*z))-tau^(1/(4*z)));
a=1;
b=9;
tau=0.5;
mu_vx=int((tau^(1/(3*z))-tau^(1/(4*z)))*1/(0.5+12*z)*(tau^(1/(3*z))- tau^(1/(4*z))),a,b);
mu_x2=int((1/(0.5+12*z)*(tau^(1/(3*z))-tau^(1/(4*z))))^2,a,b);
ratio=double(mu_vx/mu_x2)
It works this time. I wonder how I should make the first way work without plugging the long expression. Thank you.

Answers (0)

Community Treasure Hunt

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

Start Hunting!