MATLAB Answers

How do i append a particular set of values into a already created uitable in matlab?

1 view (last 30 days)
sachin narain
sachin narain on 3 May 2018
Edited: sachin narain on 3 May 2018
I have a uitable with 8 columns.My 3rd column name is 'Number of Lanes' and 4th column name is 'Circulation'.I already have a list of values in 'Number of lanes' column like 1,2,3,4.What i need to do is as soon as the user presses 1 in the 'Number of lanes'column,the 'Circulation' column should have a set of data and the data looks like this 'both','direct','inverse' and these datas should be displayed as a list like in 'no.of lanes column'.How do i append the data to the Circulation column as soon as the user clicks 1 in the cell. i have used cellSelectioncall back fucntion for this. I will attach my table as well as the code i have written till now and also the uitable made in guide.
Kindly help me wuith this.
function table_Profils_CellSelectionCallback(hObject, eventdata, handles)
ind_Lanes = eventdata.Indices;
data = get(handles.table_Profils,'data') ;
no_ofLanes= cell2mat(data(ind_Lanes(1),3)) ;
if double(no_ofLanes)
no_ofLanes = num2str(no_ofLanes);
switch no_ofLanes
case '1'
circulation = {'both','direct','inverse'};


Sign in to comment.

Answers (0)

Sign in to answer this question.