Drawing a Shape

Drawing a Shape

For access to this article, please select a purchase option:

Buy chapter PDF
(plus tax if applicable)
Buy Knowledge Pack
10 chapters for £75.00
(plus taxes if applicable)

IET members benefit from discounts to all IET publications and free access to E&T Magazine. If you are an IET member, log in to your account and the discounts will automatically be applied.

Learn more about IET membership 

Recommend Title Publication to library

You must fill out fields marked with: *

Librarian details
Your details
Why are you recommending this title?
Select reason:
A Guide to MATLAB® Object-Oriented Programming — Recommend this title to your library

Thank you

Your recommendation has been sent to your librarian.

The paper defines a private member variable called mPoints and a public member function named draw. The variable will hold a 2 x n array of x-y corner points, one corner per column. The draw function will create a figure window and plot the corner points using solid, straight-line segments. The first corner will be stored in mPoints (: , 1) , and the last in mPoints ( : , end) . If the shape is supposed to be closed, mPoints (: , 1) must be equal to mPoints ( : ,end). This plan will get us started, with the details worked out during the implementation.

Chapter Contents:

  • 10.1 Ready, Set, Draw
  • 10.1.1 Implementation
  • Modify the Constructor
  • Modify fieldnames
  • Modify get
  • Modify set
  • Modify mtimes
  • Modify reset
  • Adding Member Function draw
  • 10.2 Test Drive
  • 10.3 Summary
  • 10.4 Independent Investigations

Inspec keywords: mathematics computing; object-oriented programming

Other keywords: private member variable; shape drawing; mPoints member variable; object-oriented programming; Matlab; corner point; figure window; public member function; draw member function

Subjects: Object-oriented programming; Mathematics computing

Preview this chapter:
Zoom in

Drawing a Shape, Page 1 of 2

| /docserver/preview/fulltext/books/pc/sbpc001e/SBPC001E_ch10-1.gif /docserver/preview/fulltext/books/pc/sbpc001e/SBPC001E_ch10-2.gif

Related content

This is a required field
Please enter a valid email address