Error using get command

1 回表示 (過去 30 日間)
Niraj
Niraj 2014 年 2 月 5 日
回答済み: Sean de Wolski 2014 年 2 月 5 日
Hi, I have made an object named player use to access my video files. When I am trying to access its properties using get, it shows me following error:
obj = player('test.seq');
get(obj,'FrameRate')
Error using get
Conversion to double from player is not possible.
however if I use only
obj.FrameRate
I am able to access the property. The matlab documentation for get says that we can use the get property to access the properties of the object. Then why am I getting such error?
All the properties in player is defined as public. Please help. Thanks

回答 (1 件)

Sean de Wolski
Sean de Wolski 2014 年 2 月 5 日
obj.FrameRate
Is the preferred way to get the property. If you would like set and get to work like they do with graphics objects, have your class inherit from hgsetget.
In general, I wouldn't recommend this.

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by