How to make a matrix has more pixels?

4 ビュー (過去 30 日間)
Oliver Lestrange
Oliver Lestrange 2020 年 8 月 18 日
コメント済み: Walter Roberson 2020 年 8 月 18 日
Hi,
Apparently when I use the following code I am creating a matrix with 15x15 pixels.
dmin1=2;
n=15;
manhattan=ones(n,n,3);
manhattan(2:dmin1:end,2:dmin1:end,:)=0;
imwrite(manhattan,'matrix_15x15.png');
How can I make it bigger, in order to see the black points (the 0's) bigger?
To make something like:
Supose that the 0's are 32 pixel...
Then I do something like 32 pixel are 20 meters...
So, I need the 0's be bigger than 1 pixel.
Any suggestion?
  8 件のコメント
Oliver Lestrange
Oliver Lestrange 2020 年 8 月 18 日
Walter Roberson, are you saying that with the checkerboard function I can display the squares in other positioning other than chess?
Walter Roberson
Walter Roberson 2020 年 8 月 18 日
I am suggesting that checkerboard() is a function that creates a regular repeated pattern, and that studying how it is coded would give you ideas on how to form the regular repeated pattern that you want.

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

採用された回答

Rik
Rik 2020 年 8 月 18 日
If you want to increase the size of the black and white parts in equal proportion, you can use the repelem function.
  3 件のコメント
Rik
Rik 2020 年 8 月 18 日
Did you make sure the Position property of the rectangle take the new image dimensions into account?
Oliver Lestrange
Oliver Lestrange 2020 年 8 月 18 日
The width and height were smaller than I thought. Thanks Rik

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by