Syntax
subpn=VMgetSubplot
Output Parameter
subpn : | | current subplot position; empty if figure is not valid |
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, VMgetSubplot
, is designed to return the current active subplot number from a VMplot figure, specifically the subplot where the last VMginput position was taken.
Input Parameters
The function does not take any input parameters.
Global Variables
VMplothandle
: A global variable representing the handle to the VMplot figure.
Output
subpn
: The number of the current active subplot. It returns an empty value if the figure is not valid.
Algorithm Steps
- The function begins by checking if the global variable
VMplothandle
is a valid figure handle using the isvalid
function.
- If
VMplothandle
is valid, the function retrieves the title of the current axes using get(gca, 'Title')
and then gets the string of the title with get(t, 'String')
.
- The function then checks the content of the title string to determine the subplot number:
- If the title contains 'y/z', it sets
subpn
to 1.
- If the title contains 'x/z', it sets
subpn
to 2.
- If the title contains 'x/y', it sets
subpn
to 4.
- If none of these conditions are met, it sets
subpn
to 0.
- If
VMplothandle
is not valid, the function sets subpn
to an empty array.
Algorithm explaination created using ChatGPT on 2025-08-18 22:27. (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