Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How do i generate the template like this?

조회 수: 1 (최근 30일)
xiyou fu
xiyou fu 2016년 10월 17일
마감: MATLAB Answer Bot 2021년 8월 20일
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

답변 (1개)

KSSV
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.
  댓글 수: 2
xiyou fu
xiyou fu 2016년 10월 17일
I am sorry I didn't make the question clearly. In fact, my question is suppose I have a 9x9 matrix (black means 0 and white means 1, just like the first one in the picture), how can I generate others matrixs ( like the others from two to nine in the picture) by rotating the first one?
KSSV
KSSV 2016년 10월 17일
YOu have to change Z values '1' at different positions.

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by