finding the coordinates of a value in a cell array
Show older comments
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
Accepted Answer
More Answers (1)
AA
on 11 Dec 2014
Categories
Find more on Shifting and Sorting Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!