Syntax
b=iscalledbycmdline
Output Parameter
b : | | logical true if length(dbstack) <=2 |
Examples
iscalledbycmdline
Copyright 2017-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. 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)
This function, iscalledbycmdline
, determines whether it was called directly from the command line or not. It is part of the SolidGeometry library and serves as an auxiliary function for development purposes.
Input Parameters
The function does not take any input parameters.
Output
- b: A logical value that is
true
if the function was called directly from the command line, and false
otherwise.
Algorithm Steps
- Retrieve the call stack using the
dbstack
function and store it in variable a
.
- Check the length of the call stack:
- If the length is less than or equal to 2, set
b
to true
.
- Otherwise, set
b
to false
.
- If there are no output arguments (
nargout==0
), print a message to the command window indicating that the function was called directly from the command line.
Algorithm explaination created using ChatGPT on 2025-08-18 23:04. (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