Can I have array of sparse matrices?

조회 수: 7 (최근 30일)
Jakub Závada
Jakub Závada 2015년 5월 9일
편집: James Tursa 2015년 5월 10일
I have array of matrices. Every matrix has only one non-zero element in every row. So I want to save it as array of sparse matrices. How can I do it? sparse(A) where A is array of matrices returns error "Undefined function 'sparse' for input arguments of type 'double' and attributes 'full 3d real'."

채택된 답변

John D'Errico
John D'Errico 2015년 5월 9일
You CAN have a cell array of sparse matrices. So every cell may contain a sparse matrix. But you cannot have a sparse 3-d matrix.

추가 답변 (1개)

James Tursa
James Tursa 2015년 5월 10일
편집: James Tursa 2015년 5월 10일
Yes, but not directly with inbuilt MATLAB functionality. Instead, you can use this FEX submission by Matt J:

카테고리

Help CenterFile Exchange에서 Sparse Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by