how to export value of a Variable vector to dedicated coulmn in UITable app designer

2 visualizaciones (últimos 30 días)
Hello. Need a guidence in app designer i have successfully read a text file through push button. and stored it in a varible "a".
Lets suppose
a = 1
2
3
some data in first row and whole first coulmn.
My code is
text = uigetfile('*txt','Source File');
a = readtable(text)
app.UITable.Data = a
...... now the problem is i have made 3 coulmns in appdesigner UITable to import data from 3 different text files but when i pass this value to UITable it display these value having one colomn only, it overwrites UITable Coulomns
the question is if want to pass my values of variable 'a' to 2nd coulmn of UItable... what code i should write? so when i pass some other variable "b" value to first or 3rd coulmn in UITable i may also hold the previous value of Variable "a" we passed before. i tried app.UITable(:,2).Data = a but doesnt work. kindly Guide. Thanks

Respuesta aceptada

Ameer Hamza
Ameer Hamza el 5 de Oct. de 2020
The correct solution depends on how you initialized the Data property of UITable and how did you define T. But my guess is that something like this will probably work
app.UITable.Data{:,2} = T{:,1}
  2 comentarios
taimour sadiq
taimour sadiq el 6 de Oct. de 2020
Dear Ameer thanks for ur reply. With ur Guidence and little editing the code myself it works.
uigetfile('*txt','Source File'); a = readtable(text) app.UITable.Data = a b = table2array(a) app.UITable(:,2) = b;

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by