Drawing something simple with MATLAB
Info
This question is closed. Reopen it to edit or answer.
Show older comments
I need to write a code to produce the following pattern:
X...X
.X.X.
..X..
.X.X.
X...X
can anyone please help me with the code?
1 Comment
Enis
on 27 Oct 2011
Answers (3)
Ajay Kumar
on 27 Oct 2011
disp(' ')
disp('X...X')
disp('.X.X.')
disp('..X..')
disp('.X.X.')
disp('X...X')
disp(' ')
Ajay Kumar
on 27 Oct 2011
0 votes
Try the above. It should work. This is the simplest if you are just trying to display characters
Walter Roberson
on 27 Oct 2011
Hint to get you started:
flipud(diag('XXXXX'))
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!