MATLAB Object-Oriented Programming

(Joyce) #1
end
end

Using the BankAccount and AccountManager Classes


Create an instance of the BankAccount class.

ba = BankAccount(100)

ba =

BankAccount with properties:

AccountBalance: 100
AccountManagerListener: [1x1 event.proplistener]
AccountStatus: 'New Account'

Now set an account value to confirm that the AccountManager sets AccountStatus
appropriately:

ba.AccountBalance = -10;
ba.AccountStatus

ans =

overdrawn

See Also


Related Examples



  • “Modify the Save and Load Process” on page 13-16

  • “Property Attributes” on page 8-9

  • “Listen for Changes to Property Values” on page 11-40

  • “Object Save and Load”


13 Saving and Loading Objects

Free download pdf