Convert image to black white without using gray bands(hint, by using for matrix

hello every one I have abit of problem i need to Convert image to black white without using gray bands(hint, by using for matrix)?????; but I dont know how to use 'for'to answer it
if anyone one can help i will be greatful

2 Comments

"if anyone one can help i will be greatful"
If you provide enough information on the question, we would be grateful to you
I upload the image with the code of the example and the full quastion. Thank you in advance

Sign in to comment.

Answers (1)

One way (Hint):
% Decide any data value within the Image/matrix elements data range (Pixel value) , lets say 100
bw_result=Matrix_data>100
imshow(....)

4 Comments

I did that but he said use 'for'end' matrix to answer and I try every I know but did come up with any thing useful
[r,c]=size()
bw_result=zeros(r,c);
for i=1:r
for j=1:n
if condition
result(i,j)=1;
end
end
end
.....Complete it, do it yourself ..it's your homework question. Sugesstion to avoid loops, if possible
Thank you, I know it's my home work but my teacher didnt even gave us basic of matlab so all my study on YouTube not that I don't want to answer 😂😂
You can always use this:
for n=1
bw_result=Matrix_data>100
end
On a more serious note: you may consider doing the Onramp tutorial (which is provided for free by Mathworks). I would also suggest avoiding using the comment style that is only compatible with Octave and will not work on Matlab.

Sign in to comment.

Categories

Tags

Asked:

on 24 Jan 2021

Commented:

Rik
on 25 Jan 2021

Community Treasure Hunt

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

Start Hunting!