新聞中心

        Matlab文件操作示例

        作者: 時間:2012-02-11 來源:網(wǎng)絡(luò) 收藏

        操作示例

        問題1:如何在matlab中讀取數(shù)據(jù)將如下格式的數(shù)據(jù)data.txt裝載到內(nèi)存中,并生成一個二維數(shù)組1	0.0002	22	0.0004	33 	0.3	4輸入命令“l(fā)oad -ascii data.txt”,此時數(shù)組data已經(jīng)存在,輸入命令“data”可以察看data>> load -ascii data.txt>> datadata =1.0000    0.0002    2.00002.0000    0.0004    3.00003.0000    0.3000    4.0000>> 問題2:如何將數(shù)組的數(shù)據(jù)保存到數(shù)據(jù)文件?Use the Save command.Save the data in ASCII form using the save 
        command with the -ascii option. For example,A = rand(4,3);save temp.dat A -asciicreates an ASCII file called temp.dat containing1.3889088e-001  2.7218792e-001  4.4509643e-0012.0276522e-001  1.9881427e-001  9.3181458e-0011.9872174e-001  1.5273927e-002  4.6599434e-0016.0379248e-001  7.4678568e-001  4.1864947e-001


        關(guān)鍵詞: 文件 Matlab

        評論


        相關(guān)推薦

        技術(shù)專區(qū)

        關(guān)閉
        主站蜘蛛池模板: 延川县| 宁化县| 鹤壁市| 吴忠市| 改则县| 原阳县| 贡觉县| 贡山| 逊克县| 社旗县| 囊谦县| 娱乐| 韩城市| 民乐县| 铜梁县| 鲁甸县| 西林县| 昭平县| 烟台市| 天镇县| 阜康市| 九龙坡区| 安龙县| 冷水江市| 莱西市| 凉山| 肥城市| 晋城| 九江县| 永宁县| 宝清县| 香港 | 筠连县| 沙田区| 资兴市| 丹凤县| 嫩江县| 荆门市| 宾川县| 灵台县| 温泉县|