필터 지우기
필터 지우기

2d plot:calculate the average value along one axle

조회 수: 2 (최근 30일)
Stefht
Stefht 2017년 2월 13일
댓글: Stefht 2017년 2월 13일
Dears, I want to create a 2d plot that calculate the average value along one axle. There are is a pre-defined function in matlab? I add the scatter plot and the array

답변 (1개)

Walter Roberson
Walter Roberson 2017년 2월 13일
x = NEW_coo_y_cp(:,1);
y = NEW_coo_y_cp(:,2);
mx = mean(x);
my = mean(y);
scatter(x, y);
ax = gca;
xl = get(ax, 'XLim');
yl = get(ax, 'YLim');
line([mx, mx], yl, 'Color', 'g');
line(xl, [my my], 'Color', 'k');
  댓글 수: 1
Stefht
Stefht 2017년 2월 13일
Not propertly; I want that for every x value matlab calculate the average on y axle, Look picture that I add: I want to create the red line averaged along x axle

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

카테고리

Help CenterFile Exchange에서 Data Distribution Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by