Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

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

2 vues (au cours des 30 derniers jours)
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
  2 commentaires
Walter Roberson
Walter Roberson le 26 Avr 2018
Duplicates https://www.mathworks.com/matlabcentral/answers/397273-how-to-create-the-datas-of-third-uitable-by-selecting-a-data-in-1st-uitable-and-a-data-in-2nd-uitab which also has an answer.

Réponses (1)

Geoff Hayes
Geoff Hayes le 26 Avr 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 commentaires
sachin narain
sachin narain le 26 Avr 2018
HEy Geoff.I dont think you cant do it like this.I am trying to do like how you said.but it doesn work
Geoff Hayes
Geoff Hayes le 26 Avr 2018
Sachin - please clarify what you mean by it doesn't work. Please show your code and the full error message.

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by