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

1 回表示 (過去 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
  1 件のコメント
James Tursa
James Tursa 2020 年 8 月 3 日
Too vague. Please provide some small examples showing input and desired output.

サインインしてコメントする。

採用された回答

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 Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by