元胞数组,重组??循环。
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
百家乐真人网址【微8785092】
il 24 Mag 2023
Risposto: 百家乐真人网址【微8785092】
il 24 Mag 2023

想把个数相同的cell合并了,例如,图中,1,2,3,4,6,7,8行那些都只有一个数,就想把它们合并起来,然后两个元素的也合并,例如行数是5,17,18的。
不知道该怎么写代码...
0 Commenti
Risposta accettata
百家乐真人网址【微8785092】
il 24 Mag 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 Commenti
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!