| CS 1371 Dept. Presents: |
| ACCESSOR METHOD | |
|---|---|
| Definition | The method called whenever Matlab wants to access the contents of a class. |
| Example |
This accesses the balance account of BankAccount.
function
ans = getBalance(ba)
ans = ba.balance;
Without this accessor, you cannot access anything inside the BankAccount class even to get its balance. Consider a class a private file which cannot be accessed without going through the proper channels, i.e an accessor
|