MATLAB: Passing multiple arguments

multiple variablesvarargin

i have created 2 funtions, 1 is
function inst(code,varargin)
where i can input something like this
inst([0 1 1 1],[1],[1 0],[1 1])
but how i pass it a data variable which is same but not in separate variables, but like a matrix
data=[1 0;1 1; 0 1];
how do i get these into separate variables and pass them to inst function
keeping in mind that data may very in length (will have to create and pass more variables)
plz help me.
I have only 1 week left, and i am stuck

Best Answer

dcell = mat2cell(data, ones(1,size(data,1)), size(data,2));
inst([0 1 1 1], dcell{:});