Search code examples
matlabsparse-matrix

How to convert a sparse matrix to a dense matrix in MATLAB?


I have a double sparse matrix shown below. My question is how can I convert it to normal matrix format?

s 
163840*1 sparse double

val =

                  (2,1)                     NaN
                     .
                     .
             (163823,1)                     NaN
             (163825,1)                     NaN
             (163827,1)                     NaN
             (163829,1)                     NaN
             (163831,1)                     NaN
             (163833,1)                     NaN
             (163835,1)                     NaN
             (163837,1)                     NaN
             (163839,1)                     NaN

Solution

  • I think you want the full command.