Hi. I drew a trend line in the plot and want to apply text
"R^2= Rsq1", where Rsq1 is a value got from calculation.
The figure attached shows the plot and text from my code (undesirable repeat of R^2=).
How can I apply test of "R^2= 99.5" when Rsq1=99.5?
p1 = polyfit(E1(:,3),E1(:,1),1);
yfit1 = polyval(p1, E1(:,3));
SStot1 = sum((E1(:,1)-E1(:,3)).^2);
SSres1 = sum((E1(:,1)-yfit1).^2);