Info

此问题已关闭。 请重新打开它进行编辑或回答。

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

2 次查看(过去 30 天)
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

回答(1 个)

Geoff Hayes
Geoff Hayes 2018-4-26
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.

此问题已关闭。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by