zhuningyuan126 发表于 2011-7-3 12:51:41

矩阵溢出;matlab矩阵的最大容量是多少?

在定义矩阵的时候出现了out of memory。像a(n,n),这个n最大取多大如果要实现b=a\u,能实现分块运算么?怎么分?

messenger 发表于 2011-7-3 13:17:09

matlab矩阵的最大容量,与你电脑的内存有关,与Matlab本身无关

zhuningyuan126 发表于 2011-7-3 14:50:08

:'( ,我已经尝试过修改虚拟内存了,现在我的矩阵定义只能定义到8000x8000,与我要求的差很远啊。

lengyunfeng 发表于 2011-7-3 20:03:42

rockwoods老师的《matlab高效编程技巧与应用25个案例分析》这本书里有一张专门说如何处理海量数据的方法,可用的办法比较多,可以参考一下,但最好从硬件或者编程思路上解决这个问题。

feynmand 发表于 2011-7-3 21:47:16

我记得理想情况下单个变量最大只能是1g,你要根据自己的数据个数,你这个8000×8000好像是512m。
单个变量也受内存碎片的影响,clear或者重启一下matlab会有好处。
32位操作系统matlab能够利用的内存应该是2g多,你可以考虑将数据分块,分别来进行计算。

zhuningyuan126 发表于 2011-7-4 08:10:17

5# feynmand
重启matlab我也是经常用的,我觉得还是应该从编程思路上想,才能有较大的收获。现在有个分行计算的想法,先试试。

zhuningyuan126 发表于 2011-7-4 08:11:14

4# lengyunfeng
嗯,我也想从编程思路上下功夫会比较好。

feynmand 发表于 2011-7-4 11:26:11

32位Windows操作系统有3gb开关
Using the 3GB Switch on Windows Systems

Microsoft Windows XP systems can allocate 3 GB (instead of the default 2 GB) to processes, if you set an appropriate switch in the boot.ini file of the system. MathWorks recommends that you only do this with Windows XP SP2 systems or later. This gives an extra 1 GB of virtual memory to MATLAB, not contiguous with the rest of the memory. This enables you to store more data, but not larger arrays, as these are limited by contiguous space. This is mostly beneficial if you have enough RAM (e.g., 3 or 4 GB) to use it.

After setting the switch, confirm the new value of the virtual memory after restarting your computer and using the memory function.

= memory;

systemview.VirtualAddressSpace
ans =
Available: 1.6727e+009   % Virtual memory available to MATLAB.
      Total: 2.1474e+009   % Total virtual memory

For more documentation on this option, use the following URL:

http://support.microsoft.com/support/kb/articles/Q291/9/88.ASP

Similarly, on machines running Microsoft Windows Vista, you can achieve the same effect by using the command:

BCDEdit /set increaseuserva 3072

For more documentation on this option, use the following URL:

http://msdn2.microsoft.com/en-us/library/aa906211.aspx

zhuningyuan126 发表于 2011-7-4 16:44:13

8# feynmand
:'(    Think you!

diu99 发表于 2011-7-20 03:48:07

试试稀疏矩阵

liuyalong008 发表于 2011-7-20 10:14:39

改为single试试
实在不行就分块好了
页: [1]
查看完整版本: 矩阵溢出;matlab矩阵的最大容量是多少?