tailieunhanh - CRC.Press A Guide to MATLAB Object Oriented Programming May.2007 Episode 2 Part 5

Tham khảo tài liệu ' a guide to matlab object oriented programming episode 2 part 5', kỹ thuật - công nghệ, cơ khí - chế tạo máy phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 254 A Guide to MATLAB Object-Oriented Programming FIGURE Class Wizard cLineStyle public variable dialog. exercise of entering private variables in the fields Name and Comment are familiar. The type accessor and mutator fields are new. The type field serves two purposes. First with the exception of display the public name and its type string are copied into all group-of-eight headers. Second the type string is displayed as a hint when set is called with one argument. That also means the type string is copied into the -possible case inside fieldnames. Accessor Expression and Mutator Expression fields guide the generation of public cases inside and . If the Expression field contains the name of a private variable direct-access code syntax will be inserted into get or set. If the Expression field contains the string helper helper-function syntax will be inserted into get or set and a stub for the helper will be generated. Finally if the Expression field is empty a public case for the variable is not included. The Accessor Expression value and Mutator Expression value are independent. Accessor Expression influences the code in get and Mutator Expression influences the code in set. In addition public variables with an empty Accessor Expression value are not included in fieldnames or struct. All public variables in cLineStyle have accessors. The accessor for Color uses a helper but accessors for LineWidth and LineHandle are directly linked to mLineWidth and mLineHandle. All public variables also have mutators. In this case the mutator for LineWidth is not a direct link but rather uses a helper. The table of entries for the public variables is given in Table . The procedure for data entry follows the same procedure used for private variables. Select the first empty line in the lower display block and enter data in the fields. After all field values have been specified click Save Change to commit the data and move to the next line. In this dialog

TỪ KHÓA LIÊN QUAN