如何将参数从C#传递到Matlab函数

时间:2018-09-12 07:14:45

标签: c# matlab

我有一个像这样的matlab代码:

[dIBI,nIBI,trend,art] = preProcessIBI(IBI, ...
            'locateMethod', methods, 'locateInput', methInput, ...
            'replaceMethod', settings.ArtReplace, ...
            'replaceInput',replaceWin,  ...
            'detrendMethod', settings.Detrend, ...
            'smoothMethod', settings.SmoothMethod, ...
            'smoothSpan', settings.SmoothSpan, ...
            'smoothDegree', settings.SmoothDegree, ...
            'polyOrder', settings.PolyOrder, ...
            'waveletType', ...
            [settings.WaveletType num2str(settings.WaveletType2)], ...
            'waveletLevels', settings.WaveletLevels, ...
            'lambda', settings.PriorsLambda,...
            'resampleRate',settings.Interp);

使用此代码,我可以调用函数preProcessIBI。没关系。

现在,我想从c#调用此函数。因此,我要从matlab构建一个dll,并将其导入Visual Studio项目中。

这是C#程序的代码:

private void getNibiDibi()
        {
            var IBI = matlab.loadIBI("D:\\MathWorks MATLAB R2018a\\_HRVAS-master\\SampleData\\synthetic.ibi");
            MWCellArray arrayChar = new MWCellArray(28);
            arrayChar[1] = "locateMethod";

            var output = matlab.preProcessIBI(IBI, arrayChar);
        }

现在的问题是,如何从C#调用此函数,以及如何传递相同的参数?

0 个答案:

没有答案