MATLAB: Hello, I have so problem with this code segment? When I try to run this program, I receive a error warning “Too many input arguments”. Help me to fix this problem! Thank in advance!

matlab coderMATLAB Compilertoo many input arguments

for j=0:(floor(nCol/m)-1)
sj = j*m+1;
for i=0:(floor(nRow/m)-1)
si = i*m+1;
if zigzag
| *YVec = [YVec; ZigzagMtx2Vector(Y(si:(si+m-1), sj:(sj+m-1)), ind)];*|
else
YVec = [YVec; reshape(Y(si:(si+m-1), sj:(sj+m-1)), 1, m*m)];
end
end
end
CbVec = [];
CrVec = [];
for j=0:(floor(nCol/s/m)-1)
sj = j*m+1;
for i=0:(floor(nRow/s/m)-1)
si = i*m+1;
if zigzag
CbVec = [CbVec; ZigzagMtx2Vector(Cb(si:(si+m-1), sj:(sj+m-1)), ind)];
CrVec = [CrVec; ZigzagMtx2Vector(Cr(si:(si+m-1), sj:(sj+m-1)), ind)];
else
CbVec = [CbVec; reshape(Cb(si:(si+m-1), sj:(sj+m-1)), 1, m*m)];
CrVec = [CrVec; reshape(Cr(si:(si+m-1), sj:(sj+m-1)), 1, m*m)];
end
end
end
fprintf('zigzag done\n');

Best Answer

Too much code; too little information.
Give us only the actual error in context cut 'n pasted from the screen and the definition line for the function in question.
But, that said, the error is pretty much self-explaining -- you called the function in question with the wrong number of inputs from that which it expects. Look at the documentation/help for that function and compare to what you have in your usage.