How to delete content of table data from gui ?
古いコメントを表示
I have in my GUI a table wich gather data from multiple edit text trough a button boxes:
global p;
val1 = get(handles.edit2, 'String');
val2 = get(handles.edit4, 'String');
val3 = get(handles.edit5, 'String');
val4 = get(handles.edit6, 'String');
val5 = get(handles.edit7, 'String');
val6 = get(handles.edit8, 'String');
val7 = get(handles.edit9, 'String');
val8 = get(handles.edit10, 'String');
val9 = get(handles.edit11, 'String');
val10 = get(handles.edit12, 'String');
val11 = get(handles.edit13, 'String');
val12 = get(handles.edit14, 'String');
val13 = get(handles.edit29, 'String');
valp1 = get(handles.edit16, 'String');
valp2 = get(handles.edit17, 'String');
valp3 = get(handles.edit18, 'String');
valp4 = get(handles.edit19, 'String');
valp5 = get(handles.edit20, 'String');
valp6 = get(handles.edit21, 'String');
valp7 = get(handles.edit22, 'String');
valp8 = get(handles.edit23, 'String');
valp9 = get(handles.edit24, 'String');
valp10 = get(handles.edit25, 'String');
valp11 = get(handles.edit26, 'String');
valp12 = get(handles.edit27, 'String');
valp13 = get(handles.edit30, 'String');
p.MyData = [p.MyData ; [{val1} {val2} {val3} {val4} {val5} {val6} {val7} {val8} {val9} {val10} {val11} {val12} {val13}...
{valp1} {valp2} {valp3} {valp4} {valp5} {valp6} {valp7} {valp8} {valp9} {valp10} {valp11} {valp12} {valp13}]];
set(handles.uitable1, 'Data', p.MyData);
All I want is to create a button for deleting entire content of the table like this:
tableData = get(handles.uitable1,'Data');
charLocations = cellfun(@ischar, tableData);
tableData(charLocations) = {''};
tableData(~charLocations) = {[]};
set(handles.uitable1, 'Data', tableData);
The problem is after the table data's are delete it and I press the button for gather new data from forms, all the old information come back in the table including the new one. Supose that some how must to clear some buffer or something...
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Text Files についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!