how to put heading for columns of matrix?

Réponses (3)

Azzi Abdelmalek
Azzi Abdelmalek le 4 Oct 2013
h={'I' 'J' 'K'}
A= [2 3 4;4 5 4;3 8 7]
M=[h;num2cell(A)]

5 commentaires

suvadip paul
suvadip paul le 5 Oct 2013
Now the elements are within []. I dont want it
If you want you can use uitable
h={'I' 'J' 'K'}
A= [2 3 4;4 5 4;3 8 7]
f=figure('position',[200 200 400 180])
t=uitable('parent',f,'data',A,'columnname',h,'columnwidth',{100},'position',[10 10 350 170])
Trishal Zaveri
Trishal Zaveri le 19 Fév 2018
How would you do this the same way if you wanted to add row labels to the same question?
hadiqa khan
hadiqa khan le 2 Avr 2018
the table window appears with the name figure how to name this table created by code provided by you??
Busra Unlu
Busra Unlu le 3 Jan 2021
thx

Connectez-vous pour commenter.

If you have MATLAB 2013b, I would look into using tables
doc table

2 commentaires

suvadip paul
suvadip paul le 5 Oct 2013
Is there any way to get Matlab 2013b free?
No but earlier versions of MATLAB have datasets in the statistics toolbox. They provide similar functionality.
doc dataset

Connectez-vous pour commenter.

anahita ahrari
anahita ahrari le 6 Juin 2018

0 votes

how can i add titles to a column in matlab ?

Catégories

En savoir plus sur Characters and Strings dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by