i have written a function in matlab which returns the int. i have made its dll to use in c#. as Mwarray output= test.matlabfunction(a,b); here i want to convert output to int. can someone please advise?

답변 (1개)

mohammad mehdi riyahi
mohammad mehdi riyahi 2021년 1월 17일
편집: mohammad mehdi riyahi 2021년 1월 17일

0 개 추천

Hi,
I had a problem same as you, so I first converted the output to the string and then converted it to the int. The way above worked for me. If I say more about my problem, I must say the MATLAB dll gave me a vector, called Sampling_Design_Nodes, and I had to change it to int. In the following I write the code for changing the format, first I convert it to string and then to int.
I hope my answer can be useful for you.
string ST_01=Sampling_Design_Nodes[1,1].ToString();
Int16 X_01 = Convert.ToInt16(ST_01);

카테고리

도움말 센터File Exchange에서 Deploy to C++ Applications Using mwArray API (C++03)에 대해 자세히 알아보기

질문:

2017년 10월 27일

편집:

2021년 1월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by