Hello,
I would like to add a new columns which consist of rows of the table:
As seen in the figures, I want to redesign my dataset in a dynamic way. Could you please help?
Thanks in advance

 채택된 답변

Voss
Voss 2022년 10월 26일

0 개 추천

My guess:
% matrix as in 1.png:
data = reshape(1:21,3,[]).'
data = 7×3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
% new columns to be added:
new_data = (4:9)+3*(0:6).'
new_data = 7×6
4 5 6 7 8 9 7 8 9 10 11 12 10 11 12 13 14 15 13 14 15 16 17 18 16 17 18 19 20 21 19 20 21 22 23 24 22 23 24 25 26 27
% append the new columns to the end of data matrix:
data = [data new_data]
data = 7×9
1 2 3 4 5 6 7 8 9 4 5 6 7 8 9 10 11 12 7 8 9 10 11 12 13 14 15 10 11 12 13 14 15 16 17 18 13 14 15 16 17 18 19 20 21 16 17 18 19 20 21 22 23 24 19 20 21 22 23 24 25 26 27

추가 답변 (1개)

the cyclist
the cyclist 2022년 10월 26일

0 개 추천

You really don't give enough detail about what you are trying to do. You are making us assume and/or guess too much. Maybe you want the reshape command?

카테고리

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

제품

릴리스

R2020b

태그

질문:

2022년 10월 26일

답변:

2022년 10월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by