添付のサンプル “DEMO.ZIP” は、VB.NETからMATLAB関数へのセルの渡し方、MATLAB関数からVB.NETへのセルの戻り値の受け取り方を示しています。
※ もしR2006aをご使用の場合は、サンプルをお試しいただく前に以下のURLの手順でMWArray.dll の更新をお願いいたします。
手順:
1. 'CellArrayDemo' フォルダを開きます。ここで Module1.vb は VB.NETからMATLAB関数へのセルを渡したり、MATLAB関数からVB.NETへのセルの戻り値を受け取るコードを含んでいます。
2. CellArrayDemo.sln により、Visual Studio .NET の開発環境を開きます。
3. 参照 (References) に、以下のDLLを追加します。 # MWArray.dll, MWComUtil.dll, および MWComMgr.dll。これらは以下のパス内にあります。 ($MATLABROOT はMATLABのインストールフォルダで、matlabrootコマンドで確認できます。) # .NET アセンブリのオブジェクトを追加します。DEMO.ZIP の場合、\addcols\distrib フォルダ内にある addcols_1_0.dll ファイルを追加します。
4. Build->Build によりビルドを行い、Debug->Start でVB.NETアプリケーションを起動します。
Best Answer