필터 지우기
필터 지우기

A question about moving dot. please help.

조회 수: 2 (최근 30일)
Or Peer
Or Peer 2018년 5월 31일
답변: Steven Lord 2018년 5월 31일
I need to Create a "movie" that will move a white dot(that its position is chosen randomly) over a black surface, create a zeros image and each time change a single value to 1.
how do I do it?
  댓글 수: 1
KSSV
KSSV 2018년 5월 31일
Move by a single value 1 to where?

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

답변 (2개)

OCDER
OCDER 2018년 5월 31일
Not sure if it's an assignment, but here are more hints to achieve that:
  1. Use zeros(M, N) to make a zero image of size MxN called ZeroImage.
  2. Use randi(X) to select a random number between 1 and X. This is used to select a random row and column in ZeroImage.
  3. Set this random pixel to 1 to make a dot. ZeroImage(x, y) = 1.
  4. Display your images via implay, or via imshow within a for loop. NOTE: for implay, you'll have to make ZeroImage a MxNxF matrix instead, where F is the frame number.

Steven Lord
Steven Lord 2018년 5월 31일
This sounds like it may be homework so I'm not going to post the answer, just point you to some functions and topics that may be of use to you.
If you need further help, show us what you've tried and ask a specific question about where you're having difficulty and we may be able to offer some more specific guidance.

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by