About mixed programming errors with C + + and Matlab??? Unexpected standard exception from MEX file.

Source: Internet
Author: User



Recent mixed Programming with C + + and MATLAB has encountered some problems, as follows:

??? Unexpected standard exception from MEX file.
What () Is:c:program


Error in ==> Mscale at 32
[Rho,s] = Matscale (ABS (a), 0.01 );

Error in ==> utscaledexpm at 7
[S,junk,a] = Mscale (A, ' noperm ', ' Safebal ');

Error in ==> Ssdata.utdiscretizezoh at 171
s = utscaledexpm ([[A b]*ts; zeros (NU,NX+NU)]);

Error in ==> Ssdata.trespsetup at 104
          < /c18> [D,xmap] = Utdiscretizezoh (D,DT,XMAP);

Error in ==> Ltidata.timeresp at 78
[Dsim,dt,tf,siminfo] =
Trespsetup (d,resptype,dt,tf,x0 );

Error in ==> Lti.step at 67
[y,t,focus ] = Timeresp (D, ' step ', t);

Error in ==> step 125
yout = Step (sys,t );

for exceptions, please attend: http://www.cplusplus.com/reference/exception/exception/


1. Direct on-line programs or other people's code directly, because of configuration and environmental problems caused by problems, here is not necessarily thrown exception, easier to find;
2. The MATLAB version of the program was different from its current version of MATLAB, there is the possibility of throwing exceptions, and also experienced;

3. Sometimes, if you use C + + containers (list, vector, and so on), if size or iterators are used improperly can also result in an out-of-bounds access exception, especially for the boundaries of the container, especially attention, I have been here more than once suffered!
4. Because the memory allocation and the release problem, after the program runs several times, your CPU occupation rate is very high, should consider this reason, is not forgetting the release resource!
The key to finding errors is tracking and positioning, remember Oh!










About mixed programming errors with C + + and Matlab??? Unexpected standard exception from MEX file.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.