Feval (com) turns MWCharArray input to NaN
이전 댓글 표시
Hi, I'm trying to call a MATLAB script from c# via the COM interface. The program should pass a json string to matlab, do some calculations an pass it back:
MLApp.MLApp matlab = new MLApp.MLApp(); string jsonString = myfunc(); MWCharArray mlInput = new MWCharArray(jsonString); matlab.Feval(scriptName, 1, out object result, mlInput);
The matlab script behind scriptName calls jsondecode() on mlInput and immediately throws an error, that the input for jsondecode has to be a character vector. When I display the mlInput from within matlab, it only shows me a NaN, but the mlInput is a valid json string at runtime on the c# side. If i try to input the c# string, the matlab script just crashes without any error message. I don't understand what is happening. Can anyone help?
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 ActiveX에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!