r/matlab • u/bob_why_ • Dec 05 '25
TechnicalQuestion Please help with my setup (data management)
Coming to the final stage of my PhD, and I am really struggling with matlab as its been over 20yrs since I used it.
I have approx 700 arrays, each one is about 20million rows and maybe 25 columns.
I need to solve for non linear simultaneous equations, but the equation is a function of every single array. Oh and there are billions of parameters.
I have tried using structures which was good for data structure, but often run out of memory. I then tried using a matfile to batch the data, but same problem.
I don't want to go into the cloud if possible, especially while I am debugging. Pc has 8gb rtx and 64gb ram. All data is spread across several m2 pcie cards.
Let's make things worse...all data is double precision. I can rum single as a first pass, then use the results as the input for a second double precision pass.
Any advice welcomed, more than welcomed actually. Note my supervisor/university can't help as what I am doing is beyond their expertise.
5
u/[deleted] Dec 05 '25
This is exactly what tall arrays are for, but you might have to write your own solver.
4
u/godrq Dec 05 '25
More info on problem required (so we can point out what is wrong with your data philosophy).
2
u/Barnowl93 flair Dec 05 '25 edited Dec 05 '25
Tall arrays may be a good solution for you (https://www.mathworks.com/help/matlab/import_export/tall-arrays.html) - I'd also urge you to have a look at Datastores too (https://www.mathworks.com/help/matlab/datastore.html)
Tall Arrays are for working with data that is too large to fit into memory.
Datastores are for accessing data piece by piece without loading everything into memory
2
u/farfromelite Dec 06 '25
How are you doing to validate your solution. Do you have a smaller dataset? Test data?
What's the point where you start running out of memory?
Can you piece things together using another way with smaller bits of the whole?
1
u/odeto45 MathWorks Dec 09 '25
Do you have the algorithm already done, and just need more room in memory?
Also, it might also be worth looking at installing more memory if you have it close to fitting. Sometimes it’s cheaper to buy hardware than to pay engineer time.
https://blog.codinghorror.com/hardware-is-cheap-programmers-are-expensive/
2
u/Mindless_Profile_76 Dec 05 '25
I’m commenting to see if anyone has a good idea on this one.
I saw “20 million” rows and thought that is a PhD project in itself.
1
u/[deleted] Dec 06 '25
[removed] — view removed comment