A Guide to MATLAB Object-Oriented Programming (Computing and Networks)

A Guide to MATLAB Object-Oriented Programming (Computing and Networks)

Andy H. Register

Language: English

Pages: 384

ISBN: 158488911X

Format: PDF / Kindle (mobi) / ePub


A Guide to MATLAB Object-Oriented Programming is the first book to deliver broad coverage of the documented and undocumented object-oriented features of MATLAB®. Unlike the typical approach of other resources, this guide explains why each feature is important, demonstrates how each feature is used, and promotes an understanding of the interactions between features.

Assuming an intermediate level of MATLAB programming knowledge, the book not only concentrates on MATLAB coding techniques but also discusses topics critical to general software development. It introduces fundamentals first before integrating these concepts into example applications. In the first section, the book discusses eight basic functions: constructor, subsref, subsasgn, display, struct, fieldnames, get, and set. Building on the previous section, it explores inheritance topics and presents the Class Wizard, a powerful MATLAB class generation tool. The final section delves into advanced strategies, including containers, static variables, and function fronts.

With more than 20 years of experience designing and implementing object-oriented software, the expert author has developed an accessible and comprehensive book that aids readers in creating effective object-oriented software using MATLAB.

Problem Solving and Programming Concepts (Prentice Hall 9th Edition)

Mastering JIRA

C in a Nutshell (2nd Edition)

Twilio Cookbook (2nd Edition)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

parent plus those names added by the child. The easiest way to assemble the list is to call parent_list, slice the object into each parent listed, concatenate the variable names from the parents, and finally add the child’s names. Code to implement this process is shown in Code Listing 67. Code Listing 67, Implementing Parent Slicing in cStar’s fieldnames.m 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 function names = fieldnames(this, varargin) names = {}; % first fill up

.......................................................................................107 Code Listing 46, Chapter 8 Test Drive Command Listing for set.m .............................................110 Code Listing 47, Chapter 8 Test Drive Command Listing for get.m.............................................111 Code Listing 48, Improved Implementation for subsref.m ............................................................114 Code Listing 49, Improved Implementation for subsasgn.m

idioms in a coding standard, but allow the standard to evolve. Taking advantage of MATLAB’s help utility is the second condition. Use a Contents.m file to display a table-of-contents description of all the functions in a directory. Use a standard, compatible format for header comments. Format all the lines in a header as comments, and MATLAB displays the comments in response to help function name. These header comments should summarize the function’s intent and cite important assumptions for

dot-access dot-access array-access array-access cell-access cell-access FIGURE 4.1 Access operator organizational chart. skeleton is used inside both subsref and subsasgn. Before filling in code for each case, I need to outline an approach for discussing the boxes shown in Figure 4.1. One organization discusses all cases of subsref before moving on to all cases of subsasgn. The alternate organization discusses one operator case with respect to both access and mutation before moving on to

all of it the current value. This makes fieldnames a very logical place to store the additional data. The ‘-full’ option does not include everything we need. We need to invent a new string value that will be used primarily from inside other group-of-eight member functions. In the case of set(cShape), the output needs to include a list of the allowed values for each element. The list describes the possible element values, and following from this, the new string value will be ‘-possible’. When

Download sample

Download

About admin