当我尝试使用我在MATLAB中创建的这个函数时,我遇到了一些内存问题:
fn = @(k,n) symsum((-1)^l*factorial(2^l)/factorial(2^l-2^k),l,k,n)
到目前为止,没有任何问题,但当我使用k=2
和n=4
应用该功能时,我得到以下内容:
fn(2,4)
??? Error using ==> factorial at 17
N must be a matrix of non-negative integers.
Error in ==> @(k,n)symsum((-1)^l*factorial(2^l)/factorial(2^l-2^k),l,k,n)
其他时间如下:
Error using ==> mupadmex
Out of memory. Type HELP MEMORY for your options.
Error in ==> mupadengine.mupadengine>mupadengine.evalin at 119
[res,status] = mupadmex(statement);
Error in ==> mupadengine.mupadengine>mupadengine.feval at 157
[S,err] = evalin(engine,stmt);
Error in ==> mupadfeval at 24
[S,err] = feval(symengine,cmd,varargin{:}); % returns sym
Error in ==> sym.mpower at 22
B = mupadfeval('_power',A,p);
Error in ==> @(k,n)symsum((-1)^l*factorial(2^l)/factorial(2^l-2^k),l,k,n)
原始表达是
有没有办法让请求对内存要求不高或修复此错误?