To translate TriScatteredInterp from Matlab to C# or C++

I would like to translate TriScatteredInterp from Matlab to C# and I do these operations but they don’t work.
  1. I create "interpolazione.m" file on my desktop
  2. I press buttons "Desktop -> MATLAB Coder: MEX Function"
  3. I create "interpolazione.prj" file, I add "interpolazione.m" file in "Entry-Point Files" and I press "Build" button.
I get the following error message:
coder interpolazione.prj Could not locate build the MEX file compiler options mexopts.bat. Run mex-setup to select the MEX compiler and create the MEX options file. Use codegen help for more information on using this command.
The code that I would like to translate is this:
X=[0,1,2,0,1,2,0,1,2]';
Y=[0,0,0,1,1,1,2,2,2]';
Z=[0,0,0,1,1,1,2,2,2]';
x=[1.5,1.6,1.7];
y=[1.5,1.1,11.0];
F = TriScatteredInterp(X,Y,Z);
z = F(x,y)
Thanks for the help

 採用された回答

Friedrich
Friedrich 2012 年 4 月 30 日

1 投票

Hi,
besides of that error message. Don't even try to generate a mex file from that code because TriScatteredInterp isn't supported for code generation:
Consider using MATLAB Builder NE in order to generate a .NET DLL out of your code which than can be used in C# directly.
As far as I know, MATLAB uses the qhull library under the hood. Maybe the library itself is enough for you:

1 件のコメント

Richard Brown
Richard Brown 2012 年 4 月 30 日
I think it uses the Boost Graph Library (BGL) now - it used to use qhull

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

その他の回答 (1 件)

Ubaldo
Ubaldo 2012 年 4 月 30 日

0 投票

Thanks for your help. TriScatteredInterp is equal to Qhull or the first used in Matlab is better?

カテゴリ

ヘルプ センター および File ExchangeMATLAB Coder についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by