how to split a table to multiple table?
显示 更早的评论
For example, I have the next table with dimension 16x4:
CT = [
196 146 154 244;
317 129 140 224;
246 256 314 161;
333 292 245 183;
296 246 222 293;
291 138 174 174;
229 227 164 166;
176 115 184 237;
305 316 128 158;
234 345 211 142;
313 330 135 315;
262 208 286 172;
305 316 128 158;
196 146 154 244;
313 330 135 315;
296 246 222 293
];
And I want to split it in subtables each one with a dimension of 4x4. How can i do it?
1 个评论
dpb
2021-4-2
In MATLAB that is an array or a matrix, not a table...just for nomenclature.
采纳的回答
更多回答(1 个)
jannat alsaidi
2021-4-2
you can use this way to split CT,
CT = [
196 146 154 244;
317 129 140 224;
246 256 314 161;
333 292 245 183;
296 246 222 293;
291 138 174 174;
229 227 164 166;
176 115 184 237;
305 316 128 158;
234 345 211 142;
313 330 135 315;
262 208 286 172;
305 316 128 158;
196 146 154 244;
313 330 135 315;
296 246 222 293
]
a=size(CT);
r=1;
n=1;
while n<(1+a(2))
k(:,:,n)=CT(r:a(2)*n,1:a(2))
r=r+4;
n=n+1;
end
类别
在 帮助中心 和 File Exchange 中查找有关 Tables 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!