MATLAB Answers

How can i create a third uitable with the datas according to the data in the 1st and 2nd uitable in Matlab GUide?

1 view (last 30 days)
sachin narain
sachin narain on 25 Apr 2018
Commented: Walter Roberson on 13 May 2018
I have three uitables 'Tracks,profiles,Markings' in matlab Guide with poredefined datas .I have a column called 'Location' in my 1st uitable and there is anoother column called 'No.of Lanes' in the second uitable. The third table should have column called 'Direction' with values such as as 'Direct,Inverse,Direct direct ..etc. 'Location' contains datas like City,Country and Highway.No.of Lanes contains values like 1,2,3,4.
I want ,if the user selects 'City' and 'no of lanes 'as 1 the third table should show 'direct inverse and both 'as pop up datas in the 3rd uitable in the direction column.If he chooses 'City' and no of Lanes as '2' some other pop datas should come in the 'Direction' column and so on.(which is to say if a user chooses a case in the 1st and the 2nd uitable third table should show a particular pop up data set)
I have already created a cellselecction callback which will know which is the case user selcts in 'Location' column .How do i see which data user selects in the 2nd Uitable profile in the same fucntion block.and how do i create the 3rd uitable.
I am attaching the table picutre for more clarity about the question.Kindly help me. Urgent help needed

Answers (1)

Geoff Hayes
Geoff Hayes on 26 Apr 2018
sachin - since you probably have the handle to the second uitable and you know which element of that table you are interested in, then you should be able to get that value from within the cell selection (or perhaps edit?) callback of the first uitable. For example,
function uitable1_CellEditCallback(hObject, eventdata, handles)
table2Data = get(handles.uitable2, 'Data');
% check the cell element that you are interested in
% etc.
I'm using CellEditCallback as I suspect that you want to perform some kind of action only if the user has edited a cell in table 1.

  2 Comments

Sign in to comment.

Sign in to answer this question.