How do i solve this error: Undefined operator '>' for input arguments of type 'timeseries'.
조회 수: 1 (최근 30일)
이전 댓글 표시
f1=0;
f2=0;
nb=8;
dt=0.000002;
bsf=50.89;
phi_do=4.7124;
k=6;
x=0.002;
ro=0.0179;
ri=0.0112;
slip=0.01;
wc=157.0796;
phi0=0;
Cdr=0.0012;
Cdi=7.4219e-04;
Cdo=4.5265e-04;
Cd=0.004;
c=5e-6;
kb=1.8978e+12;
for j=1:nb
phi=(2*pi*(j-1))/nb+wc*dt+phi0+(0.5-rand)*slip;
phis=bsf*dt+phi_do;
if j==k && phis>0 && phis<x/ro
b=1;
elseif j==k && phis>pi && phis<pi+x/ri
b=(Cdr+Cdi)/(Cdr-Cdo);
else
b=0;
end
d=(xs-xp)*cos(phi)+(ys-yp)*sin(phi)-c-b*Cd;
if d>0
gam=1;
else
gam=0;
end
f1=f1+gam*abs(d)^1.5*cos(phi);
f2=f2+gam*abs(d)^1.5*sin(phi);
fx=kb*f1;
fy=kb*f2;
댓글 수: 2
답변 (1개)
Jan
2019년 1월 8일
편집: Jan
2019년 1월 8일
The only places, where ">" occurs are:
phis>0, phis>pi, d>0
When I run your code, I get the error message, that xs is undefined. I guess, that you have defined it anywhere else as a timeseries object. The the error message will occur for d>0. If you post the complete error message instead of mentioning a short part only, it would be clear, where the problem occurs.
댓글 수: 2
Jan
2019년 1월 10일
Yes, Rk, these variables are defined elsewhere, but we cannot guess how they are defined. Obviously their type causes d to be a timeseries object, such that the >0 operation is not defined. Now it is your turn to find out, what is happening and what you want to achieve.
참고 항목
카테고리
Help Center 및 File Exchange에서 Time Series에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!