Without using a for loop, how can I generate an index 1,2,3,...,n?

 채택된 답변

R.U.F.
R.U.F. 2012년 4월 21일

1 개 추천

vector=[1:stepsize:n] if the stepsize =1 as in your case, you can disregard it

댓글 수: 1

Jan
Jan 2012년 4월 22일
Following the mlint suggestion, you can omit the square brackets: "1:n"

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

추가 답변 (1개)

Arsal noor
Arsal noor 2020년 10월 22일

1 개 추천

X = [1 2 3 4]

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품

태그

질문:

2012년 4월 21일

답변:

2020년 10월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by