help using sparse matrix
1 次查看(过去 30 天)
显示 更早的评论
i have a big matrix 10e3x10e3 with small values 1e-10,1e-2,to save memory and speed i need the sparse function to not only ignore the zero elements but also those very small elements in the range (1e-10,1e-2) is it possible?
0 个评论
采纳的回答
the cyclist
2014-2-12
编辑:the cyclist
2014-2-12
You could preprocess your matrix with a step like
M(abs(M)<1.e-2) = 0;
and then make it sparse.
0 个评论
更多回答(1 个)
Kobi
2014-2-13
2 个评论
Jos (10584)
2014-2-13
The expression " a(abs(a)<1.e-2) " selects those elements from a that have an absolute value smaller than 1e-2. You do not want to select them, but set those elements to a zero
a(abs(a)<1e-2) = 0
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!