Question: Write 2 matlab functions for--- Create a function covLast.m that takes as input a matrix Mat and returns the covariance matrix Cov. Note that this
Write 2 matlab functions for---

Create a function covLast.m that takes as input a matrix Mat and returns the covariance matrix Cov. Note that this function should only be 5 lines of actual code if you take advantage of matrix multiplication and Matlab's functions size, mean, and repmat. See if your answer makes sense by comparing your solution from a small random matrix with Matlab's built in function cov. You may want to use help cov to check if you are comparing the correct solutions. Create a function corLast.m that takes as input a matrix Mat and returns the correlation matrix Cor. Note that this function should only be 6 lines of actual code if you take advantage of matrix multiplication and Matlab's built-in functions. See if your answer makes sense by comparing your solution from a small random matrix with Matlab's built in function corr. Create a function covLast.m that takes as input a matrix Mat and returns the covariance matrix Cov. Note that this function should only be 5 lines of actual code if you take advantage of matrix multiplication and Matlab's functions size, mean, and repmat. See if your answer makes sense by comparing your solution from a small random matrix with Matlab's built in function cov. You may want to use help cov to check if you are comparing the correct solutions. Create a function corLast.m that takes as input a matrix Mat and returns the correlation matrix Cor. Note that this function should only be 6 lines of actual code if you take advantage of matrix multiplication and Matlab's built-in functions. See if your answer makes sense by comparing your solution from a small random matrix with Matlab's built in function corr
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
