finding the coordinates of a value in a cell array
Mostra commenti meno recenti
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
Risposta accettata
Più risposte (1)
AA
il 11 Dic 2014
Categorie
Scopri di più su Shifting and Sorting Matrices in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!