Why are sparse matrix operations slow in Simulink R2023a?
採用された回答
6 件のコメント
As Walter says, Simulink does not support sparse signals. Therefore, sparse matrices can only be used within the block.
Code generation from Matlab Coder and the Matlab Function block are the same for sparse.
A goal for code generation is to support arbitrary targets, which is why these blocks do not use MATLAB’s shipping optimized sparse libraries. Rather they produce C code that implements the sparse algorithms .
We have been working to improve the performance of these sparse implementations.
For full matrix math the blocks do use MATLAB’s optimized BLAS and LAPACK but it takes work to support both paths. For sparse, there has not been enough demand to optimize this case yet.
Hope this clarifies the situation. Can you say more about your use case?
その他の回答 (0 件)
参考
カテゴリ
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!