Oscar
Oscar

Reputation: 23

MATLAB - automatically apply obj references in function

when working with objects in Matlab I constantly have to type

"obj.x, obj.y"

Is there a way to automatically set my matlab functions to apply the obj. reference, so I can just type x and y.

currently i must type as follows:

z = function(obj) z=obj.x+obj.y

i would like to type z = function(obj) z=x+y

Upvotes: 1

Views: 39

Answers (1)

Andrew Janke
Andrew Janke

Reputation: 23858

No. Sorry; this is just how Matlab works; object references are always explicit.

Upvotes: 1

Related Questions