Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

Dependent properties vs functions

Asked by Saifullah on 12 Jun 2012

Suppose I have a class that represents rectangles, such that it contains the stored properties 'length' and 'width', and I wish to find the area ... it seems to me that I can define it either as a dependent property (and use the get method to get the area), or as a function (which will return the area).

What is the difference between these two alternatives? After all, to calculate the area for a rectangle object (called rect, say), we would use the same syntax, namely: rect.area

Thanks in advance for your help :-)

0 Comments

Saifullah

Products

No products are associated with this question.

0 Answers

Contact us