1. Engineering
2. Computer Science
3. matlab this should be the output please provide a working...

# Question: matlab this should be the output please provide a working...

###### Question details

Matlab This should be the output: Please provide a working code, this one does not work:

I YOU HAVE ANY DOUBTS COMMENT BELOW I WILL THERE TO HELP YOU

RATE THUMBSUP

CODE:

% Rean an image into A

% Convert the image A into grayscale image B
B = rgb2gray(A);

% Normalize image B to C
C = im2double(B);

% Calculate the threshold binary image
% First method
bw1 = C(1:end, 1:end) >= 0.3;

% Second method
bw2 = zeros(size(C));
% find indexes above or equla to thresholr
ind_above = (C >= 0.3);
% set value abouve to 1
bw2(ind_above) = 1;

% Calculate using matlab built-in function im2bw
bw3 = im2bw(C, 0.3);

% Comprare the results
if (bw1 == bw3)
if (bw2 == bw3)
disp('My two methods worked.');
end
else
disp('One of my two methods or both did not work.');
end

%Display the images
subplot(2, 3, 1);
imshow(A);
title('Original Image');
subplot(2, 3, 2);
imshow(C);
title('Normalized Image');
subplot(2, 3, 4);
imshow(bw1);
title('My First Method');
subplot(2, 3, 5);
imshow(bw2);
title('My Second Method');
subplot(2, 3, 6);
imshow(bw2);
title('Matlab Method');

###### Solution by an expert tutor 