楼主: 卡福
1354 3

跪求高手帮忙改正程序,拜谢。 [推广有奖]

  • 0关注
  • 0粉丝

初中生

61%

还不是VIP/贵宾

-

威望
0
论坛币
4 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
151 点
帖子
7
精华
0
在线时间
15 小时
注册时间
2009-5-8
最后登录
2011-1-20

楼主
卡福 发表于 2009-12-29 00:40:21 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
67   proc iml;
NOTE: IML Ready
68   start newton;
69   a0=451-sum(a);
70   c0=1/a0+1/(902-a0);
71   do nrow=1 to 3;
72   ex=l[nrow]+log10(a0)+log10(n[nrow]-a[nrow])-log10(a[nrow])-log10(337-a0);
73   e[nrow]=ex;
74   c[nrow]=1/a[nrow]+1/(902-a[nrow]);
75   do ncol=1 to 3;
76   if nrow=ncol then
77   h[nrow,ncol]=c[nrow]+c0;
78   else h[nrow,ncol]=c0;
79   end;
80   a=a+inv(h)*e;
81   end;
82   finish newton;
NOTE: Module NEWTON defined.
83   do;
84   a={74,90,122};
85   n={167,186,212};
86   l={0.8,1.16,1.57};
87   run newton;
88   print a;
89   end;
ERROR: (execution) Matrix has not been set to a value.
operation : [ at line 73 column 2
operands  : E, NROW, EX

E      0 row       0 col     (type ?, size 0)

NROW      1 row       1 col     (numeric)
         1
EX      1 row       1 col     (numeric)
0.8812067
statement : ASSIGN at line 73 column 1
traceback : module NEWTON at line 73 column 1

NOTE: Paused in module NEWTON.
十分感谢。。。。

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:求高手 EXECUTION operation statement Statemen 程序 高手 帮忙 拜谢

沙发
pinggu2688 发表于 2009-12-29 00:50:04
学习了,期待高手回复

藤椅
gzjb 发表于 2009-12-29 08:00:43
Hi Guy,

There is two obvious errors caused by your putting statement "80   a=a+inv(h)*e;" in the wrong place. When codes was executed here, the e is just a numeric number NOT a vector, h was just assigned nrow TH row not a full 3 by 3 matrix.

If you can tell me the algorithm and your problem needed to be solved. I can  do it for you.

Happy Holiday and NEW YEAR.

Hope my reply is helpful for you.

Best,

板凳
gzjb 发表于 2009-12-29 09:26:12
Your algorithm is not clear. My guess:
71   do nrow=1 to 3;
72   ex=l[nrow]+log10(a0)+log10(n[nrow]-a[nrow])-log10(a[nrow])-log10(337-a0);
73   e[nrow]=ex;
just for vector e;

&&   do ncol=1 to 3;
76   if nrow=ncol then
77   h[nrow,ncol]=c[nrow]+c0;
78   else h[nrow,ncol]=c0;
79   end;

for matrix h,

80 in wrong place.

Strongly suggest use matrix operation to improve the efficience

No further suggestion before knowing what you want to do.  Your code looks a little weird. Sorry to say that.

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-24 19:19