| 查看: 234 | 回复: 2 | |||
| 当前主题已经存档。 | |||
| 【有奖交流】积极回复本帖子,参与交流,就有机会分得作者 tangtangtoy 的 1 个金币 | |||
tangtangtoy木虫 (小有名气)
|
[交流]
【求助】nzmax是对稀疏矩阵的内存扩充,如何人为修改?
|
||
|
nzmax总是对稀疏矩阵分配过大的空间,但在矩阵计算过程中,由于元素的增减,nzmax自动分配的空间过大。如: k=sparse(eye(8000)) k(:,3)=9 则此时 nzmax为 48000 |
» 猜你喜欢
全日制(定向)博士
已经有5人回复
假如你的研究生提出不合理要求
已经有10人回复
萌生出自己或许不适合搞科研的想法,现在跑or等等看?
已经有4人回复
Materials Today Chemistry审稿周期
已经有4人回复
参与限项
已经有3人回复
实验室接单子
已经有4人回复
对氯苯硼酸纯化
已经有3人回复
求助:我三月中下旬出站,青基依托单位怎么办?
已经有12人回复
所感
已经有4人回复
要不要辞职读博?
已经有7人回复

hitzhang
木虫 (正式写手)
- 仿真EPI: 1
- 应助: 0 (幼儿园)
- 贵宾: 2.15
- 金币: 1376.7
- 散金: 969
- 红花: 8
- 帖子: 862
- 在线: 226.4小时
- 虫号: 390575
- 注册: 2007-06-02
- 性别: GG
- 专业: 无机非金属类电介质与电解
★
tangtangtoy(金币+1,VIP+0):谢谢指教,不过我的意思是动态扩充,系统默认是原来大小的5倍,太大了点 9-3 07:59
tangtangtoy(金币+1,VIP+0):谢谢指教,不过我的意思是动态扩充,系统默认是原来大小的5倍,太大了点 9-3 07:59
|
spalloc Allocate space for sparse matrix Syntax S = spalloc(m,n,nzmax) Description S = spalloc(m,n,nzmax) creates an all zero sparse matrix S of size m-by-n with room to hold nzmax nonzeros. The matrix can then be generated column by column without requiring repeated storage allocation as the number of nonzeros grows. spalloc(m,n,nzmax) is shorthand for sparse([],[],[],m,n,nzmax) Examples To generate efficiently a sparse matrix that has an average of at most three nonzero elements per column S = spalloc(n,n,3*n); for j = 1:n S(:,j) = [zeros(n-3,1)' round(rand(3,1))']';end |
2楼2009-09-02 11:58:34

3楼2009-09-02 20:43:28












回复此楼