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

 채택된 답변

madhan ravi
madhan ravi 2020년 7월 3일

0 개 추천

BLOCK = table;
BLOCK.channeL = block(:, 1);
BLOCK.quality = block(:, 2)

댓글 수: 5

raqib Iqbal
raqib Iqbal 2020년 7월 3일
block=[1 10;2 11;3 12;4 13;5 14]
block = table;
block.channeL = block(:, 1);
block.quality = block(:, 2)
it is showing
Error using Code_sumup (line 5)
Variable index exceeds table dimensions.
madhan ravi
madhan ravi 2020년 7월 3일
Did you read my answer properly??
raqib Iqbal
raqib Iqbal 2020년 7월 3일
yes sir
Image Analyst
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'})
madhan ravi
madhan ravi 2020년 7월 3일
Thank you sir Image Analyst :)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Communications Toolbox에 대해 자세히 알아보기

태그

질문:

2020년 7월 3일

댓글:

2020년 7월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by