Using for loops to generate an array?
이전 댓글 표시
I need to generate the array A = 1 2 3 4 5; 2 4 6 8 10; 3 6 9 12 15; 4 8 12 16 20; 5 10 15 20 25; using for loops. Don't have much experience with looping, and currently trying to understand it until it clicks. Help!
채택된 답변
추가 답변 (1개)
Matt Tearle
2015년 11월 6일
0 개 추천
TastyPastry's answer is perfectly correct, but it's worth asking an important clarification: why do you want to do it with a for-loop? This can be done far more neatly in MATLAB without any loops.
카테고리
도움말 센터 및 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!