MATLAB Documentation for OOP
(For reference by students)


 

MODIFIER METHOD
Definition The method called whenever Matlab wants to modify the contents of a class.
 
Example
This modifies the balance account of BankAccount.
 

function setBalance(acct, amount)

        acct.balance = amount;
        assignin('caller', inputname(1), acct);
 

Without this modifier, you cannot modify anything inside the BankAccount class.

Consider a class a private file which cannot be modified without going through the proper channels, i.e a modifier

 


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

Website created & maintained by Shardul Bhatia and Wen Eu Cheah