Error in c# connecting between matlab and C#
1 view (last 30 days)
Show older comments
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 Comments
Answers (1)
Kaustubha Govind
on 4 May 2011
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 Comments
Kaustubha Govind
on 4 May 2011
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]);
See Also
Categories
Find more on Deploy to .NET Applications Using MWArray API in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!