I got a package which can be loaded in MMA. The manual for the package does not give demonstrations of all functions/commands. Hoe can i find all the commands in the package?
1 Answer
$\begingroup$
$\endgroup$
Once you've loaded the package in with Needs
then you can find all the included functions using Names
with a wildcard:
Needs["VariationalMethods`"]
Names["VariationalMethods`*"]
(* {"EulerEquations", "FirstIntegral", "FirstIntegrals",
"NVariationalBound", "VariationalBound", "VariationalD"} *)
or
Needs["PolyhedronOperations`"]
Names["PolyhedronOperations`*"]
(* {"Geodesate", "OpenTruncate", "Stellate", "Truncate"} *)
This works with user-installed packages as well, like MaTeX
Needs["MaTeX`"]
Names["MaTeX`*"]
(* {"BlackFrame", "ClearMaTeXCache", "ConfigureMaTeX", "MaTeX"} *)
You can even use it to see the private function names, here again on a user-defined package, but this one is likely to give a long list, giving any variables that are defined within scoping constructs like Module
in the package,
Needs["DivergentColorMaps`"]
Names["DivergentColorMaps`*"]
Names["DivergentColorMaps`Private`*"]
(* {"CoolToWarm", "DivergentColorFunc", "DivergentColorScheme", "DivergentMaps"} *)
(* {"DivergentColorMaps`Private`a",
"DivergentColorMaps`Private`adjusthue",......
"DivergentColorMaps`Private`rgb2msh",
"DivergentColorMaps`Private`rgb2xyz", ..........
"DivergentColorMaps`Private`z", "DivergentColorMaps`Private`zi", \
"DivergentColorMaps`Private`z$"} *)
Names["NDSolve`FEM`*"]
, using the wildcard * character $\endgroup$Names["MyPackage`*"]
. Also likely to be useful for an external package:Names["MyPackage`Private`*"]
$\endgroup$Needs["...."]
first. But for a package of my own that I have in a special folder (in the $Path) that I use for packages, I had to load it in withNeeds
before I could get theNames
$\endgroup$