Effacer les filtres
Effacer les filtres

2d plot:calculate the average value along one axle

2 vues (au cours des 30 derniers jours)
Stefht
Stefht le 13 Fév 2017
Commenté : Stefht le 13 Fév 2017
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

Réponses (1)

Walter Roberson
Walter Roberson le 13 Fév 2017
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 commentaire
Stefht
Stefht le 13 Fév 2017
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

Connectez-vous pour commenter.

Catégories

En savoir plus sur Data Distribution Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by