MATLAB Documentation for OOP
(For reference by students)


 

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

 


Got comments\feedback\suggestions\complaints\anything whatsoever? Shoot the webmaster an email!

Website created & maintained by Shardul Bhatia and Wen Eu Cheah