2014年12月26日 星期五


環境設定
To run Java 7 code from Matlab, Matlab needs to use JVM 1.7. To do this, see this MathWorks page, or follow these steps:
  1. Ensure that you are using Java 6 or earlier – no need to do anything if your Matlab already has Java 7
    >> version -java
    ans =
    Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode
  2. Download and install JRE 1.7 or JDK 1.7 from the Oracle website
  3. Create a new System Environment Variable called MATLAB_JAVA with the installation folder as its value. For example: “C:\Program Files\Java\jdk1.7.0_21\jre”
  4. Restart Matlab and verify that it picked up the new Java version:
    >> version('-java')
    ans =
    Java 1.7.0_21-b11 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode

連結 using-java-7-in-matlab-r2013a-and-earlier


_______________

#配置MATLAB調用的Java庫
1.完成的Java代碼。
2.創建Java庫文件,即.jar文件。
3.將創建.jar文件的目錄使用Matlab的存儲庫之一,並添加相應的路徑
    Matlab的配置文件,$ MATLABINSTALLDIR\$ MatlabVersion\工具箱\本地\ classpath.txt

#配置MATLAB調用的Weka
1.下載WEKA
2.安裝WEKA
3。在环境变量的系统变量中的Path中加入jre6(或者其他的)中bin文件夹的绝对路径,如:
    C:\ Program Files文件\的Java\ JRE6\ BIN;
4.查找MATLAB配置文件classpath.txt
   其中classpath.txt%使用這個命令可以查找classpath.txt的位置
5.修改配置文件classpath.txt
   編輯classpath.txt
   在classpath.txt配置文件中將WEKA安裝目錄下的weka.jar的絕對安裝路徑填入,如:
   C:\ Program Files文件\的Weka-3-6/ weka.jar
6.重啟MATLAB
7.運行如下命令:
   屬性= JAVAOBJECT('weka.core.FastVector');
   %如果MATLAB沒有報錯,就說明配置成功了

8. Matlab的在調用WEKA中的類時,經常遇見的堆空間溢出的情況,我們需要設置較大的堆棧,設置方法是:
    Matlab->文件 - >優先 - >常規 - > Java堆內存,然後設置適當的值。

WEKA 筆記

Related Posts:

  • C/C++筆記-判斷一數是否為2的次方數值// X值與X-1值做AND運算,若傳回0,則為2次方數值 int X; cin >> X; cout << !(X&(X-1)) << endl; … Read More
  • 提升軟體開發品質! 寫程式的 6 招實用技巧 00:00 提升品質的影響 01:29 有意義的命名比簡寫更好 03:01 限制傳入參數數量 05:03 簡化條件表達式 06:37 變數定義範圍限制 08:28 一次只做一件事 10:35 Early return … Read More
  • Windows 命令提示字元 (cmd) 像 Linux 就直接 cd 相對路徑 或是絕對路徑就行了,可是在 Windows 直接輸入 cd 指令卻還是原本的目錄... 經過多方查詢 Windows 的指令之後,終於知道缺什麼了! 指令 cd 是對的沒錯,但是還需要 "/d" 來幫忙才會換過去唷    指令: cd /d 完整路徑 … Read More
  • wait()、notify()、notifyAll() 執行緒間的等待與喚醒機制的互動 必須撰寫在synchronized的區塊內, 當wait()被呼叫時,則會釋放所有的鎖, 並寫在try-catch(InterruptedException e)內, 1. void wait() 讓執行緒進入等待狀態 2. void notify() 喚醒一個等待中的執行緒,若有多個執行緒,則由JVM決定 3. void notifyAll() 喚醒所有等待中的執行緒 注意:考慮在複雜程式上的邏輯正確,在執行緒交互呼叫wait()和n… Read More
  • Matlab 調用 Java 環境設定 To run Java 7 code from Matlab, Matlab needs to use JVM 1.7. To do this, see this MathWorks page, or follow these steps: Ensure that you are using Java 6 or earlier – no need to do anything if your Matlab alrea… Read More

0 意見:

張貼留言

標籤

總網頁瀏覽量

76,551

Translate

Popular Posts

Blog Archive