Error in storing values
6 次查看(过去 30 天)
显示 更早的评论
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
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.
采纳的回答
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?
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!