Info
この質問は閉じられています。 編集または回答するには再度開いてください。
How do i generate the template like this?
1 回表示 (過去 30 日間)
古いコメントを表示

How do i generate a series of template like those in the picture in a efficient way? In the picture, the templates are all 9 pixels squares. The black means value 0 and the white means value 1. Thank you
0 件のコメント
回答 (1 件)
KSSV
2016 年 10 月 17 日
clc; clear all ;
x = linspace(0,1,11) ;
y = linspace(0,1,11) ;
[X,Y] = meshgrid(x,y) ;
Z = zeros(size(X)) ;
Z(4:7,:) = 1 ;
surf(X,Y,Z,'edgecolor','b') ;
view([0 90])
colormap('gray')
axis off
You make Z values '1' according to your attached pictures, you can generate others.
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!