error in my code

2 次查看(过去 30 天)
saivijayaramchowdary
回答: Jason R 2014-2-19
clc
clear all
i=0;
for h=0:0.2:3
l=h+0.2;
i=i+1;
H1(i)=h;
k0=0.5;
syms x ;
if l<=0.54
dsigmah(i)=((k0*3/0.5)*18*(x));
dt(i)=int(dsigmah(i),x,h,l);
dsl(i)=(dt(i)/(200000*0.003));
k=((0.5*(0.5-0.33))+ (11.43*dsl(i)*0.33))/((0.5-0.33)+(11.43*dsl(i)));
k0=k;
dsigmah(i)=((k0*3/0.5)*18*(x));
dtc(i)=int(dsigmah(i),x,h,l);
dg(i)=abs(dt(i)-dtc(i))
if ((dg(i)>0.001))
k0=k;
dsigmah(i)=((k0*3/0.5)*18*(x));
dt(i)=int(dsigmah(i),x,h,l);
dsl(i)=(dt(i)/(200000*0.003));
k=((0.5*(0.5-0.33))+ (11.43*dsl(i)*0.33))/((0.5-0.33)+(11.43*dsl(i)));
k0=k;
dsigmah(i)=((k0*3/0.5)*18*(x));
dtc(i)=int(dsigmah(i),x,h,l);
dg(i)=dt(i)-dtc(i);
end
end
end
it shows that
??? Error using ==> sym.sym>notimplemented at 2621 Function 'gt' is not implemented for MuPAD symbolic objects.
Error in ==> sym.sym>sym.gt at 801 notimplemented('gt');
Error in ==> Untitled5 at 20 if ((dg(i)>0.001))

回答(1 个)

Jason R
Jason R 2014-2-19
As far as I can tell, there is no symbolic greater than comparison. Replace dg(i) with subs(dg(i)) to allow the comparison to occur.

标签

尚未输入任何标签。

Community Treasure Hunt

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

Start Hunting!

Translated by