| 查看: 329 | 回复: 2 | |||
| 当前主题已经存档。 | |||
| 【有奖交流】积极回复本帖子,参与交流,就有机会分得作者 tangtangtoy 的 1 个金币 | |||
tangtangtoy木虫 (小有名气)
|
[交流]
【求助】nzmax是对稀疏矩阵的内存扩充,如何人为修改?
|
||
|
nzmax总是对稀疏矩阵分配过大的空间,但在矩阵计算过程中,由于元素的增减,nzmax自动分配的空间过大。如: k=sparse(eye(8000)) k(:,3)=9 则此时 nzmax为 48000 |
» 猜你喜欢
有多少人是今天查系统知道结果的?
已经有19人回复
国社科又开始会评了,不知道这次命运如何
已经有9人回复
能否申诉?
已经有5人回复
为什么到现在没收到通知?
已经有5人回复
有没有仍没收到信息的
已经有8人回复
面上意见出来了
已经有18人回复
找导师
已经有7人回复
29号明天会评吗
已经有3人回复
麻烦专家们看看评委们的意见(F口面上)
已经有11人回复
我就是申请一个面上项目而已,这评审意见是按照杰青的条件评的吧?
已经有11人回复

hitzhang
木虫 (正式写手)
- 仿真EPI: 1
- 应助: 0 (幼儿园)
- 贵宾: 2.15
- 金币: 1356.7
- 散金: 969
- 红花: 8
- 帖子: 863
- 在线: 226.5小时
- 虫号: 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









回复此楼
30