How can I compute mean and variance of a cyclogram?

조회 수: 2 (최근 30일)
Alessandro Garofolini
Alessandro Garofolini 2018년 8월 28일
답변: Koundinya 2018년 9월 4일
hi there,
I have two variables X and Y that I plot against each other. the result is a cyclogram, means the signal repeats itself over multiple loops. I want to compute the mean cycle and the variance at each point of the cycle. I know I could cut the signal from the loop start to the following start for both X and Y, then calculate mean and std over multiple arrays. But because it is easier for me to export the all signal over a trial, I was wondering whether it is possible to compute mean and variance using the two time series. The result should look something like this:
The ellipses indicates the variance and black bold line the mean I want to compute.
Thanks for your help.
Ale
  댓글 수: 2
madhan ravi
madhan ravi 2018년 8월 28일
Include your code.
Alessandro Garofolini
Alessandro Garofolini 2018년 8월 28일
I do not have any. I used
plot(X,Y);
to graph the two time series. I then drawn on the picture to show the wanted mean and ellipses to show the wanted variance.

댓글을 달려면 로그인하십시오.

채택된 답변

Koundinya
Koundinya 2018년 9월 4일
You can create a timeseries object for your data (X,Y) and use the MATLAB functions mean and var to calculate mean and variance for each sample of (X,Y).
Assuming X and Y are row vectors(i.e having dimension 1xn)
% Create a timeseries object
ts = timeseries([X;Y]);
% Calculate mean
ts_mean = mean(ts);
% Calculate variance
ts_variance = var(ts);
ts_mean and ts_variance will be vectors/arrays of dimension 1xn

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by