Modify matrix, row vector

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 Kommentare

James Tursa
James Tursa am 7 Dez. 2017
Bearbeitet: James Tursa am 7 Dez. 2017
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 am 7 Dez. 2017
Bearbeitet: Anh Dao am 7 Dez. 2017
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 am 7 Dez. 2017
I'm such an idiot, I figured it out, it's y2(1, 1:500) = 0 , thanks you!

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Jos (10584)
Jos (10584) am 7 Dez. 2017

0 Stimmen

1 Kommentar

Anh Dao
Anh Dao am 7 Dez. 2017
I read and this had nothing to do with what i asked

Melden Sie sich an, um zu kommentieren.

Kategorien

Gefragt:

am 7 Dez. 2017

Kommentiert:

am 7 Dez. 2017

Community Treasure Hunt

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

Start Hunting!

Translated by