How can i get function's multiple return values in c#

조회 수: 15 (최근 30일)
Sathiyaseelan
Sathiyaseelan 2012년 9월 11일
댓글: Kenery 2014년 4월 23일
Dear all,
I create an function with 4 return values and converted dll for .net, when i call that function i can get only first values remaining 3 values are not able get.
function [p,n,d,u] = Function_Apc(input list)
in C# i called as OptiAPC myMpcObj = new OptiAPC()
MWArray obj = null;
obj = myMpcObj.Function_Apc(Inputlist);
in obj value has only p value not others.
How can i get all the 4 values in that variable "Obj"

답변 (1개)

Sathiyaseelan
Sathiyaseelan 2012년 11월 6일
If you want to get 4 return value from function, you have to declare MWArray[] with 4 parameters and Create an Object like this,
In C#:
MWArray[] Result = new MWArray[4];
MPC myMpcObj = new MPC();
Result = myMpcObj.Function_Apc(4,Inputlist);
Here 4 means number of output Now you can get 4 Output Return Values.
  댓글 수: 1
Kenery
Kenery 2014년 4월 23일
Hi,
I'm wondering if the function's outputs are different data types, for example, [struct array, double array] = function(...)
How can I declare the return values in C#?
thanks

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

카테고리

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