Passing A Variable Number of Arguments into a Function
问题 In Matlab, I have a variable length cell of values: C={A1,...,An} How should I pass and distribute these values into a function able to receive a variable number of arguments? f(A1,...,An) Ultimately if not possible, how should I modify the beginning of this function for making this work? 回答1: You need to convert the cell array into a comma-separated list via curly-brace indexing, that is, use C{:} . Example with the reshape function: >> C = {ones(3,4), 2, 2, 3}; >> y = reshape(C{:}); >> size