Error in storing values

6 次查看(过去 30 天)
kash
kash 2012-5-22
I have a code
for xx = 1:length(dirlist(1:2))
x = imread([pathname, dirlist(xx).name]);
x=rgb2gray(x);
x=double(x);
n = numel(x);
A1_20 = repmat(A,[1,1,20]);
t = ones(size(A));
for j1 = 1:size(A1_20,3)
p = t;
p(randi(n,3000,1)) = 0;
A1_20(:,:,j1) = A1_20(:,:,j1).*p;
w{j}{s1}{s2} =A1_20(:,:,j1);
y1 = idualtree2D(w, J, Fsf, sf);
Er= mean2((single(x) - single(y1)).^2);
final_col2{xx}=min(Er)
% figure,imshow(uint8(y1))
Er1= mean2((single(x) - single(y1)).^2)/20;
Mse{j1}=Er1
end
end
end
end
end
i have taken two images,Mse{j1} stores error for only second image,i want even for 1st image to be stored,the second image error values is overwriting the first ,please help how to store both
  2 个评论
Jan
Jan 2012-5-22
What is the difference to your last questions http://www.mathworks.com/matlabcentral/answers/39045-displaying-the-image ?
Posting duplicate questions wastes the time of the ones, who want to assist you voluntarily. I appreciate, that you've formatted the code this time, but you still hesitate to do this in the other thread and you do not reply to my questions there. Therefore I assume, that you do not want me to help you and that's ok.
kash
kash 2012-5-23
Jan i think you have mistaken ,both are different questions,the cyclist has answered for my question,i have replied to u in my previous thread,only after his reply i have posted the duplicate question,I did not think u will delete it,i want every one to help me,if possible plz answer my question posted above

请先登录,再进行评论。

采纳的回答

the cyclist
the cyclist 2012-5-22
I haven't looked in detail, but it looks like the variable xx counts over your images? So, if you replace this line
Mse{j1}=Er1
with this
Mse{xx,j1}=Er1
do you get everything you want stored in Mse?
  1 个评论
kash
kash 2012-5-22
Thanks a lot i got as i required ,now a small thing in that i want to find the minimum error and display the image which has minimum error ,please help,so i will get 2 images

请先登录,再进行评论。

更多回答(0 个)

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by