How can I save a very large MATLAB sparse matrix to a text file?

前端 未结 8 715
孤城傲影
孤城傲影 2021-02-01 06:53

I have a 30000x14000 sparse matrix in MATLAB (version 7), which I need to use in another program. Calling save won\'t write this as ASCII (not supported). Calling full()

8条回答
  •  一向
    一向 (楼主)
    2021-02-01 07:50

    Save the sparse matrix as a .mat file. Then, in the other program, use a suitable library to read the .mat file.

    For instance, if the other program is written in Python, you can use the scipy.io.mio.loadmat function, which supports sparse arrays and gives you a sparse numpy matrix.

提交回复
热议问题