필터 지우기
필터 지우기

C# function which accepts only MWarray instead of MWarray[] as input to the function

조회 수: 1 (최근 30일)
I have compiled the two matlab functions as NET assembly which will be used in the C# languague as follows -
% It gives the view how the code will be implemented using the C#
result = function1(filepath,inputstring);
input = result(4:end); % this part not tried - as of now only [input = result]
out2 = function2(filepath,input); % Error result is MWarray[] where as input expects MWarray
In the C# enviornment, result and input are the MWarray[]. result is coming as the MWarray[] type which is of length 7.
where as the input of second function is accepts only MWarray instead of MWarray[].
In the matlab code, there is no difference between input as variable and array, because we don't declare the "input" as neither variable or array.
How to solve this issue, i want to pass the MWarray[] to the input of second function?
  댓글 수: 2
Guillaume
Guillaume 2019년 3월 18일
Your question is really not clear. The code you show is matlab code, not .Net code. Are you asking how to translate it into .Net (which language?)?, Or are you asking how to call a .Net function from matlab?
In any case, we probably need to know the code of function2 (or at least its exact signature)
Note that it is not possible to call from matlab .Net functions that have themselves been generated by matlab.
Kanchibhotla Chandra Sekhar
Kanchibhotla Chandra Sekhar 2019년 3월 18일
i am sorry, i haved compiled as .NET assembly package and code using in C# languange.

댓글을 달려면 로그인하십시오.

채택된 답변

Kanchibhotla Chandra Sekhar
Kanchibhotla Chandra Sekhar 2019년 3월 20일
I have used the following code -
% It gives the view how the code will be implemented using the C#
result = function1(filepath,inputstring);
out2 = function2(filepath,varargin);
varargin accepting mwarray[], so the function will be called as -
function2(filepath,result);
It has worked.

추가 답변 (0개)

카테고리

Help CenterFile 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!

Translated by