整数 n が与えられた時、以下の様な1と0を含むn×nの行列を作成しましょう。a(1,1) は1にする必要があります。

例:

 入力  n = 5
 出力 a が [1 0 1 0 1
              0 1 0 1 0
              1 0 1 0 1
              0 1 0 1 0 
              1 0 1 0 1]

Solution Stats

1040 Solutions

400 Solvers

Last Solution submitted on Mar 16, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Group


Problem Recent Solvers400

Community Treasure Hunt

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

Start Hunting!