From MATLAB to C#. C# programm has lags
이전 댓글 표시
I created some function in Matlab. This function image grayscale picture from .mat-file.
I have this command in MATLAB.
figure, imshow(Image_uint8);
I created .dll from this function. My small console programm on C# work, but I have big lags when I want to know point and his value of picture. It`s more than some lags.
C#
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
Test11.step7();
}
}
}
using MathWorks.MATLAB.NET.Utility;
using MathWorks.MATLAB.NET.Arrays;
using step0;
namespace ConsoleApp1
{
class Test11
{
public static void step7()
{
Class1 ojb = new Class1();
MWArray output1 = ojb.step0();
Console.WriteLine("Output ~\n" + output1);
Console.ReadKey();
}
}
}
MATLAB
function [pname_save] = step0()
[fname_open, pname_open] = uigetfile('*.asd','Select the .asd file');
if fname_open ~=0
fullname = strcat(pname_open,fname_open);
cd (pname_open);
else
fullname = null;
end
...
figure, imshow(Image_uint8)
%save file
result = regexprep(fname_open, '\.[^\.]*$', '');
pname_save = [pname_open name_out];
cd (pname_save);
...
fclose (fid);
end
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Deploy to .NET Applications Using MWArray API에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!