Truncating a vector from an addressed element in MatLab

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 7K views
edwrai
Messages
1
Reaction score
0
hi,
in MatLab, if you have x and y vectors and want to address an element in vector x, let's say i>=3 from which to construct a new vector x that starts from the addressed element until the last element and at the same time construct a new y vector corresponding to the new x vector?

x=[1 2 3 4 5 6 7]
y=[7 6 5 4 3 2 1]
new x should be=[4 5 6 7]
and new y =[4 3 2 1 ]


Maybe using an array=[x y]?

Any answer would be very much appreciated.
Thanks in advance
 
Physics news on Phys.org