Effacer les filtres
Effacer les filtres

How to plot selected columns from UITable in app designer (2019b)?

6 vues (au cours des 30 derniers jours)
Ihab Abboud
Ihab Abboud le 19 Mai 2020
Commenté : Ameer Hamza le 19 Mai 2020
I have created an app using designer app that displays data in a UITable. I want the user to select two columns then plot them. I have figured out how to keep track of the selected indices and get the selected columns out of that.
I tried this
T = app.UITable.Data;
plot(T(:,app.ColumnsSelected(1)),T(:,app.ColumnsSelected(2)));
The problem here is that T(:,app.ColumnsSelected(1or2)) is a table so plot gives an error because it doesn’t plot tables
I have been trying this for a while now without success.
Thanks

Réponse acceptée

Ameer Hamza
Ameer Hamza le 19 Mai 2020
Modifié(e) : Ameer Hamza le 19 Mai 2020
Use brace indexing
plot(app.UIAxesName, T{:,app.ColumnsSelected(1)},T{:,app.ColumnsSelected(2)});
Also, note that first input to plot shoule be the handle to UIAxes.
  2 commentaires
Ihab Abboud
Ihab Abboud le 19 Mai 2020
oh wow, thanks.
Ameer Hamza
Ameer Hamza le 19 Mai 2020
I am glad to be of help!!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Develop Apps Using App Designer dans Help Center et File Exchange

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by