MATLAB Answers

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

1 view (last 30 days)
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
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

Accepted Answer

Ameer Hamza
Ameer Hamza on 5 Oct 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}

Sign in to comment.

More Answers (0)


Community Treasure Hunt

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

Start Hunting!

Translated by