How can I update a cell value in a GUIDE table by using a cell with different options from a choice list menu inside the same table?

2 vues (au cours des 30 derniers jours)
In a table in Guide: I want to be able to choose a rock(geology) type from the choice list in my first column and automatically update columns 2,3 and 4 for the same row where I have chosen a rock type with a specific constant according to the rock value chosen in the choice list. I want to be able to do this for n rows in the first column. Please see the image I attached.
  2 commentaires
Geoff Hayes
Geoff Hayes le 16 Avr 2016
Alfonso - you did not attach the image. Once you have chosen it, you must press the Attach File button.
Alfonso Rodriguez
Alfonso Rodriguez le 16 Avr 2016
You are right, I just relaized that. Here it is again. Thanks Geoff

Connectez-vous pour commenter.

Réponse acceptée

Geoff Hayes
Geoff Hayes le 16 Avr 2016
Alfonso - try using the CellEditCallback for your uitable so that you can respond to the changes in the rock type. In GUIDE, select your uitable and view the CallEditCallback so that it appears in your m file. When you change the rock type, this callback will fire and the eventdata will have the information telling you what the indices of the uitable element that was manipulated (so you will only care about those elements in the first column), what the previous data was and what the new data is. With that you should be able to update the row (obtained from eventdata.indices).
  6 commentaires
Geoff Hayes
Geoff Hayes le 18 Avr 2016
Alfonso - you have to get the all of the data that is in the table and then set the particular row elements to their new values. You then set uitable with this new data. Please copy and paste the code that you are using to update a single row so that we can see what the problem may be.
Alfonso Rodriguez
Alfonso Rodriguez le 25 Avr 2016
Hello Geoff. I was finally able to use and modify the elements of a cell within a uitable in Guide. All I had to do was access each element of the cell with { }. Then using a switch statement to check the selection made by the user in the choice list that I had created through the table property editor of the uitable1. Thanks for trying to help.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by