What is the code to do The image that i have downloaded in the box?

 채택된 답변

Matt J
Matt J 2022년 3월 20일

1 개 추천

b=repmat(linspace(0,1,128),128,1);
e=ones(size(b));
I=[b, e;e,fliplr(b)];
I(116:140,116:140)=0;
imagesc(I); colormap(gray(256)); axis square;

댓글 수: 3

fatma karkosh
fatma karkosh 2022년 3월 20일
Thank you so much but my supervisor want me to do this with for loop if you could please to help me with for loop @Mat J
Matt J
Matt J 2022년 3월 20일
I might be able to help if I could see what I'm helping you with. You haven't posted any of your code.
Image Analyst
Image Analyst 2022년 3월 20일
Yes, like Matt said, give your code, because your supervisor wanted you to do it with a for loop. He did not want Matt to give him for-loop code. He wanted you.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2022년 3월 20일
편집: Image Analyst 2022년 3월 20일

1 개 추천

This is just super basic assigning of values. If you can't do that, then you won't be able to do anything more in MATLAB once you have that image. Then you'll have to ask us how to do the next part. Become self sufficient by investing only a short 2 hours here:
After that you'll easily be able to make that image on your own. Hint -- some functions that may be involved
zeros(), ones(), linspace(), round(), tril(), triu(), as well as basic assignments like
ramp = 1:256;
grayImage(row1:row2, col1:col2) = 0;
Use polyfit() and polyval() if you want to burn in slanted white lines.
Not only will you be able to make that simple image but you'll be set up to do lots more complicated ans sophistcated things too. It's well worth 2 hours of your time.
For the text, you can use text() if you want the text in the overlay above the image. If you have the Computer Vision Toolbox you can use insertText() to burn text into the image pixels.

카테고리

도움말 센터File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

제품

릴리스

R2021b

태그

질문:

2022년 3월 20일

댓글:

2022년 3월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by