add labels to columns

6 ビュー (過去 30 日間)
john birt
john birt 2012 年 3 月 22 日
I have a 'q' which is a 150 by 10 matrix (150 rows each with 10 variables).
when I look at the data in variable editor, (where its like an spreadsheet view of the data) I get the columns labeled 1,2,3,...,10.
How can I change this? How can I get the columns to have descriptive text as headers not just numeric index numbers?
I have code like
clear;
load eurofx146_c_a_3.mat;
which the file just containing the matrox 'q', then I double click on 'q' in the workspace box and it pops up the spreadsheet view of the data for 'q'.

採用された回答

Oleg Komarov
Oleg Komarov 2012 年 3 月 22 日
If you have the Statistic toolbox you can accomplish this with the dataset class.
q = rand(150,10);
names = arrayfun(@(x) sprintf('var%02d',x),1:10,'un',0);
qdat = dataset({q,names{:}});

その他の回答 (0 件)

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by