create sparse matrix from diagonal arrays
显示 更早的评论
I have the 7 diagonal that come from a 3D finite volume discretization in separate arrays. These 7 arrays have 3D shape and correspond to each elements of the stencil for all points: top, bottom, east, west, north south and central point. I would like to create a sparse matrix object from these arrays, but I feel a little lost with the spdiag documentation. Help would be gratly apreaciated.
采纳的回答
更多回答(2 个)
Andrew Newell
2014-4-10
0 个投票
MATLAB supports sparse matrices, but for 3D arrays you'll need to visit the File Exchange and get N-dimensional sparse arrays by Matt J.
2 个评论
Jack Silver
2014-4-11
Andrew Newell
2014-4-11
I'm still having trouble understanding what you mean. Could you attach a file with some data?
类别
在 帮助中心 和 File Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!