how to append a new column in the table keeping the existing table as it is with the column name as the system current date?
Show older comments
i want to add a new column in the table that is appended to the table with the columnname as the system current date as it shown in the code for the current date. but it should add another column for the next day rather than updating the same column. please help me how to do that... the code which i have is as under.
f = figure('Position',[200 200 700 450]); % load PersonName; %.mat file containing the names of student.
personNames = {'s1','s2','s3','s4','s5','s6','s7','s8','s9','s10',... 's11','s12','s13','s14','s15','s16','s17','s18','s19','s20',... 's21','s22','s23','s24','s25','s26','s27','s28','s29','s30',... 's31','s32','s33','s34','s35','s36','s37','s38','s39','s40'}; idNumbers = [1, 2, 3, 4, 5, 6,7,8,9,10,... 11,12,13,14,15,16,17,18,19,20,... 21,22,23,24,25,26,27,28,29,30,... 31,32,33,34,35,36,37,38,39,40]; date=datestr(now,'dd/mm/yyyy'); %system current date as column numberOfRows = length(idNumbers); dataTable = cell(numberOfRows, 3); for row = 1 : numberOfRows dataTable{row, 1} = idNumbers(row); dataTable{row, 2} = personNames{row}; dataTable{row, 3} = 'Present'; end columnname = {'StudentID', 'StudentName',date}; columnformat = {'char', 'char', 'char'}; columneditable = [true true true]; t = uitable('Units','normalized','Position',... [0.1 0.1 0.9 0.9],... 'ColumnName', columnname,... 'ColumnFormat', columnformat,... 'ColumnEditable', columneditable,... 'RowName',[],... 'Data',dataTable);
i want to add new column dynamically in the table when the date changes from the previous system date to the next date. please help me.. rpli neede very soon...thank u.
Answers (0)
Categories
Find more on App Building 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!