How can a create uitable with dynamic columns?

4 visualizaciones (últimos 30 días)
Febin Benjamin
Febin Benjamin el 8 de Jul. de 2014
Comentada: Jan el 12 de Jul. de 2014
I want to allow user to enter the total number of columns and then when the user will click 'submit' button, below I will get a table with user-specified number of columns. Can this be achieved in Matlab?
  1 comentario
Jan
Jan el 12 de Jul. de 2014
I've deleted the duplicate question. Please post question only once.

Iniciar sesión para comentar.

Respuestas (2)

Vijay Nahar
Vijay Nahar el 8 de Jul. de 2014
You could create a GUI using GUIDE. Use an edit box for the user to input a number for the rows and another edit box for the columns. Then use a pushbutton to extract the information and set up the table. The numbers can be extracted from the edit boxes by using:
row=get(handles.edit1,'string');
column=get(handles.edit2,'string');
The table can then be set using uitable. Check matlab help for correct syntax for uitable.
This code must be within the pushbutton callback, so it is activated when the pushbutton is pressed.

Joseph Cheng
Joseph Cheng el 8 de Jul. de 2014
I would check out the function uitable()

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by