titleappend

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - User interface
Introduced first in SolidGeometry 5.1, Creation date: 2022-01-27, Last change: 2025-09-15

appends a string to the gca title



See Also: getgcatitle

Example Illustration

 missing image of titleappend(txt)

Syntax

[h,old]=titleappend(txt)

Input Parameter

txt: text to append

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

Output Results

Algorithm Steps

  1. Retrieve the current title of the plot using the function getgcatitle and store it in the variable old.
  2. Check if the input txt is not empty.
  3. 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.
  4. 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