how to give column header name
1 次查看(过去 30 天)
显示 更早的评论
block=[1 10;2 11;3 12;4 13;5 14]
how to make individual column name? like c1=channel and c2=quality and display the column with header name
0 个评论
采纳的回答
madhan ravi
2020-7-3
BLOCK = table;
BLOCK.channeL = block(:, 1);
BLOCK.quality = block(:, 2)
5 个评论
Image Analyst
2020-7-3
编辑:Image Analyst
2020-7-3
No you didn't (capitalization was wrong) but in your defense it might have been a bad idea to name the table BLOCK when the other variable was named block. Try this:
block=[1 10;2 11;3 12;4 13;5 14]
t = table;
t.channel = block(:, 1);
t.quality = block(:, 2)
t =
5×2 table
channel quality
_______ _______
1 10
2 11
3 12
4 13
5 14
Or try this:
block=[1 10;2 11;3 12;4 13;5 14]
t = table(block(:, 1), block(:, 2), 'VariableNames', {'channel', 'quality'})
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Classification Ensembles 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!