求高手指导一下,下边是我的代码:
T2<-function(AB)
{if (sqrt(sum(AB^2))>l0)
{T=e*pi*d2^2/4*(sqrt(sum(AB^2))-l0)/l0
T2x=T*cos(theta(AB,e1))
T2y=T*cos(theta(AB,e2))
T2z=T*cos(theta(AB,e3))
}
else
{T=0
T2x=0
T2y=0
T2z=0
}
Txyz=c(T2x,T2y,T2z)
return(Txyz)
}
下边是显示的错误提示:
Error in if (sqrt(sum(AB^2))>l0) {:
需要TRUE/FALSE值的地方不可以用缺少值
在写毕业论文,所以很着急,望高手指导,不胜感激!
file:///C:\Users\shen\AppData\Roaming\Tencent\Users\850895054\QQ\WinTemp\RichOle\FWJ%AOQL4IG4)BK`I~ETYY0.png
|