How to set a column element from a text array in uitable GUI

I have a problem. I have created a Table, using Matlab GUI. And, in my uitable, I want to assign a column or a row elements from a text array in my m-file code. In my m-file, I created a array like;
a={'John';'Kevin';'Steffi'};
I have uploaded a picture which shows my situation and my simple gui application.
To sum up, I want to set 'Name' column's element to John, Kevin, Steffi; not all of them NaN.
Please, help me.

 채택된 답변

KL
KL 2017년 11월 10일
Put all your table data in a cell array and then update them, not just one column.
data = {'John',12;'Kevin',46;'Steffi,23};
then if T is your uitable,
T.data = data;

댓글 수: 3

Due to my programming aim, I have to call name and number values from array in m-file. So, in my m-file status can be like this;
a={'John';'Kevin';'Steffi';'Simon'}; b=[12;46;23;33];
Also, a and b elements are created in different function.
At this point, how can i merge a and b arrays with the aim of creating data array?
data = [a num2cell(b)]
Thanks

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기

질문:

2017년 11월 10일

댓글:

2017년 11월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by