I'm trying to generate a mex code file from the .m file using Matlab coder. The code for which is
function [result,x]=tesrank(A,x)
result = [];
n = x;
for col= 1:n
result = [result, sum(A==col, 2)];
end
For fixed size, I'm able to get it using
codegen tesrank -args {zeros(2,3), zeros(1)}
% Here size(A)=2x3 and size(x)=1x1
How do I do it without limiting the size of A and x?