How to write, Title of the Graph should be based on the input parameter values.
2 次查看(过去 30 天)
显示 更早的评论
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).
0 个评论
回答(1 个)
dpb
2024-9-24
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 个评论
dpb
2024-9-24
编辑:dpb
2024-9-24
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
2024-9-24
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Develop uifigure-Based Apps 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!