How to write, Title of the Graph should be based on the input parameter values.

2 views (last 30 days)
I have created an app, where the app starts with asking Number of Class Rooms to open. After opening 'n' number of Class rooms in tab group format, In each tab There are input parameters like Class room Number, Number of columns, Number of Benches for each column. After entering the classroom number, number of columns, and number of benches for each column, Import excel buttons are generated based on the value given in number of benches for each column. After reading the data from excel, a graph is generated in the tab and the title of the graph should be in the format like : Class room number (406)_Column(1)_Bench(1).

Answers (1)

dpb
dpb on 24 Sep 2024
You didn't give us anything to work with about what the variables are, but formatting a string is simply
titlestring=compose("Classroom %d, Column %d Bench %d.",app.Classroom,app.Column,app.Bench);
title(titlestring)
The above needs to refer to the specific figure's data, of course.
  5 Comments
dpb
dpb on 24 Sep 2024
Edited: dpb on 24 Sep 2024
Pare it down to the pertinent area you are having trouble with and explain what your specific problem is in doing what you wish...90% of the code you're expecting somebody to wade through and try to decipher is totally immaterial to the question...
Just looking through the code, I don't see anything that would create the figure(s) you want labelled, to begin with; there's the code that would be pertinent, it would appear.
Sam Chak
Sam Chak on 24 Sep 2024
If the code generated by an AI bot does not produce the expected results, you may have difficulty pinpointing the lines causing issues. In that case, I recommend clearly describing in words what you want to design or include in the app. Additionally, please create a sketch of the app interface that indicates how you would like the "Title of the Graph" to be displayed in the figure.
Most human programmers do not annotate or comment on the obvious purpose of certain commands, and bots tend to use "space," while human code is generally cluttered and not easily readable by others.

Sign in to comment.

Categories

Find more on Develop uifigure-Based Apps in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!