| CS 1371 Dept. Presents: |
| CHAR METHOD | |
|---|---|
| Definition | The method called whenever Matlab wants to display the contents of an object |
| Example |
function
s = char(ba)
s =
sprintf(
'Basic Bank Account with $%8.02f\n',
…
ba.balance );
This function is a toString for the BankAccount class. It returns a string representation of the account when called by display.m |