필터 지우기
필터 지우기

showing correlation on scatter

조회 수: 10 (최근 30일)
Hassan
Hassan 2011년 4월 19일
I want to show the R-squared value on the scatterplot. I am using corrcoef function to get the correlation value. I wonder how I can show the correlation or R-squared value on the scatterplot? I appereciate your help.
R=corrcoef(X,Y) R_squared=R(2)^2 scatter(X,Y)

채택된 답변

Arnaud Miege
Arnaud Miege 2011년 4월 19일
Use the text function:
text(x_text, y_text, ['R^2 = ' num2str(R_squared)])
where x_text and y_text are coordinates of where you want to place the text.
HTH,
Arnaud
  댓글 수: 1
Hassan
Hassan 2011년 4월 19일
thanks Arnaud, it's working.

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by