jdhszh 发表于 2006-6-10 16:52:00

[分享]中误差计算小程序

;;由误差求中误差<br>
(defun c:jS(/ a m b aa)<br>
&nbsp;(setq a 0 m T b 0 AA 0)<br>
&nbsp;(while m<br>
&nbsp; (setq m(getreal "\输入:&lt;空回车结束&gt;"))<br>
&nbsp; (if m <br>
&nbsp;&nbsp; (progn<br>
&nbsp;&nbsp; (setq a(+ a (* m m)))<br>
&nbsp;&nbsp; (SETQ AA(+ AA M))<br>
&nbsp;&nbsp; (setq b(1+ b))<br>
&nbsp;&nbsp; )<br>
&nbsp; )<br>
&nbsp;)<br>
(setq pj(/ aa b))<br>
(setq x(sqrt (/ a (- b 1))))<br>
(alert (strcat "均差为:" (rtos pj 2 2) "\n中误差为:" (rtos x 2 2)))<br>
)

LONGXIN 发表于 2006-6-10 19:59:00

<P>(setq m(getreal "\输入:&lt;空回车结束&gt;"))改为:</P>
<P>(setq m(getdist "\输入:&lt;空回车结束&gt;"))</P>
<P>呢?</P>
页: [1]
查看完整版本: [分享]中误差计算小程序