由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Computation版 - 请教:Matlab中要处理的矩阵太大怎么办?
相关主题
[求教]请各位推荐解大型矩阵的子程序 (转载)matlab解方程组的问题。
[合集] 请教一个大规模且系数矩阵病态的方程组的求解我的matlab内存太小了?
[help]should I switch from Matlab to C?大家是怎么在MATLAB里读入矩阵的?
问一个MATLAB数值精确度的问题[合集] linear system的奇怪问题
请教:如何用least square approach解超定方程组请推荐一个处理sparse matrix SVD的java library
请教一个matlab问题fortran里矩阵传递有维数限制吗?
问一个提高matlab计算速度的问题![合集] 请教稀疏矩阵相加的算法
求救: 怎样有效的计算5000x5000的线型方程组?dense matrix、sparse matrix
相关话题的讨论汇总
话题: matlab话题: 矩阵话题: ram话题: pinv话题: svds
进入Computation版参与讨论
1 (共1页)
j********3
发帖数: 560
1
我原来用sparse来生成大矩阵,做奇异值分解的时候要用svds命令,但是svds本身调用
了zeros函数,这时程序提示
"Product of dimensions is greater than maximum integer."
或者有时候就是"out of memory"。请问碰到这种情况应该怎么办呢?
我最初的目的是要求解线性方程组,但是所要求解的线性方程组的系数矩阵接近奇异,
在版上求教之后得各位大虾指点,使用pinv函数得到了较好的结果。但是之后当所要处
理的系数矩阵增大(至大约2000×2000)时,程序提示"out of memory"。后使用
sparse命令代替zeros命令生成矩阵,但是却无法使用pinv,因为pinv本身调用的是svd
函数做奇异值分解,而对于sparse方式存储的矩阵,要使用svds命令。于是我就自己写
code用svds命令做奇异值分解,但是发现svds本身也用到了zeros来生成零矩阵,这样
,我就没有办法再进行下去了,因为我总不能将我要用的matlab自带函数都重新写一遍
。再次来版上求助,多谢各位大虾了。
a****e
发帖数: 16
2
如果是out of memory的话你可以试试在boot.ini中加上 /3GB (我是winXP)这样
matlab就可以使用更大得虚拟内存,我曾经svd大矩阵时用过,很有效。
但不是所有版本的windows都可以用这个 /3GB开关,你可以试试。

svd

【在 j********3 的大作中提到】
: 我原来用sparse来生成大矩阵,做奇异值分解的时候要用svds命令,但是svds本身调用
: 了zeros函数,这时程序提示
: "Product of dimensions is greater than maximum integer."
: 或者有时候就是"out of memory"。请问碰到这种情况应该怎么办呢?
: 我最初的目的是要求解线性方程组,但是所要求解的线性方程组的系数矩阵接近奇异,
: 在版上求教之后得各位大虾指点,使用pinv函数得到了较好的结果。但是之后当所要处
: 理的系数矩阵增大(至大约2000×2000)时,程序提示"out of memory"。后使用
: sparse命令代替zeros命令生成矩阵,但是却无法使用pinv,因为pinv本身调用的是svd
: 函数做奇异值分解,而对于sparse方式存储的矩阵,要使用svds命令。于是我就自己写
: code用svds命令做奇异值分解,但是发现svds本身也用到了zeros来生成零矩阵,这样

s***t
发帖数: 195
3
how much ram do you have?

svd

【在 j********3 的大作中提到】
: 我原来用sparse来生成大矩阵,做奇异值分解的时候要用svds命令,但是svds本身调用
: 了zeros函数,这时程序提示
: "Product of dimensions is greater than maximum integer."
: 或者有时候就是"out of memory"。请问碰到这种情况应该怎么办呢?
: 我最初的目的是要求解线性方程组,但是所要求解的线性方程组的系数矩阵接近奇异,
: 在版上求教之后得各位大虾指点,使用pinv函数得到了较好的结果。但是之后当所要处
: 理的系数矩阵增大(至大约2000×2000)时,程序提示"out of memory"。后使用
: sparse命令代替zeros命令生成矩阵,但是却无法使用pinv,因为pinv本身调用的是svd
: 函数做奇异值分解,而对于sparse方式存储的矩阵,要使用svds命令。于是我就自己写
: code用svds命令做奇异值分解,但是发现svds本身也用到了zeros来生成零矩阵,这样

j********3
发帖数: 560
4
1 GB. I don't know whether it is large enough.
What if I need to deal with a matrix of 400,000*400,000.
Thank you.

【在 s***t 的大作中提到】
: how much ram do you have?
:
: svd

j********3
发帖数: 560
5
回头试试,多谢你了。

【在 a****e 的大作中提到】
: 如果是out of memory的话你可以试试在boot.ini中加上 /3GB (我是winXP)这样
: matlab就可以使用更大得虚拟内存,我曾经svd大矩阵时用过,很有效。
: 但不是所有版本的windows都可以用这个 /3GB开关,你可以试试。
:
: svd

s***t
发帖数: 195
6
it's kind of strange to me that with 1GB ram, you can't handle
pinv of a 2000x2000. i just tried my laptop. 0.98G ram, no problem
pinv a 2000x2000.

【在 j********3 的大作中提到】
: 1 GB. I don't know whether it is large enough.
: What if I need to deal with a matrix of 400,000*400,000.
: Thank you.

l*****a
发帖数: 119
7
try some sparse sovler instead of matlab, like HSL, SparLAPACK
j********3
发帖数: 560
8
Thank you for the reply. Actually it's not really 2000*2000, it's 4000*4000.

【在 s***t 的大作中提到】
: it's kind of strange to me that with 1GB ram, you can't handle
: pinv of a 2000x2000. i just tried my laptop. 0.98G ram, no problem
: pinv a 2000x2000.

j********3
发帖数: 560
9
Thank you for the reply. But what are HSL and SparLAPACK? I googled them,
but google can not find any webpage related to SparLAPACK, and the pages it
found about HSL are definitely not the one you mentioned, which are related
to some color space staffes.

【在 l*****a 的大作中提到】
: try some sparse sovler instead of matlab, like HSL, SparLAPACK
l******n
发帖数: 9344
10
packages used to do computation

it
related

【在 j********3 的大作中提到】
: Thank you for the reply. But what are HSL and SparLAPACK? I googled them,
: but google can not find any webpage related to SparLAPACK, and the pages it
: found about HSL are definitely not the one you mentioned, which are related
: to some color space staffes.

s*****o
发帖数: 26
11
I meet the same problem when I run lhsdesign(20000, 12) command for latin
hypercube sampling. I run it with Matlab 2006a in Linux. The computer has 8G
RAM, but I still got "out of memory" problem. I switched to another windows
XP PC, which has 3G RAM, when I run lhsdesign(10000, 12), the error message
"out of memory" appeared too. I monitored the memory usage, when the
program used 1.5 G RAM, the error message comed out.
Does Matlab have a limitation for the maximum usage of memory?

svd

【在 j********3 的大作中提到】
: 我原来用sparse来生成大矩阵,做奇异值分解的时候要用svds命令,但是svds本身调用
: 了zeros函数,这时程序提示
: "Product of dimensions is greater than maximum integer."
: 或者有时候就是"out of memory"。请问碰到这种情况应该怎么办呢?
: 我最初的目的是要求解线性方程组,但是所要求解的线性方程组的系数矩阵接近奇异,
: 在版上求教之后得各位大虾指点,使用pinv函数得到了较好的结果。但是之后当所要处
: 理的系数矩阵增大(至大约2000×2000)时,程序提示"out of memory"。后使用
: sparse命令代替zeros命令生成矩阵,但是却无法使用pinv,因为pinv本身调用的是svd
: 函数做奇异值分解,而对于sparse方式存储的矩阵,要使用svds命令。于是我就自己写
: code用svds命令做奇异值分解,但是发现svds本身也用到了zeros来生成零矩阵,这样

j**u
发帖数: 6059
12

8G
windows
message
这是个老问题了,请看下面的解释。
http://www.mathworks.com/support/tech-notes/1100/1106.html

【在 s*****o 的大作中提到】
: I meet the same problem when I run lhsdesign(20000, 12) command for latin
: hypercube sampling. I run it with Matlab 2006a in Linux. The computer has 8G
: RAM, but I still got "out of memory" problem. I switched to another windows
: XP PC, which has 3G RAM, when I run lhsdesign(10000, 12), the error message
: "out of memory" appeared too. I monitored the memory usage, when the
: program used 1.5 G RAM, the error message comed out.
: Does Matlab have a limitation for the maximum usage of memory?
:
: svd

1 (共1页)
进入Computation版参与讨论
相关主题
dense matrix、sparse matrix请教:如何用least square approach解超定方程组
求矩阵逆的算法请教一个matlab问题
[合集] 解n元一次方程组(或者算n维矩阵的行列式)有什么好的算法么?问一个提高matlab计算速度的问题!
sensitivity analysis的H 矩阵奇异求救: 怎样有效的计算5000x5000的线型方程组?
[求教]请各位推荐解大型矩阵的子程序 (转载)matlab解方程组的问题。
[合集] 请教一个大规模且系数矩阵病态的方程组的求解我的matlab内存太小了?
[help]should I switch from Matlab to C?大家是怎么在MATLAB里读入矩阵的?
问一个MATLAB数值精确度的问题[合集] linear system的奇怪问题
相关话题的讨论汇总
话题: matlab话题: 矩阵话题: ram话题: pinv话题: svds