把要比的9个3*3矩阵存到一个3*3*9的数组里,命名为a;tmp=[1 2 3;8 0 4;7 6 5];for i=1:9if a(:,:,i)==tmp %判断相等out = a(:,:,i) breakendenddisp(['第',int2str(i),'个矩阵与待比较矩阵相等'])