I have 3 row vectors, which is defined as y1, y2 and y3. Their dimension is 1*166500. For y1, I want the first value to be zero, for y2, I want first 500 numbers to be zero and for y3, I want first 501 values to be zero, how do I do this? Thanks you!

댓글 수: 3

James Tursa
James Tursa 2017년 12월 7일
편집: James Tursa 2017년 12월 7일
Are the "0 to 500" the values within y2 that you want to be set to 0? Or are you meaning for them to be indexes of y2 whose elements you want set to 0? Note that MATLAB uses 1-based indexing.
Anh Dao
Anh Dao 2017년 12월 7일
편집: Anh Dao 2017년 12월 7일
I mean the index of y2 whose elements I want to set to 0, like for first 500 number within y, I want it to be zero. Thanks you!
Anh Dao
Anh Dao 2017년 12월 7일
I'm such an idiot, I figured it out, it's y2(1, 1:500) = 0 , thanks you!

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

답변 (1개)

Jos (10584)
Jos (10584) 2017년 12월 7일

0 개 추천

댓글 수: 1

Anh Dao
Anh Dao 2017년 12월 7일
I read and this had nothing to do with what i asked

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

카테고리

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

질문:

2017년 12월 7일

댓글:

2017년 12월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by