Change Size of Array in table
조회 수: 15 (최근 30일)
이전 댓글 표시
Hey All,
I am new to Matlab and have a table with a subtable in some cells. My main Table (MM) has dynamic size and the subtable, which is in the 9th cell of each row has to have a subtable with the width of the hight of the Maintable. I have trouble if i add a row to add a column to the subtable. My Idea is:
for i = 1:size(MM,1)
MM{i,9} = table([MM{1,9}{1,1} 1]);
end
Following error message comes up: "Subscripted assignment dimension mismatch for table variable 'Var1'."
I also tried the following:
for i = 1:size(MM,1)
MM{i,9}{1,1} = [MM{1,9}{1,1} 1];
end
Following error message comes up: "The value on the right-hand side of the assignment has the wrong width. The assignment requires a value whose width is 3."
It seems like I cant change the size of the subtable but dont get why. Please help me.
Thank you!
Arne
댓글 수: 2
dpb
2020년 8월 24일
Attach a .mat file with a small example of the table structure and illustrate what you want the result to be...
채택된 답변
Nagasai Bharat
2020년 8월 27일
Hi Arne,
My understanding is that you are looking into changing the dimensions of your sub-tables. In MATLAB you would be able to add nested/sub tables inside your main table of desirable width/variables but the number of rows of each sub-table should be equal to the number of rows of the main table.
For reference please do look into this answer.
https://www.mathworks.com/matlabcentral/answers/541568-nested-tables-with-duplicate-sub-column-names
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Nucleotide Sequence Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!