目前主要探討matlab在linux下面的使用。
1.matalab的啟動。
matlab可以在命令列中進行計算,也可以啟動GUI介面來操作。由於主要用於後台資料計算處理,主要探討命令在termianl中操作。
matlab啟動的一些選項:
-nodesktop 啟動jvm(Jave Virtual Machine),不啟動desktop, 但help 介面,preferences介面等仍可通過cmdline 調出,即jvm啟動但不啟動desktop,可以啟動其他顯示; 但是matlab不會在cmd history記錄本次執行的命令
-nodisplay 啟動jvm,不啟動desktop,不啟動任何顯示相關,忽略任何DISPLAY 環境變數; 即jvm啟動但不能顯示
-nojvm 不啟動jvm,則與之相關的一切活動將無法進行,包括圖形介面顯示,help 介面,preferences介面等 即jvm不啟動故不能顯示
-nosplash 只是不顯示啟動時的log畫面,jvm,desktop等正常啟動
2. 為matlab添加工作目錄。 在matlab命令列中輸入:addpath /yourdirecory3.讀csv檔案。csvreadRead comma-separated value file Syntax M = csvread(filename)M = csvread(filename, row, col)M = csvread(filename, row, col, range)DescriptionM = csvread(filename) reads a comma-separated value formatted file, filename. The filename input is a string enclosed in single quotes. The result is returned in M. The file can only contain numeric values.M = csvread(filename, row, col) reads data from the comma-separated value formatted file starting at the specified row and column. The row and column arguments are zero based, so that row=0 and col=0 specify the first value in the file.M = csvread(filename, row, col, range) reads only the range specified. Specify range using the notation [R1 C1 R2 C2] where (R1,C1) is the upper left corner of the data to be read and (R2,C2) is the lower right corner. You can also specify the range using spreadsheet notation, as in range = 'A1..B7'.