how to make the best use of memory when running MATLAB.?

조회 수: 1 (최근 30일)
mohammad
mohammad 2014년 7월 9일
편집: per isakson 2014년 7월 29일
now i have an array includes numeric its size is 7 x 7 and i do some operation on that array
clc
clear
a = input('Please, select your array: ');
b = nonzeros(a);
c = length(b);
for d =1:c
if (d<c)
e{d} = nchoosek(b, d);
end
end
tt=cellfun(@(m) padarray(m,[0 max(cellfun(@(n) size(n,2), e)) - size(m,2)],'post'), e,'UniformOutput',0);
uu=cell2mat(tt([1:d-1])');
suu=size(uu)
uu(:,((suu(2))+1))=sum(uu')'
but i faced a problem during the implementation of the code this problem lies in the memory . please help me how to make the best use of memory when running MATLAB ?
  댓글 수: 8
mohammad
mohammad 2014년 7월 16일
Error using vertcat Out of memory. Type HELP MEMORY for your options.
Error in nchoosek>combs (line 165) P = [P; [v(ones(size(Q,1),1),k) Q]]; %#ok
Error in nchoosek (line 122) c = combs(v,k);
Error in testt (line 7) e{d} = nchoosek(b, d); that is the message which appears to me each time
per isakson
per isakson 2014년 7월 16일
Are you sure there is enough memory to run your script? If so you need to debug your script. See
and start with
dbstop if error

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

답변 (1개)

per isakson
per isakson 2014년 7월 16일
편집: per isakson 2014년 7월 29일
Try
>> e = nchoosek((1:7*7)',24);
which returns
Error using nchoosek (line 120)
Maximum variable size allowed by the program is exceeded.
with my system: R2013a, 64bit, Win7, 8GB

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by