How can I plot a single vector value

조회 수: 1 (최근 30일)
Osasu
Osasu 2013년 7월 25일
I am working on a set of two .lvm file which are basically the same but from repeated experiment. The time plot was generated and the vector values are 'a' and 'b' as shown below. When I try to average the data, in order to reduce noise, represented by 'y_average' below(I am hoping am correct),I couldn't convert the value I got(174.0020) back to signal plot.
Using "Plot(y_average)" return an empty plot. Can anyone show me the correct code to use or a better way of averaging set of same data taking simultaneously
>> a=plot(d.Segment1.data(:,4)) =174.0016
>> b=plot(e.Segment1.data(:,4)); =174.0023
>> y_average=(1/2)*(a+b)
y_average =
174.0020
>> plot(y_average) : GENERATED EMPTY PLOT

채택된 답변

Walter Roberson
Walter Roberson 2013년 7월 25일
The result of plot() is a handle graphics handle referencing the graphic.
y_average = mean([d.Segment1.data(:,4), e.Segment1.data(:,4), 2);
Or
y_average = mean([get(a, 'YData'), get(b, 'YData')], 2);
  댓글 수: 1
Osasu
Osasu 2013년 7월 29일
There was a little error in the syntax which I corrected and it worked. thus: y_average = mean([d.Segment1.data(:,4), e.Segment1.data(:,4)], 2);
The second code didn't work regretabbly.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by