com.mathworks.matlab.types.ValueObject
説明
Java® は、MATLAB® から渡される値オブジェクトを ValueObject
クラスのインスタンスとして表します。
作成
Java で ValueObject
を作成することはできません。値オブジェクトは、その値オブジェクトが作成された MATLAB セッションにしか渡せません。
例
MATLAB での Polygon オブジェクトの作成
多角形を作成し、numsides
メソッドを呼び出します。
import com.mathworks.engine.*; import com.mathworks.matlab.types.*; public class PassValueObject { public static void main(String[] args) throws Exception { MatlabEngine eng = MatlabEngine.startMatlab(); // CREATE VALUE OBJECT pgon = polyshape([0 0 1 3], [0 3 3 0]); ValueObject pgon = eng.feval("polyshape", new int[]{0,0,1,3}, new int[]{0,3,3,0}); // CALL METHOD res = numsides(pgon) ns = eng.feval("numsides", pgon); System.out.println("Number of sides: " + ns); eng.close(); } }
バージョン履歴
R2021a で導入
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)