필터 지우기
필터 지우기

Performance of matlab function build and called by C# application

조회 수: 3 (최근 30일)
alorenzom
alorenzom 2011년 12월 9일
Dear all, I wrote the following matlab function (R2011b):
function y = makesquare(x)
y = magic(x);
end
Now I'm doing some tests with Builder NE to check performances using ML code in C# 2010 with .NET Framework 4.0.
in C# I have written the interface:
public interface IClasse1CS
{
void makesquare(int x, out double[,] y);
}
and the code (snipped) to use the ML code via C# Interface (or native classes)
using MathWorks.MATLAB.NET.Arrays;
using MathWorks.MATLAB.NET.Utility;
using MyNameSpace;
IClasse1CS c = new MechanismIClasse1CS();
for (int i = 0; i < 10000; i++)
{
c.makesquare(1, out output);
}
the same loop (10000 times) takes about 0.24 secs to execute on MatLab, while takes about 2.6 seconds to run on C#. Is this by design or should it be optimized? If these are the performance I'll can't use NE to integrate ML code in my C# code, performance must be similar between C# and ML.
thanks

답변 (0개)

카테고리

Help CenterFile Exchange에서 .NET Client Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by