I have row vector of ECG signal have 1 x n order. I want to make 200 segments of that row vector and each segment should contain 300 samples.
For example: First sample should contain values of row vector from 1 to 300, second sample should contain values of row vector 301 to 300 and so on.
How should I start?

 Akzeptierte Antwort

Image Analyst
Image Analyst am 15 Mär. 2016

0 Stimmen

Try this
signal200 = reshape(ecgSignal, [], 300);

4 Kommentare

Explorer
Explorer am 16 Mär. 2016
Bearbeitet: Explorer am 16 Mär. 2016
This is how I want to do it:
1st segment = [300 samples] % 1st sample to 300th sample
2nd segment = [300 samples] % 301 sample to 600th sample
3rd segment = [300 samples] % 601 sample to 900th sample
...
...
...
...
200th segment = [300 samples]
Image Analyst
Image Analyst am 16 Mär. 2016
Yep, that's what I did. Each row is one of your "segments". I'm sure you didn't want 200 different, independent variables each with a different name - that would be really dumb.
touitou habadi
touitou habadi am 19 Mär. 2018
how can i do signal segmentation by time,for example each segment contain 500 s.
Image Analyst
Image Analyst am 19 Mär. 2018
You'd need a cell array because each segment might not have the same number of samples. You can use etime() to find out elapsed times.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Ashish Sheikh
Ashish Sheikh am 15 Mär. 2016

0 Stimmen

Is n a factor of 200 ?

1 Kommentar

Explorer
Explorer am 15 Mär. 2016
The exact order of row vector is 1*537600

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by