Method and system for generating program code
摘要:
A computer-implemented method for generating program code based on one or more blocks of a block diagram in a technical computing environment including a model editor and a code generator. The method comprises opening the block diagram in the model editor, the block diagram comprising a delay block that delays a signal received by an input port for a number of periods before being emitted at an output port, determining that a composite signal is connected to the input port, and generating definitions for variables, the variables including a state buffer, a pointer and an index. The method further comprises generating loop code, the loop code comprising instructions for setting the pointer to a position in the state buffer with an offset of index, instructions for outputting elements from the state buffer, instructions for inputting the composite signal to the state buffer, and instructions for adjusting the index.
信息查询
0/0