Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How to set variable column names in a uitable?

Subject: How to set variable column names in a uitable?

From: Camille Couzi

Date: 13 Dec, 2010 13:49:27

Message: 1 of 2

Hi matlabers,
I need your help on something I sure it is not so complicated.
I mam working with a GUI, where I load data in tables (.xls for example), matrix which have a size m*n.

I want to create a uitable with statistics, making the mean, max, min ect... for each column of my matrix.
So as column names I would like to have "column1","column 2",..."column n". however, I don't know how to make that, I have tried:
for i=1:size(matrix,2)
          columns(i)=i;
end
cnames = {'',num2str(columns(i))};

and that don't work.

If somebody can help me that would be really great.
Thanks in advance

Camille.

Subject: How to set variable column names in a uitable?

From: matt dash

Date: 16 Dec, 2010 16:03:05

Message: 2 of 2

"Camille Couzi" <camillecouzi@yahoo.fr> wrote in message <ie5897$kl3$1@fred.mathworks.com>...
> Hi matlabers,
> I need your help on something I sure it is not so complicated.
> I mam working with a GUI, where I load data in tables (.xls for example), matrix which have a size m*n.
>
> I want to create a uitable with statistics, making the mean, max, min ect... for each column of my matrix.
> So as column names I would like to have "column1","column 2",..."column n". however, I don't know how to make that, I have tried:
> for i=1:size(matrix,2)
> columns(i)=i;
> end
> cnames = {'',num2str(columns(i))};
>
> and that don't work.
>
> If somebody can help me that would be really great.
> Thanks in advance
>
> Camille.


 cnames=cell(size(matrix,2),1);
 for i=1:size(matrix,2)
           cnames{i}=['column ',num2str(i)];
 end

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us