MATLAB: How to pass in multiple arguments to a function using a cell array in MATLAB 7.5 (R2007b)

argumentarraycellconcentratehandleMATLABmergesummarisesummarize

I want to call a function which needs multiple input arguments. I wish to call this function using a single cell array to pass in these multiple arguments.

Best Answer

It is possible to pass in multiple input variables to a function using a single cell array. The following example illustrates how this can be achieved.
Given the following function:
function myfun(arg1, arg2)
disp(arg1);
disp(arg2);
It can be called in the following way:
% Merged function call using a cell array.
mergedVariable = {1 'test'};
myfun(mergedVariable{:})