matrixoperations
ライブラリに対するインターフェイスのビルド
ライブラリ定義ファイルに対する編集の検証
前の手順で、ライブラリ定義ファイル definematrixlib.m
を変更しました。MATLAB® ステートメントを確認するには、ファイルを検証し、報告されるエラーをファイルで修正します。
definematrixOperations;
機能の確認
前の手順で定義ファイルのすべての構成要素を定義してあれば、関数 summary
で完全なライブラリが表示されます。場合によっては、すべてを定義していないこともあります。summary
を使用してライブラリを確認します。変更が必要な場合は、前の手順に戻って definematrixOperations
を編集します。
summary(definematrixOperations)
MATLAB Interface to matrixOperations Library Class clib.matrixOperations.Mat Constructors: clib.matrixOperations.Mat(clib.matrixOperations.Mat) clib.matrixOperations.Mat() Methods: setMat(clib.array.matrixOperations.Int) int32 getMat(uint64) uint64 getLength() copyMat(clib.array.matrixOperations.Int) No Properties defined Functions int32 clib.matrixOperations.addMat(clib.matrixOperations.Mat) clib.matrixOperations.updateMatByX(clib.matrixOperations.Mat,int32) clib.matrixOperations.updateMatBySize(clib.matrixOperations.Mat,clib.array.matrixOperations.Int)
インターフェイスのビルドと MATLAB パスへの追加
ライブラリに対する matrixOperations
インターフェイスをビルドします。
build(definematrixOperations)
Building interface file 'matrixOperationsInterface.dll' for clib package 'matrixOperations'. Interface file 'matrixOperationsInterface.dll' built in folder 'C:\Users\Documents\MATLAB\matrixOperations'. To use the library, add the interface file folder to the MATLAB path. addpath('C:\Users\Documents\MATLAB\matrixOperations')
メッセージ内の addpath
のリンクをクリックするか、次のように入力します。
addpath('matrixOperations')
メモ
生成、定義、ビルドの手順は繰り返し実行できます。ただし、ライブラリのヘルプを表示するか関数を呼び出した後は、同じ MATLAB セッションで定義ファイルを更新することはできなくなります。MATLAB を再起動するか、関数 clibgen.generateLibraryDefinition
の名前と値の引数 PackageName
を使用して新しい定義ファイルを作成します。
ライブラリの関数を呼び出すには、次の手順に進みます。