I have provided the function file for a similar question for the input vector of size 3. you can try running it.
function neha(limit)
c = zeros(1,3);
for i = 0:limit(3)-1 % same as running it from 1:limit(3)
c(3)=i;
for j = 0:limit(2)-1
c(2)=j;
for k=0:limit(1)-1
c(1)=k;
for x=3:-1:1
fprintf('%d ',c(x))
end
fprintf('\n');
end
end
end
return
now my question is : Create a "counter" from 0:limit-1. The length of counter is not determined in the program and it should be determined when it is being run and the inputs can differ from each other. this means that the input vector size is not given and it has to work for any input be it 1,2 or 50. now how do i make a function file for this question? help pls