I'm trying to create a for loop that will print:
A=1 3 5
6 8 10
11 13 15

댓글 수: 1

Adam
Adam 2019년 9월 4일
편집: Adam 2019년 9월 4일
Why do you need a for loop and where do you want to print it to? If A is definied in the workspace then just
A
will print it to command line.

댓글을 달려면 로그인하십시오.

답변 (1개)

Star Strider
Star Strider 2019년 9월 4일

0 개 추천

Try this:
for k = 1:3
V = (1+5*(k-1)):2:5*k
end
Experiment to get the result you want.

카테고리

도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

제품

릴리스

R2018a

태그

질문:

2019년 9월 4일

답변:

2019년 9월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by