Create a square matrix with a nested loop
4 ビュー (過去 30 日間)
古いコメントを表示
-20 -18 -16 -14
-12 -10 -8 -6
-4 -2 0 2
4 6 10 12
can you create it with a loop inside
3 件のコメント
回答 (2 件)
Clement Val
2020 年 8 月 31 日
編集済み: Clement Val
2020 年 8 月 31 日
reshape([-20:2:10], 4, 4)'
Just (half) kidding.
You know how to do a loop?
You know how to index in a 2 dim array?
You know how to increment another variable by two?
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!