How can a create uitable with dynamic columns?
4 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(2 个)
Vijay Nahar
2014-7-8
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!