Error in c# connecting between matlab and C#
1 次查看(过去 30 天)
显示 更早的评论
Hi, Please anyone can solve this error .In connecting between C# and matlab . I don't usderstand the error .
See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.
************ Exception Text ************ System.Exception:
... MWMCR::EvaluateFunction error ... Error using ==> vertcat CAT arguments dimensions are not consistent..
at MathWorks.MATLAB.NET.Utility.MWMCR.EvaluateFunction(String functionName, Int32 numArgsOut, Int32 numArgsIn, MWArray[] argsIn)
at MathWorks.MATLAB.NET.Utility.MWMCR.EvaluateFunction(String functionName, MWArray[] argsIn)
at com.speechR.SpeechR.Recognition(MWArray speechIn, MWArray silence)
Thanks a lot:)
Nada Gamal
0 个评论
回答(1 个)
Kaustubha Govind
2011-5-4
It looks like the inputs that you are providing are causing a "vertcat CAT arguments dimensions are not consistent" error from MATLAB. It is hard to tell without looking at your code, but you may have a call to VERTCAT, or a statement that performs concatenation using something like:
out = [in1 in2];
Do you have the original MATLAB code? If yes, try constructing the same inputs in MATLAB and invoke the function to debug.
2 个评论
Kaustubha Govind
2011-5-4
My best bet is that the error comes from:
speechIn1 = [silence;speechIn];
If silence and speechIn have different sizes, then this works only if they are both column vectors. Not sure if they are passed in as row vectors from C# - you could try adding the following lines to the top of the MATLAB function, recompile, and try this again:
% Convert silence and speechIn to column vectors
silence = reshape(silence, [numel(silence) 1]);
speechIn = reshape(speechIn, [numel(speechIn) 1]);
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!