How to use java class that I made in matlab?

3 ビュー (過去 30 日間)
JINSOL.KIM
JINSOL.KIM 2015 年 11 月 16 日
コメント済み: Kirby Fears 2015 年 11 月 17 日
How to use java class that I made in matlab?
I made a package. So, I want to use it in the MATLAB. But I can't do it.
ex) import java.lang.String, which is possible.
But the class that I made is unaccessible. How can I import mine?
or Where should I save my package?
please help me...
  1 件のコメント
Adam
Adam 2015 年 11 月 16 日
As far as I am aware it should simply be on your path and compiled into .class (I think) files.

サインインしてコメントする。

採用された回答

Kirby Fears
Kirby Fears 2015 年 11 月 16 日
編集済み: Kirby Fears 2015 年 11 月 16 日
Matlab has a java session that will only see your package if it's on that session's class path. You'll be able to import your package after adding it to the class path using javaaddpath() in Matlab. For example:
filepath = 'C:/mypackage.jar'
javaaddpath(filepath);
import mypackage.Class1; % imports Class 1 within mypackage
Hope this helps.
  2 件のコメント
JINSOL.KIM
JINSOL.KIM 2015 年 11 月 17 日
I followed your instruction and others. but always this error occured.
I also declare 'package Algo;' in java file.
What should I do more??
please help me...
Kirby Fears
Kirby Fears 2015 年 11 月 17 日
Your classname is "Vector2", not "Vetor2". Does import work when you correct the spelling?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCall Java from MATLAB についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by