Greater number of matrix in a loop
1 回表示 (過去 30 日間)
古いコメントを表示
I have a loop that test the cosine similarity between test image and the database images (Training Images). I want to choose the greater 5 values of cosTheta and show them in axes
0 件のコメント
採用された回答
Steven Lord
2016 年 4 月 8 日
AFTER the loop has finished executing, sort your list of similarity values (using two output arguments) and use the locations where the maximum values are located in the original list to determine the data to read in and display.
2 件のコメント
Steven Lord
2016 年 4 月 21 日
Example:
z = [1 5 9 2 8 4 3];
[sortedZ, locations] = sort(z, 'descend')
locations(1:2) will be the indices in z of the two largest values, which were stored in sortedZ(1:2). Use that information to determine which files to plot.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!