Introduction to Automatic Code Generation in Simulation

Source: Internet
Author: User

When I was in school, I always felt that automatic code generation was not very reliable and I used it too. At that time, I found that the names of automatically generated code variables were chaotic and I was basically not interested. After work, I used Automatic code generation to find that this is a one-to-one tool.

The advantages of Automatic code generation are:

1) Graphical policy modeling is very helpful for communication;

2) Policy engineers do not need to have rich programming experience;

3) The quality of automatically generated code is relatively high, at least in terms of security, it is higher than that of manual coding;

4) generally, the model is a fixed-point model with better computing efficiency. Therefore, it has advantages in the fixed-point model;

5) model testing is easier than code testing.

The Simulink Automatic Code uses the MPT object to describe the parameters and signals (calibration and measurement), and the simulink. numerictype to describe the data type. MPT object describes some basic attributes of parameters and Signals: data type, initial value, and options related to Automatic Code Generation. Simulink. numerictype is mainly used to describe the data type of a specified point, that is, the data definition, scaling factor, and offset. Generally, a data dictionary is used to describe the data type. Everyone in a project shares a set of data dictionaries. After setting the attributes of the MPT object, convert the model from floating point to fixed point, and set the model to automatically generate attributes, the code can be automatically generated.

Complete the detailed process.

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.