필터 지우기
필터 지우기

generate n numbers of static text boxes in a gui

조회 수: 2 (최근 30일)
Shree Nath
Shree Nath 2012년 9월 27일
답변: elvis okacha 2019년 4월 19일
how do i generate n numbers of static text boxes automatically? i.e. i dont have to go through guide in manually selecting each textbox.. coz here n is very large, in orders of 500s.. or is there any other text box type option available which can be generate automatically through a loop?
  댓글 수: 4
Sean de Wolski
Sean de Wolski 2012년 9월 28일
@Shree: why? What does a uitable not offer that an array of text boxes would.
Shree Nath
Shree Nath 2012년 9월 28일
you see thats what i actually am doin.. uitable wud require more formatting..

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2012년 9월 27일
TextItems = {'Hello', 'klaatu', 'MATLAB', 'cephaloid'};
for K = 1 : length(TextItems)
texthandles(K) = uicontrol('Style', 'text', 'String', TextItems{K});
end
You would probably want to enhance this to control the position of the items.
  댓글 수: 8
elvis okacha
elvis okacha 2019년 4월 14일
Matias R2015a
Walter Roberson
Walter Roberson 2019년 4월 15일
elvis okacha:
Are you using GUIDE for your GUI?
What error are you encountering?

댓글을 달려면 로그인하십시오.

추가 답변 (6개)

elvis okacha
elvis okacha 2019년 4월 19일
It worked.i had placed guidata(hObject,handles) outside the for loop

elvis okacha
elvis okacha 2019년 4월 19일
I am able to display values at any point on the image.however,I want to display the values at the exact co-ordinates obtained by getpts().if I set the position,the points do not display at the selected points but are far away or sometimes nowhere close to the initial coordinate.kindly help
  댓글 수: 12
elvis okacha
elvis okacha 2019년 4월 19일
Which folder do I place the codes.do I put in bin?
Walter Roberson
Walter Roberson 2019년 4월 19일
The question I was answering was for creating static text boxes automatically. That is something you might do if you are creating a user interface. It is not something you would do to label coordinates in a plot. uicontrol() are for user interface purposes; you would use text() to label nodes.
Use the Add-On Explorer to install that contribution and the explorer will automatically download and install it for you. Get Add-Ons, search for ds2nfu, click on the one marked as being by Michelle Hirsch, click to Add from GitHub, Ok downloading outside source.

댓글을 달려면 로그인하십시오.


elvis okacha
elvis okacha 2019년 4월 19일
Yes I'm using it to create a user interface.the add-on explorer appears not to work with R2015a
  댓글 수: 1
Walter Roberson
Walter Roberson 2019년 4월 19일
In that case click on the Download from GitHub button in the link I posted, and download the .zip file. Unzip it into any convenient unused directory that is not underneath where MATLAB itself is installed. Once it is unzipped, use pathtool to add the directory you installed into to your path.

댓글을 달려면 로그인하십시오.


elvis okacha
elvis okacha 2019년 4월 19일
I've installed though an error occurs that 'not enough input arguments'

elvis okacha
elvis okacha 2019년 4월 19일
Now running without error.but still value is out of position

elvis okacha
elvis okacha 2019년 4월 19일
I'm glad for your assistance.atleast the axes has maintained a region (0,0) to (1,1).is there a way I can force the image to stick to same region that is (0,0) to (1,1)?kindly

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by