Error in ==> sym.sym>sym.double at 936 ; I want plot
Show older comments
hello everyone ,
I want find a maximum of z but it get error like :
??? 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.sym>sym.double at 936
Xstr = mupadmex('symobj::double', S.s, 0);
here is my code
syms E Eg V ;
z=[ ];
y=[ ];
x=[];
for Eg=0.5:0.05:1.3;
z=[];
a = quad( '(E.^2) ./ (exp(E./0.516)-1)', Eg , 100);
for V=0:0.05:Eg;
c=3 .*(10.^8); % m/s
h=4.1361e-015; % eV.s
k=8.62E-5;
Tc=300;
Pin = 1.4458e+026 ;
g = (E.^2) ./ (exp( (E - V) ./0.0258)-1) ;
b = double(int(g,Eg,100));
P = ( 2.*V./6.3682e-027 ) .* ( a - b ) /Pin;
z=[z P];
m=max(z);
end
y = [y m];
end
Eg=0.5:0.05:1.3;
plot(Eg,y)
title('Eg=0.5~1.3');
xlabel('Eg');
ylabel('η[max]');
If set b=0 , it getting a correct result , so I think b is the problem.
y=[y m] cant saving any data .
thanks every one :)
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!