Large For Loop Executions
이전 댓글 표시
Hello Everybody,
I need to execute a for loop for a matrix (34 x 24) which will result in a matrix with 6e36 rows and 24 columns. Of course when I try to do that, matlab gives me the truncating error.
I know its very huge but I want to know if there is a way to execute that large "for loops"?? And if there is a faster way of course that would be great.
Thanks in advance,
댓글 수: 6
Adam
2014년 10월 27일
Whether or not there is a faster way probably depends entirely on what you are doing in the loop. Judging from the numbers you give I assume your output is 34^24 in size.
The problem would appear not to be the for loop (although this may be slow), but the memory usage. I would imagine you need to do the result in chunks and save each to file.
What does your for loop index look like? If it is 1:6e36 then certainly that is too large and you need to break it down, if it just just 1:34 then the problem is just with memory and not for loop truncation.
the cyclist
2014년 10월 27일
I think it would be helpful to post a highly scaled-down version of your problem, ideally with executable code, and than indicate which dimensions you need to scale up.
Ayman Esmat
2014년 10월 27일
Ayman Esmat
2014년 10월 27일
Adam
2014년 10월 27일
Well, as Mohammad Abouali points out below, I really don't see how you can hope to do this on the data size you say - the disk space required is monolithic. There must be massive redundancy in what you are trying to do...to go from 24*36 to data sizes that are bigger than human comprehension cannot be a solution to whatever problem you are trying to solve.
Even if you had enough disk size to store this, no human nor algorithm could hope to make use of such a vast amount of data.
Ayman Esmat
2014년 10월 27일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!