finding the coordinates of a value in a cell array
이전 댓글 표시
for x = 1:100
for y = 1:61
b = abs(bsxfun(@minus,q{x,y},kevin))
averagesAcrossColumns = mean(b, 2);
b = abs(bsxfun(@minus,b,averagesAcrossColumns));
b = sum(b, 2);
s{x,y} = b;
end
end
q is a cell array that has has many matrices. kevin is a variable that is a 1x60 matrix.
I want to add an additional line to the code so that I find the smallest three values ie smallest three sums in variable s. The output should give me the position in the cell array, row and column number in the matrix. Also shortening the code to make it more cpu and memory effective would be appreciated.
thanks
채택된 답변
추가 답변 (1개)
카테고리
도움말 센터 및 File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!