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).

답변 (1개)

dpb
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
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
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 CenterFile Exchange에서 Develop uifigure-Based Apps에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by