The best way to compare two different groups is using analysis of variance.
Analysis of variance (ANOVA) is a collection of statistical models used to analyze the differences between group means and their associated procedures (such as "variation" among and between groups).
You should use ANOVA. also there are some functions included in MATLAB like: anova1, ...
p = anova1(X,group)
The standard ANOVA table divides the variability of the data into two parts:
1- Variability due to the differences among the column means (variability between groups)
2- Variability due to the differences between the data in each column and the column mean (variability within groups)
Example 1 (from mathworks)
Create X with columns that are constants plus random normal disturbances with mean zero and standard deviation one:
X = meshgrid(1:5)
X =
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
X = X + normrnd(0,1,5,5)
X =
1.3550 2.0662 2.4688 5.9447 5.4897
2.0693 1.7611 1.4864 4.8826 6.3222
2.1919 0.7276 3.1905 4.8768 4.6841
2.7620 1.8179 3.9506 4.4678 4.9291
-0.3626 1.1685 3.5742 2.1945 5.9465
Perform one-way ANOVA:
p = anova1(X)
p =
7.9370e-006
You can see the anova table:

and also a box-plot related to the analysis:

There are of course more function in MATLAB that you can check.
Actually I don't get the meaning of your image, you can easily add the line after plotting the scatter. using 'hold on' command.
Check these links for more information and examples.
link - 1
link - 2
link - 3
AandBare vectors of equal length, I would simply useplot(A,B,'.')to get the cloud of points - Luis Mendopolyfit? (with a polynomial of order 1) - Luis Mendo