Inserting a 0 before a number and use of a comma in a cell of a uitable

조회 수: 1 (최근 30일)
Harold
Harold 2012년 2월 14일
편집: Youssef Khmou 2013년 10월 13일
I'm using GUIDE to make a user interface. The user inputs values for the number of points in the u direction and for the v direction. This will create a table u by v. In each cell of this table I want to be able to enter in 3 numbers with comma's separating the numbers. These correspond to (x,y,z) coordinates. When I try to use a comma to separate the numbers, the comma disappears. So instead of getting 1,2,3 I get 123. Also, I would like to use 0 in front of numbers. For example, right now if I use 0,1,2 I get 12. This table is created in a new figure. I would really like to have a window appear that just contains the table and now menu options. For now I'm creating the table in a new figure.

답변 (1개)

Walter Roberson
Walter Roberson 2012년 2월 14일
In order to use commas or leading zeros in uitable, the cell has to be marked as being of type string rather than anything numeric.
uitable does not inherently create a new figure, not if there is an existing figure that is the focus. On the other hand, if there is not existing figure or no figure is currently the focus and the uitable is not parented against an existing figure or uipanel, then a new figure would be created to hold the uitable.
  댓글 수: 2
Harold
Harold 2012년 2월 15일
I tried looking around the internet on how to change the cell types to string. I can't seem to find anything.
And as for the figure. I would like to not use the figure to display the table but rather display it in a new GUI, which I called table.m. Would I just take the inputs from the main GUI and pass them into the table GUI to create the table?
Harold
Harold 2012년 2월 15일
I figure out how to display the table in another GUI. I am still having problems setting the columns to accept leading zeros and comma's.

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

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by