limiting standart deviation of a signal

4 views (last 30 days)
Hi all,
i have a really easy question. I need std() command to limit. So i have a signal as name ST (on y axis) and time (on x axis) and time is from 0 to 10 seconds. But i need to find standart deviation of signal just between 0 to 3 seconds. You can see my graph.
I would be very appreciated for your answers. Thanks a lot!

Accepted Answer

Adam Danz
Adam Danz on 12 Jul 2018
Edited: Adam Danz on 12 Jul 2018
Let's say your time variable is
time = 0:.1:10;
and your data is named 'data'.
First locate all time samples between 0 and 3 sec
idx = time >= 0 & time <= 3;
Then calculate std of your data for those times.
sig = std(data(idx));
This can be done all in 1 line like this
sig = std(data(time >= 0 & time <= 3));
*This assumes your 'time' and 'data' points correspond.

More Answers (0)

Categories

Find more on Startup and Shutdown 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!