finding the minimum value
1 次查看(过去 30 天)
显示 更早的评论
I have a code performing inverse dualtree dwt
for j1 = 1:size(A1_20,3)
for j = 1:J
% loop thru subbands
for s1 = 1:2
for s2 = 1:3
w{j}{s1}{s2} =A1_20(:,:,j1);
y1 = idualtree2D(w, J, Fsf, sf);
Er= mean2((single(x) - single(y1)).^2);
final_col2{j1}=Er;
end
end
end
end
I have 5 images w denotes it,and A1_20(:,:,j1) contains 20 matrices of ,I have multiplied those matrices,with image so for each image i get 20 images and have found error,now i want to display the image with minimum error ,like this i want to do for 5 images
please help
0 个评论
回答(2 个)
Sean de Wolski
2012-5-10
Use the second output argument from min() and the correct dim input to min() to tell you where the minimum is.
Sargondjani
2012-5-10
i have difficulty understanding your code... but lets say you have: w(:,:,1:5)
you can add another loop (iw=1:5;), store the errors in a vector: Er(iw,1).
Then
[value,index]=min(Er); %if Er is not a vector, then add the dimension (like Sean says)
w(:,:,index) gives you the matrix that minimized the error
something like that
4 个评论
Sargondjani
2012-5-11
do you understand my method??
i mean, i prefer not to spell out solutions, but to give exampls so you can figure out the details yourself :-)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!