detailed description of handle properties from command line

I'm wondering if someone here can help me out with an infrequent annoyance I encounter with handle properties in MATLAB. I am well aware that the properties associated with a handle object can be queried with the get(handle) command. However, where I begin to stumble is when I need to know the details associated with a particular property. As an example, take the figure handle property 'Position'. Not knowing much about it's behavior, by it's name, 'Position' sounds like it controls what I want so what I want to do is execute a command like:
help(get(gcf,'Position'))
to get the details of the 'Position' property. I know that I can sift through the html documentation to find the details but that is really inefficient and time consuming whereas command line help is much more efficient.
Is there a command line shortcut to report the details of an arbitrary property without having to sift through the html documentation to get the information I seek?

 Risposta accettata

inspect(gcf)
Then right click on Position > help.
EDIT 2
You can write a function to open the html at the description of the property (using the internal calls of inspector):
function helphg(h,propertyname)
classname = [];
if ishandle(h)
h = handle(h);
if ~isobject(h)
hCls = classhandle(h);
hPk = get(hCls,'Package');
classname = [get(hPk,'Name'), '.',get(hCls,'Name')];
else
classname = class(h);
end
end
helpview(['mapkey:',classname],propertyname,'CSHelpWindow');
Then simply use it as:
helphg(gcf,'Position')
EDIT 3
A question for Jan, Walter and others:
why figure has no properties:
properties(figure)

3 Commenti

Thanks, this does speed up the time to find the property details. Perhaps I need to ask for a feature to be added to the software.
That's fantastic - pretty slick! Thanks Oleg!

Accedi per commentare.

Più risposte (2)

Sorry, No, there is not.
You can use
set(gcf, 'Position') %notice this is SET
which will give you a (very) brief description of what must be paired with a 'Position' option, but it is only useful perhaps 1/3 of the time.

1 Commento

Yes, this isn't particularly useful - at least not for the 'Position' property. It seems that if someone could just simply replace the useless text provided when this command is executed with the text that is reported in the html document for the property, this would be 100% more useful command.

Accedi per commentare.

Jan
Jan il 20 Ago 2011
I simply read doc figure completely to learn the meaning and format of the properties. For learning a language it is usually necessary to drill the vocabulary.

2 Commenti

Well, the problem is that do a lot more than write MATLAB code all day. I can't devote every property/function to memory which is why I rely on the command line help so frequently. Having to go through the doc everytime I need to refresh my memory on a property is really inefficient!
I agree with Cristopher this time, I keep forgetting stuff and unfortunately you cannot use the same syntax as:
help containers.Map.KeyType
with hg.figure.Position unless the .m helper is modified by including all helps of the underlying properties.

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!

Translated by