Syntax
[h,old]=titleappend(txt)
Input Parameter
Output Parameter
h : | | handle to title |
old : | | old title before change |
Examples
figure;
title ('TEST'); shg
titleappend ('NEW')
Copyright 2022-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, titleappend
, is designed to append a given text to the current title of a plot in MATLAB. It is part of the SolidGeometry library, version 5.1, and was created by Tim Lueth in January 2022.
Input Parameters
- txt: A string that represents the text to be appended to the current title of the plot.
Output Results
- h: A handle to the updated title of the plot.
- old: The original title of the plot before the text was appended.
Algorithm Steps
- Retrieve the current title of the plot using the function
getgcatitle
and store it in the variable old
.
- Check if the input
txt
is not empty.
- If
txt
is not empty, update the title of the plot by appending txt
to the existing title, separated by a hyphen. This is done using the title
function with sprintf
to format the new title string.
- Return the handle to the updated title as
h
and the original title as old
.
Example Usage
The function can be used as follows:
figure;
title('TEST');
shg;
titleappend('NEW');
In this example, a figure is created with the initial title 'TEST'. The function titleappend
is then called with the text 'NEW', resulting in the title being updated to 'TEST - NEW'.
Algorithm explaination created using ChatGPT on 2025-08-18 22:15. (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