f1=@(x) (2*pi*(3*10^-8)^2*(6.625*10^-34)/(x^5.*(exp((3*10^-8*6.625*10^-34)/(x*1.38*10^-23*5800))-1)));
E1=integral(f1,0.1,0.4);
What's wrong with it?
Error using ^ (line 51)
Incorrect dimensions for raising a matrix to a power. Check that the matrix is square and the power is a scalar. To perform
elementwise matrix powers, use '.^'.
Error in ENE527HW2>@(x)(2*pi*(3*10^-8)^2*(6.625*10^-34)/(x^5.*(exp((3*10^-8*6.625*10^-34)/(x*1.38*10^-23*5800))-1))) (line 13)
f1=@(x) (2*pi*(3*10^-8)^2*(6.625*10^-34)/(x^5.*(exp((3*10^-8*6.625*10^-34)/(x*1.38*10^-23*5800))-1)));
Error in integralCalc/iterateScalarValued (line 314)
fx = FUN(t);
Error in integralCalc/vadapt (line 132)
[q,errbnd] = iterateScalarValued(u,tinterval,pathlen);
Error in integralCalc (line 75)
[q,errbnd] = vadapt(@AtoBInvTransform,interval);
Error in integral (line 88)
Q = integralCalc(fun,a,b,opstruct);
Error in ENE527HW2 (line 15)
E1=integral(f1,0.1,0.4);
Best Answer