Display matrix with row and column labels

3 ビュー (過去 30 日間)
Turgut
Turgut 2013 年 11 月 10 日
コメント済み: Azzi Abdelmalek 2013 年 11 月 10 日
Hi all,
Is there a convenient way to display a matrix with row and column labels in the Matlab terminal? Something like this:
In the second row it will calculate x^2+4 also.
I know it is easily can be shown with the code:
x = 1:100;
table = [x; x.^2+4]
But it seems a bit nasty.
I will be happy if you will able to help. Thanks...

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 11 月 10 日
Use uitable
x=1:10
M=[x;x.^2+1]
r={'x' 'x^2+1'}
f=figure('position',[100 100 900 200])
t=uitable(f,'data',M,'rowname',r,'position',[0 0 850 200])
  3 件のコメント
Turgut
Turgut 2013 年 11 月 10 日
And can I use the same solution to;
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 11 月 10 日
x=1:10
M=[x;x.^2+1]'
r={'x' 'x^2+1'}
f=figure('position',[400 400 300 500])
t=uitable(f,'data',M,'columnname',r,'position',[0 0 250 500])

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by