How to deal with a huge matrix?
Show older comments
Hi!
I'm dealing with a huge matrix: to give a little context if it makes sense, it is a transition matrix of a MDP, I thus have to calculate first all the transition probabilities (==> many loops) and then use this matrix in Bellman's equation (==> many matrices products)
In clear, I must create a big matrix (~1GB, potentially more) in my program before using it several times.
My question is, should I rather:
1 - divide my program in several parts (one little "mother function" calling the calculation function, getting the big matrix back, and launching the second function that uses it), which is generally advised?
2 - or put all in the same function in an ugly way :)
Because I'm afraid Matlab will make many copies of the matrix with the first solution. If the total size used by Matlab gets bigger than my RAM, it could cause troubles.
Thanks!
Martin
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!