Hi friends from community,
I am very confused on how to manage 'eval' function existing in my code, i need it to be removed from my code and run the function as fast as possible.
The subIndex function runs as to solve such a problem.
Given an integer N, I want the summation of these M non-negative integers be less or equal than N.
List all cases of , such that .
Then p becomes
p = [0,0; 1,0; 0,1; 2,0; 0,2; 1,1];
Following is the function with 'eval':
function p = subIndex(M,N)
ch = [ch,'f',num2str(i),','];
p = eval([ch(1:end-1),']-1']);
q = sum(p,2)<=N&sum(p,2)>=1;