How to draw a letter T ? the background is black and the letter itself white

1 回表示 (過去 30 日間)
Maha Almuaikel
Maha Almuaikel 2022 年 3 月 5 日
回答済み: DGM 2022 年 3 月 5 日
I want to draw a T letter
here is my code, instead of the white block I want it to be T, which pixels should i work on? ( don't judge Im a beginner)
A = zeros(500, 500);
A(100:200, 100:200) = 255;
figure(6), imshow(uint8(A));
pause();
close all;

採用された回答

Scott MacKenzie
Scott MacKenzie 2022 年 3 月 5 日
Just add another white block for the top of the T:
A = zeros(500, 500);
A(100:200, 100:200) = 255;
A(50:100, 50:250) = 255;
figure(6),
imshow(uint8(A));

その他の回答 (2 件)

AndresVar
AndresVar 2022 年 3 月 5 日
編集済み: AndresVar 2022 年 3 月 5 日
The current white block A(100:200,100:200) goes from column 100 to 200, so if you just make it longer 100:400 you will get a white rectangle that can be used at the top of the T
Then in a seperate line you can make a tall rectangle at the center. A(200:300,???)=255

DGM
DGM 2022 年 3 月 5 日
FWIW, you can always just do
A = ones(16,18);
A([3:5 19 20 35 44 51:60 67:76 83 92 99 100 115:117 ...
150 166 180:187 195:204 214 220 230 235 236 251]) = 0;
imshow(A)

カテゴリ

Help Center および File ExchangeFunction Creation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by