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!