Question: the question and the code to test it on Write a function corr that takes a two input vectors, v1 and v2. It should return

the question and the code to test it on  the question and the code to test it on Write a
function corr that takes a two input vectors, v1 and v2. It
should return a single output, the the correlation coefficient, r of the

Write a function corr that takes a two input vectors, v1 and v2. It should return a single output, the the correlation coefficient, r of the two vectors. 25 % RUN THIS CELL TO TEST YOUR corrc FUNCTION 26 27 testvec1 randn(1,100); testvec2 = testvec + 0.7*randn(1,100); 28 3e 31 32 try r = round (corrc(testvec1, testvec2), 4); catch warning("The function corre caused an error. Possible causes may bath 33 34 35 end rMat = corrcoef(testveci, testvec2); I 38 if r == round(rmat(3),4) fprintf manente corre PASSED ** ) else fprintf( corno FAELED) end 42 Insert your standard deviation function here function sd stdDev(vin) % insert your standard deviation code here end

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!