Actually, it has to be like this for any value of R specified, diagonals are X-es, the rest is dots. I got in a really simple way.
Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Drawing something simple with MATLAB
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentar
Antworten (3)
Ajay Kumar
am 27 Okt. 2011
disp(' ')
disp('X...X')
disp('.X.X.')
disp('..X..')
disp('.X.X.')
disp('X...X')
disp(' ')
0 Kommentare
Ajay Kumar
am 27 Okt. 2011
Try the above. It should work. This is the simplest if you are just trying to display characters
0 Kommentare
Diese Frage ist geschlossen.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!