Integration error while running a script in Matlab 2015

I am using matlab 2015 and while running the following script file I am getting error: error in sym/subsref(line 771) R_title = ......
please help!
%%%%Script%%%%%
clear all; close all; clc
syms x g L R EIo rho Ao xc mR
psi=(x/L)^2
dpsi=diff(psi,x);
ddpsi=diff(dpsi,x);
xc=0.8*L
me=int((rho*Ao(1-(0.5*x)/L))*(psi)^2,x,0,L)+mR*subs(psi,x,xc);
ke=int(EIo*(1-(0.2*((x/L)^2)))*ddpsi^2,x,0,L)
kg=int(mR*g*(dpsi)^2,x,0,L)
Qv=int((pt*(x/L))*psi,x,0,L)

 採用された回答

Ameer Hamza
Ameer Hamza 2020 年 10 月 22 日
編集済み: Ameer Hamza 2020 年 10 月 22 日

0 投票

me=int((rho*Ao*(1-(0.5*x)/L))*(psi)^2,x,0,L)+mR*subs(psi,x,xc);
% ^ insert * here. It is missing in your code

4 件のコメント

Sadia
Sadia 2020 年 10 月 23 日
Even doing that its still giving error, same code is running well in matlab 2018.
Walter Roberson
Walter Roberson 2020 年 10 月 23 日
Your code starts with clear all so we know that there cannot possibly be any variables in the workspace that are left over from the previous run.
Your code uses
Qv=int((pt*(x/L))*psi,x,0,L)
pt is not a variable in the code and is not any Mathworks function.
If your code ran properly in R2018a then we must conclude that somewhere on your MATLAB path, you have a pt.m function that is happy to run with no input variables, and returns either a numeric value or a symbolic value. You will need to provide the code for your pt.m for us to test with.
Sadia
Sadia 2020 年 10 月 24 日
Thank you Mr. Walter Roberson for such clear explanation. I think the person I asked to run this code in his computer has made pt as veriable but my matlab is still giving error. So i am thinking to install latest version.
Ameer Hamza
Ameer Hamza 2020 年 10 月 24 日
Have you defined pt as variable on your computer?

サインインしてコメントする。

その他の回答 (0 件)

質問済み:

2020 年 10 月 22 日

コメント済み:

2020 年 10 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by