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
この質問は閉じられています。 編集または回答するには再度開いてください。
Drawing something simple with MATLAB
1 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (3 件)
Ajay Kumar
2011 年 10 月 27 日
disp(' ')
disp('X...X')
disp('.X.X.')
disp('..X..')
disp('.X.X.')
disp('X...X')
disp(' ')
0 件のコメント
Ajay Kumar
2011 年 10 月 27 日
Try the above. It should work. This is the simplest if you are just trying to display characters
0 件のコメント
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!