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

2 views (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
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

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}
  2 Comments
taimour sadiq
taimour sadiq on 6 Oct 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;

Sign in to comment.

More Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!