extract elements from signal

1 view (last 30 days)
Andreas Parlani
Andreas Parlani on 14 Jan 2021
Commented: Andreas Parlani on 15 Jan 2021
Hello guys, i have a question. I have a signal (ECG) in a vector with 1column 4000 rows and i want to extract every 1000 elements and load them in 4 different vectors with 1column and 1000rows. One way is for example to do g=x(1:1000), z=x(1001:2000) etc x is the initial vector, but i want a better way, more beautiful.

Accepted Answer

dpb
dpb on 15 Jan 2021
Don't create new variables, just
x=reshape(x,1000,[]).';
and reference the column of interest.
If you create new variables, you then have to write code to explicitly address each one; this way just change an index.

More Answers (0)

Categories

Find more on ECG / EKG in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!