From: Rajeev Narayanan on 11 Apr 2010 06:03 Hello, I have the following declaration in my program. I have the following combination: P = 11; R = 3; Q = R^P; W = zeros(P, Q, R); At this point, i am limited to the above values. If I increase P = 15 or R = 4, i am getting "out of memory". Is there a better way to do such thing for higher values in a more compact way. Thanks. Rajeev
From: us on 11 Apr 2010 06:17 "Rajeev Narayanan" <rite2rajeev(a)gmail.com> wrote in message <hps6on$qfq$1(a)fred.mathworks.com>... > Hello, > > I have the following declaration in my program. I have the following combination: > > P = 11; > R = 3; > Q = R^P; > > W = zeros(P, Q, R); > > At this point, i am limited to the above values. If I increase P = 15 or R = 4, i am getting "out of memory". Is there a better way to do such thing for higher values in a more compact way. > > > Thanks. > Rajeev it surely depends on what you want to do with W... us
From: Oleg Komarov on 11 Apr 2010 06:19 "Rajeev Narayanan" <rite2rajeev(a)gmail.com> wrote in message <hps6on$qfq$1(a)fred.mathworks.com>... > Hello, > > I have the following declaration in my program. I have the following combination: > > P = 11; > R = 3; > Q = R^P; > > W = zeros(P, Q, R); > > At this point, i am limited to the above values. If I increase P = 15 or R = 4, i am getting "out of memory". Is there a better way to do such thing for higher values in a more compact way. > > > Thanks. > Rajeev Consider that a 15 by 4 matrix in double class would be 15*4*8/1024^2 = 0.000457 MB. Then if you repeat this layer for 4^15 (1073741824) you get approximately: 479 GB... What do you need such a big array for? Oleg
From: Rajeev Narayanan on 11 Apr 2010 06:28 Hello, I am doing monte carlo simulation and creating a big sample for my analysis. I need to do it for different P and R.... Rajeev "Oleg Komarov" <oleg.komarovRemove.this(a)hotmail.it> wrote in message <hps7mn$93n$1(a)fred.mathworks.com>... > "Rajeev Narayanan" <rite2rajeev(a)gmail.com> wrote in message <hps6on$qfq$1(a)fred.mathworks.com>... > > Hello, > > > > I have the following declaration in my program. I have the following combination: > > > > P = 11; > > R = 3; > > Q = R^P; > > > > W = zeros(P, Q, R); > > > > At this point, i am limited to the above values. If I increase P = 15 or R = 4, i am getting "out of memory". Is there a better way to do such thing for higher values in a more compact way. > > > > > > Thanks. > > Rajeev > > Consider that a 15 by 4 matrix in double class would be 15*4*8/1024^2 = 0.000457 MB. > > Then if you repeat this layer for 4^15 (1073741824) you get approximately: > 479 GB... > > What do you need such a big array for? > > Oleg
From: John D'Errico on 11 Apr 2010 08:45
"Rajeev Narayanan" <rite2rajeev(a)gmail.com> wrote in message <hps6on$qfq$1(a)fred.mathworks.com>... > Hello, > > I have the following declaration in my program. I have the following combination: > > P = 11; > R = 3; > Q = R^P; > > W = zeros(P, Q, R); > > At this point, i am limited to the above values. If I increase P = 15 or R = 4, i am getting "out of memory". Is there a better way to do such thing for higher values in a more compact way. > Why do people think they have an infinitely large, infinitely fast computer? Don't bother to think. Just throw your arbitrarily chosen huge problem at it. If it actually succeeds, then increase the problem size exponentially. Then wail when you run out of memory or time before the universe dies of heat death, while your computer is still blissfully chugging away. Perhaps there is a way to artfully solve your problem using less memory. Or, perhaps, you have simply chosen too large of a problem to solve. Your choice. |