Now I am using cvi 8.1 and matlab 7.0. Using the matlabdemo.prj(supplied with given examples) now I can open matlab command prompt. Matlab command like helpwin can be sent successfully and the button "RUN M SCRIPT" is working successfully .But the problem is I can't transfer any string or any matrix to matlab command prompt. If I press the buttons "FFT" , "INVERT MATRIX", "SEND STRING " the popped up message is "error in sending matrix/string to matlab".I have followed the following steps as suggested by you
1) So I would suggest, if you haven't already, upgrading your runtime engine to CVI 7.1.1. The CVI runtime engine is backwards compatible so you will still be able to build you applications in CVI 7.0.
2) Once you do this, recreate the Matlab instrument. Remove the current Matlab instrument and recreate the Matlab Automation Server Type Library by going to Tools >> Create ActiveX controller. The name of the Matlab instrument will be Matlab Application Type Library. Save the newly created ActiveX controller with the same name as the previous one (as in, just replace the one that is already in the shipping example directory with the newly created one).
3) Change the matlabdemo.c launch callback to read
stat = MLApp_NewDIMLApp (NULL, 1, LOCALE_NEUTRAL, 0, &hMatlab);
instead of
stat = MLApp_NewDIMLApp (NULL, &hMatlab);
4) Open the source code for the Matlab instrument and search and replace ALL instances of &MLApp_IID_DIMLApp with &IID_IDispatch.
What should I do now?