MATLAB Answers

How do I use for loops to test all stocks against each other and output answer into a matrix?

1 view (last 30 days)
Cathal fLANAGAN on 22 May 2012
I need to perform a correlation test on a universe of stocks in a given list. I have the yahoo fetch command utilised so that when I get the names of both stocks it downloads them, joins them and does the test. This all works well.
The problem I am encountering is that I can only get the for loop(s) to do one of the iterations needed.
I need to use the same list but the first loop should look at the first item on the list and the second loop should then move through every item on that list and the first loop should not move to the second until all of the first stock has been tested against each of the other and so on....

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!