high dimensional matrix takes too long to generate

1 view (last 30 days)
I have two matrices. A(3x226981), B(3x40800501).
I want to do the following process. but it takes too long.
I used parfor but it's still too long. is there a simple way?
for x=1:length(B)
for y=1:length(A)
P= [B(:,x);A(:,y)]
TOP=[TOP P]
end
end
  8 Comments
Steven Lord
Steven Lord on 22 Aug 2022
Your machine almost certainly doesn't have enough memory to store that data, and even if you could processing the combinations brute-force would take a very, very long time.
numColumns = 226981*40800501
numColumns = 9.2609e+12
Let's say you could process a thousand columns per second. How long would it take to process that data?
theTime = years(seconds(numColumns/1000))
theTime = 293.4675
I don't think you want to wait for almost 300 years for your answer.
If you explain what problem you're hoping to use this enormous matrix to solve, we may be able to offer a solution that won't make you wait until sometime in 2316 for the answer.
datetime('now') + seconds(numColumns/1000)
ans = datetime
10-Feb-2316 09:07:03

Sign in to comment.

Answers (0)

Categories

Find more on Creating and Concatenating Matrices 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!

Translated by