Create a square matrix with a nested loop
조회 수: 13 (최근 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!