元胞数组,重组??循环。
2 views (last 30 days)
Show older comments
百家乐真人网址【微8785092】
on 24 May 2023
Answered: 百家乐真人网址【微8785092】
on 24 May 2023

想把个数相同的cell合并了,例如,图中,1,2,3,4,6,7,8行那些都只有一个数,就想把它们合并起来,然后两个元素的也合并,例如行数是5,17,18的。
不知道该怎么写代码...
0 Comments
Accepted Answer
百家乐真人网址【微8785092】
on 24 May 2023
给你个示例,看懂了就会了
cell = {{1},{2},{3},{4},{5,6}};
Out = {};
kk = 1
for ii = 1:length(cell)
if size(cell{ii})==1
Out(kk) = cell{ii};
kk = kk+1;
end
end
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!