02 February 2017 12 1K Report

Hi matlab user,

Let i have ,x=[1 3 5 7 9]; y=y=[1 4 6 8 12];

scatter(x,y,'*');

r=corr(x.',y.','type','pearson');

A=r;

[rho]=corr(x.',y.','spearman');

B=rho;

formatspace='Pearson correlation coefficient r = %d';

str=sprintf(formatspace,A);

annotation('textbox',[.3 .5 .1 .1],'string',str)

In the text box i want to get the text for spearman correlation coefficient too. if any one know then kindly help me.

Similar questions and discussions