high dimensional matrix takes too long to generate

조회 수: 3 (최근 30일)
savas yilmaz
savas yilmaz 2022년 8월 22일
댓글: Steven Lord 2022년 8월 22일
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
savas yilmaz
savas yilmaz 2022년 8월 22일
of course. I realized that creating this matrix is a bit difficult. however, although it is small in size, I learned to do this with a different command. thanks
Steven Lord
Steven Lord 2022년 8월 22일
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

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by