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

조회 수: 2 (최근 30일)
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

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 10월 5일
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
taimour sadiq
taimour sadiq 2020년 10월 6일
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;

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by