午夜视频在线网站,日韩视频精品在线,中文字幕精品一区二区三区在线,在线播放精品,1024你懂我懂的旧版人,欧美日韩一级黄色片,一区二区三区在线观看视频

分享

solem's vision blog: Reading and writing .mat files with Python

 weicat 2011-04-11

Reading and writing .mat files with Python

If you have some old data, or find some interesting data set online, stored in Matlab's .mat file format it is possible to read this using the scipy.io module in SciPy. This is how to do it.

data = scipy.io.loadmat('test.mat')

"data" now contains a dictionary with keys corresponding to the variable names saved in the original .mat file. The variables are in array format. Saving to .mat files is equally simple. Just create a dictionary with all variables you want to save and use savemat().

data = {}
data['x'] = x
scipy.io.savemat('test.mat',data)

This saves the array x so that it has the name "x" when read into Matlab. More information on scipy.io can be found in the online documentation.

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多