Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
the question and the code to test it on
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started