How to compare two matrices in a cell array

조회 수: 1 (최근 30일)
Elysi Cochin
Elysi Cochin 2017년 1월 25일
답변: Niels 2017년 1월 25일
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

채택된 답변

Niels
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개)

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by