Patent ID: 7823122

Claim:
In an electronic device, a method for automatically generating a function based on an executable block diagram model, comprising: providing on a first graphical user interface (GUI) a portion of the executable block diagram model, the portion of the executable block diagram model including a block representing an elemental dynamic system; receiving a function signature for the portion of the executable block diagram model, the function signature being generated by a user on a preview GUI, wherein the function signature is displayed on the preview GUI; automatically generating preview code representing the function resulting from the user generated function signature and the portion of the executable block diagram model, the generating performed by evaluating the portion of the executable block diagram model, the function corresponding to the portion of the executable block diagram model; dynamically displaying the preview code of the function along with the function signature on the preview GUI; wherein the user can refine the function signature by manipulating the function signature and renew the preview code of the function on the preview GUI; and automatically generating code for the entire executable block diagram model after generating the preview code representing the function, the code for the entire executable block diagram model comprising the preview code representing the function corresponding to the portion of the executable block diagram model and the function signature.