by Adam Danz, SG-Lib Toolbox: SolidGeometry 5.6 - User interface
, Creation date: 2015-04-17, Last change: 2025-08-18
res=lastcommand([])
res: | search results |
lastcommand PLcircle
lastcommand PLCircle % Missspelled commands
The function lastcommand is designed to search through the command history in MATLAB. It is a simple wrapper around the function HxSearch, which is part of the SG-Library. The function is attributed to Adam Danz and was created in 2015.
varargin: This is a variable-length input argument list, allowing the function to accept any number of input arguments. In the context of this function, it is used to pass search terms to the HxSearch function.res: This is the search result returned by the HxSearch function. It contains the results of the command history search based on the input parameters.The function lastcommand operates as follows:
varargin parameter.HxSearch, passing the input arguments to it. In the provided code, the call to HxSearch is hardcoded with the argument 1, which suggests that it might be a placeholder or a specific search criterion.HxSearch function is stored in the variable res.res as the output, which contains the search results from the command history.The function can be used to search for specific commands in the MATLAB command history. For example:
lastcommand('PLcircle'): Searches for the command 'PLcircle' in the history.lastcommand('PLCircle'): Searches for the command 'PLCircle', demonstrating that the function can handle misspelled commands.The function is a part of a larger library and is intended to be used in conjunction with other functions like lasttouchedSG, whichTL, and lastcommandfnctn.