lastcommand

by Adam Danz, SG-Lib Toolbox: SolidGeometry 5.6 - User interface
, Creation date: 2015-04-17, Last change: 2025-08-18

lastcommand searches in the command History

Description

This function simply calls "HxSearch" of Adam Danz from 2015 which is extremely powerful and helpful. Best thanks to Adam Danz!

See Also: , lasttouchedSG , whichSG

Example Illustration

 missing image of lastcommand()

Syntax

res=lastcommand([])

Output Parameter

res: search results

Examples


lastcommand PLcircle
lastcommand PLCircle % Missspelled commands

This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

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.

Input Parameters

Output

Function Workflow

The function lastcommand operates as follows:

  1. The function is called with any number of input arguments, which are passed to the varargin parameter.
  2. The function then calls 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.
  3. The result of the HxSearch function is stored in the variable res.
  4. The function returns res as the output, which contains the search results from the command history.

Example Usage

The function can be used to search for specific commands in the MATLAB command history. For example:

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.

Algorithm explaination created using ChatGPT on 2025-08-18 22:42. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21