Hi, I have the following code
if true % code
endsyms h g x C n L p e E C mh = 1.0545718E-34g = 5.344285879E-28m = 9.10938356E-31E = h^2/8*m*L^2y = - (exp(-(x*(g*1i + (- 2*g^2 + E)^(1/2)))/h)*(g*1i - (- 2*g^2 + E)^(1/2)))/(2*(E - 2*g^2)^(1/2)) + (exp(-(x*(g*1i - (- 2*g^2 + E)^(1/2)))/h)*(g*1i + (- 2*g^2 + E)^(1/2)))/(2*(E - 2*g^2)^(1/2))z = - (exp(-(x*(g*(-i) + (- 2*g^2 + E)^(1/2)))/h)*(g*(-i) - (- 2*g^2 + E)^(1/2)))/(2*(E - 2*g^2)^(1/2)) + (exp(-(x*(g*(-i) - (- 2*g^2 + E)^(1/2)))/h)*(g*(-i) + (- 2*g^2 + E)^(1/2)))/(2*(E - 2*g^2)^(1/2))v = i*h*diff(z, x)S = y*zW = [int(S, 0, L)] % Operator check hermiticity
vpa(W) % vpa= Variable precision arithmetic, simplifies the large fractions to nunmbers
however the upper limit set to L is not accepted by MATLAB. Is there any chance of telling MATLAB to treat this as a constant?
Thanks
Best Answer