face error First input argument must be a function handle in symbolic integral

Hello. I have issue with taking integration of symbolic function. It will be my appreciate if you can help me.
syms l
syms z
L1=1-(3*(z^2)/(l^2))+(2*(z^3)/(l^3));
L2=z-(2*(z^2)/(l))+((z^3)/(l^2));
L3=(3*(z^2)/(l^2))-(2*(z^3)/(l^3));
L4=((z^3)/(l^2))-((z^2)/l);
L=[L1 L2 L3 L4];
LT=transpose(L);
f=(LT.*L);
K=integral(f,z,0,l)

 Accepted Answer

Try :
f=LT.*L
int(f,z,0,l)
Use int because variables are symbolic.

2 Comments

thanks for replying. My issue is with the integral section. I am facing with this error : First input argument must be a function handle. my code is:
syms l
syms z
L1=1-(3*(z^2)/(l^2))+(2*(z^3)/(l^3));
L2=z-(2*(z^2)/(l))+((z^3)/(l^2));
L3=(3*(z^2)/(l^2))-(2*(z^3)/(l^3));
L4=((z^3)/(l^2))-((z^2)/l);
L=[L1 L2 L3 L4];
LT=transpose(L);
f=(LT.*L);
K=integral(f,z,0,l)
You can’t use integral() when the limit is symbolic use int() as suggested.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!