how can I modify uitable cells
3 views (last 30 days)
Show older comments
Hi I need to be able to enter values in uitable cells (like in excel) but I don't find how to make the cells editable
this is my uitableMy_CreateFcn but still can not edit cells
UI_TABLE_EXCITATION_NUM_OF_LINES = 3;
UI_TABLE_EXCITATION_HEADERS = { 'aaa[W]','bbb[W]','ccc[gr]','ddd[gr]','eee[%]',...
'fff[%]','ggg[C]'};
% set header
set( hObject,'ColumnName', UI_TABLE_EXCITATION_HEADERS);
% set data
set( hObject,'data', cell(UI_TABLE_EXCITATION_NUM_OF_LINES, size(UI_TABLE_EXCITATION_HEADERS,2)));
% set cell format
set(hObject,'ColumnFormat',{'numeric' 'numeric' 'numeric' 'numeric' 'numeric' 'numeric' 'numeric'});
0 Comments
Answers (1)
Azzi Abdelmalek
on 27 Dec 2012
Edited: Azzi Abdelmalek
on 27 Dec 2012
set(t,'ColumnEditable',logical(1))
Example
t = uitable;
set(t,'Data',ones(5,3))
set(t,'ColumnWidth',{100})
set(t,'ColumnEditable',logical([1 0 1]))
% the first and third column are editable , the second is not.
0 Comments
See Also
Categories
Find more on Develop Apps Using App Designer in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!