Filter löschen
Filter löschen

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

2 Ansichten (letzte 30 Tage)
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

Akzeptierte Antwort

Bruno Luong
Bruno Luong am 3 Aug. 2020
dmin1=3;
n=10;
A=zeros(n);
A(1:dmin1:end,1:dmin1:end)=1;
disp(A)
  1 Kommentar
Oliver Lestrange
Oliver Lestrange am 18 Aug. 2020
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?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by