More Efficient Assignment Operation - Sparse Matrix

For somebody used to dealing with large sparse matrices, there should be a more efficient way of carrying out such an assignment operation. Probably a pretty simple solution but I have little experience with sparse-matrix syntax.
A = sparse(20000,60000); A(10001:end,20001:50000) = ([speye(10000,10000),-speye(10000,10000),speye(10000,10000)]);
I have a large sparse matrix for which I am attempting to assign certain segments (simplified example as per below snippet) to some identity matrices. The assignment method below is extremely inefficient, taking up a large amount of memory and too much time (10sec for example below on my server, but my real dataset is much bigger). Looking at the screenshot from taskmanager, we can see clearly a large spike in memory usage while the operation is being carried out.

댓글 수: 1

Stewen
Stewen 2013년 4월 3일
Configuring your models to run in real time enables you to use hardware-in-the-loop testing instead of expensive prototypes to test your system. You can find mistakes earlier in the development process, reducing costs and shortening the design cycle. http://realmadrid-galatasaray-macidsmartizle.blogspot.com/ Configuring your models to run in real time enables you to use hardware-in-the-loop testing instead of expensive prototypes to test your system. You can find mistakes earlier in the development process, reducing costs and shortening the design cycle.
http://realmadrid-galatasaray-canlimacizle.dinstudio.se/ Configuring your models to run in real time enables you to use hardware-in-the-loop testing instead of expensive prototypes to test your system. You can find mistakes earlier in the development process, reducing costs and shortening the design cycle. http://realmadridgscanliseyret.nordblogs.com/ Configuring your models to run in real time enables you to use hardware-in-the-loop testing instead of expensive prototypes to test your system. You can find mistakes earlier in the development process, reducing costs and shortening the design cycle. http://real-gs-dsmart-izle.de.tl/ Configuring your models to run in real time enables you to use hardware-in-the-loop testing instead of expensive prototypes to test your system. You can find mistakes earlier in the development process, reducing costs and shortening the design cycle. http://realmadrid-gs-canlimacyayini.blogs.sapo.pt/ Configuring your models to run in real time enables you to use hardware-in-the-loop testing instead of expensive prototypes to test your system. You can find mistakes earlier in the development process, reducing costs and shortening the design cycle.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

질문:

2013년 4월 3일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by