| 查看: 271 | 回复: 2 | |||
| 当前主题已经存档。 | |||
| 【有奖交流】积极回复本帖子,参与交流,就有机会分得作者 tangtangtoy 的 1 个金币 | |||
tangtangtoy木虫 (小有名气)
|
[交流]
【求助】nzmax是对稀疏矩阵的内存扩充,如何人为修改?
|
||
|
nzmax总是对稀疏矩阵分配过大的空间,但在矩阵计算过程中,由于元素的增减,nzmax自动分配的空间过大。如: k=sparse(eye(8000)) k(:,3)=9 则此时 nzmax为 48000 |
» 猜你喜欢
Sci. Bull. 悲剧经验
已经有4人回复
找博士生导师
已经有7人回复
上海大学实验技术岗位非升即走
已经有11人回复
评审有感
已经有15人回复
26/27申博自荐-锂/钠电池方向
已经有4人回复
同样的基金本子,换个专家直接从C变A!
已经有3人回复
别被青基扩招骗了!26年科研内卷才刚刚开始
已经有4人回复
26/27博士推荐
已经有4人回复
2026博士还有哪些学校有名额
已经有8人回复
云南大学材料与能源学院解琳课题组钙钛矿博士招生
已经有4人回复

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












回复此楼
20