I tried searching for this answer here but couldn't find a specific response. Please guide me to the exact specific answer before closing this post.
So I have a correlation matrix with 4 rows and 1 column, and another matrix of random numbers generated by the randn function in matlab, with 5 rows and 1 column.
I am trying to generate the correlated matrix of random numbers without using a for-loop, as per the famous formula attached in the image here. Keep in mind that since my epsilon2 is the second random number from the random number matrix generated by matlab, that's why I have 5 random numbers generated by matlab instead of 4.
Also, the results are to be stored in another matrix with 4 rows and 1 column.
Please let me know if I can do this without using any kind of loop and using the scalr product (.*) in matlab. Trying to learn vectorization here.
Thanks you.
Aucun commentaire:
Enregistrer un commentaire