Effacer les filtres
Effacer les filtres

Create help that displays in the help window for a variable that loads in the workspace.

1 vue (au cours des 30 derniers jours)
Hi,
Im working with a quite large number of arrays and variables in the workspace and I would like to know if it is possible to write a help file for them.
I know I can do it for a self created function at the beginning, but I am trying to do so for the variables so when I define :
B_friends= [4 6 5 2 6 8 9 12 56]
And I click on B_friends later on and on Help I can see what B_friends ( Birthday friends) means. This example is stupid but I am dealing with a lot of different names and I would like to avoid going to the begging each time to the place where I defined it (that might be another file).
Thanks in advance

Réponse acceptée

John D'Errico
John D'Errico le 21 Oct 2017
There is no facility to provide user written help on a variable, or mouseover capability to do the same.
Perhaps an option is to use structs. Include in each struct a help field, as well as a field that actually contains the information in the variable. Or, you could write your own class to do the same. In any case, these variables will be more cumbersome to work with and use. I seriously doubt it is worth the effort.
As Rik suggested, a good option is to learn to use descriptive variable names. Don't name your variables a,b,c, etc. There is no charge for longer variable names, and a good descriptive name is well worth the effort, in terms of debugging and just ease of use. Tab completion will make things easy.

Plus de réponses (1)

Rik
Rik le 21 Oct 2017
As far as I know, it is impossible to have a mouse-over with more information for variables. The only solution would be to have clear names. Extremely long names can be a nuisance, but there tab-completion should come to the rescue.

Catégories

En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by