필터 지우기
필터 지우기

How to make a matrix of zeros and ones with a specific distance between each one?

조회 수: 3 (최근 30일)
Hi!
I need to make a matrix of zeros and ones with a specific distance between each one. This distance is an input value, which means that the distance between one's it's variable.
Any suggestion?
Thanks

채택된 답변

Bruno Luong
Bruno Luong 2020년 8월 3일
dmin1=3;
n=10;
A=zeros(n);
A(1:dmin1:end,1:dmin1:end)=1;
disp(A)
  댓글 수: 1
Oliver Lestrange
Oliver Lestrange 2020년 8월 18일
Passing this to an image I get the 1's with just 1 pixel. How can I make the matrix bigger, in order to have more pixels, and has the 1's with more than 1 pixel?

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by