How to compare two matrices in a cell array
1 次查看(过去 30 天)
显示 更早的评论
I have a cell array of size 1 x n, i need to compare two matrices at a time such as 1-2, 1-3, 2-3... how to take two different matrices at a time in a loop?
eg:
If it is a cell array of size 1 x 3, it becomes, 1-2, 1-3, 2-3
If it is a cell array of size 1 x 4, it becomes, 1-2, 1-3, 1-4, 2-3, 2-4, 3-4
0 个评论
采纳的回答
Niels
2017-1-25
use 2 for loops
for i=1:n-1
for j=i+1:n
% compare whatever you want with cell{i}...cell{j}
end
end
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!