声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 6132|回复: 11

[综合讨论] 求助 关于 integer too large in context的错误如何解决??

[复制链接]
发表于 2006-11-26 15:34 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
Matlab 算到一定步数之后出现错误“Error, (in type/matrix) integer too large in  contex"
请问如何解决?谢谢

本帖被以下淘专辑推荐:

回复
分享到:

使用道具 举报

发表于 2006-11-26 15:38 | 显示全部楼层
贴出错部分的源程序

[ 本帖最后由 ChaChing 于 2010-6-14 10:50 编辑 ]
 楼主| 发表于 2006-11-26 16:06 | 显示全部楼层
整个程序很长,我算前几步的时候都没有问题的,问题是为何到一定步数就出错?
发表于 2006-11-26 16:28 | 显示全部楼层
没有遇到过,不清楚;没有源代码,无法分析

[ 本帖最后由 ChaChing 于 2010-6-14 10:51 编辑 ]
发表于 2006-11-27 11:40 | 显示全部楼层
这个问题在mathworks上有解决方案

Subject:
Why do I receive the error message "Error, integer too large in context" while using the Symbolic Math Toolbox?

Problem Description:
The following example produces an error:

  1. I=sqrt(-1);
  2. j=0;
  3. for E=1000:0.01:1100,
  4. j=j+1;
  5. f(j)=zeta(0.5+I*E);
  6. end
复制代码


The error message I receive is:
??? Error using ==> maple
Error, integer too large in context

Error in ==> C:\MATLAB6p5\toolbox\symbolic\digits.m
On line 18 ==> r = eval(maple('Digits;'));

Error in ==> C:\MATLAB6p5\toolbox\symbolic\@sym\double.m
On line 16 ==> d = digits;

Error in ==> C:\MATLAB6p5\toolbox\symbolic\zeta.m
On line 10 ==> Z = double(zeta(sym(n)));

Error in ==> C:\MATLAB6p5\work\sven_aberg\test.m
On line 9 ==> f(j)=zeta(0.5+i*E);


Solution:
This may be a problem with the way memory management is performed by Maple. At present, the only potential workaround is to wrap your call to a symbolic calculation that operates on numbers with large numbers of digits inside a TRY/CATCH block and clear the Maple function using the following commands:

For Symbolic Math 2.1.3 (R13) and earlier:

  1. maple clear

  2. % or

  3. maple restart
复制代码


For Symbolic Math 3.0 (R13+) and later:

  1. clear maplemex
复制代码



Alternatively you may increase the frequency of automatic garbage
collections, which occurs (approximately) after every <integer>
words used in maple using the following command:

  1. maple('kernelopts(gcfreq=10000)');
复制代码



For further information on the use of this command type:

  1. mhelp kernelopts
复制代码

评分

1

查看全部评分

 楼主| 发表于 2006-11-29 08:40 | 显示全部楼层
非常感谢happy,现在问题已经解决了。
发表于 2010-12-15 08:54 | 显示全部楼层

楼主 上边的解决方案在程序里要怎么用啊?
发表于 2011-3-23 15:06 | 显示全部楼层
求帮助,我遇到同样的问题了
发表于 2011-3-23 23:29 | 显示全部楼层
回复 8 # mareszk 的帖子

5F不是提供解决方案了?
发表于 2011-3-24 15:45 | 显示全部楼层
回复 9 # ChaChing 的帖子

五楼的方法在我那里不好使啊
发表于 2012-11-21 15:47 | 显示全部楼层
这个问题怎么解决呀,求高手指点一下呀
发表于 2012-11-22 20:36 | 显示全部楼层
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-30 01:37 , Processed in 0.071078 second(s), 21 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表