Skip to content

Instantly share code, notes, and snippets.

@eacousineau
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eacousineau/9699289 to your computer and use it in GitHub Desktop.
Save eacousineau/9699289 to your computer and use it in GitHub Desktop.
cellexpand.m - Expand cell array value into varargout (similar to deal, but only accepts one argument)
%> @brief cellexpand Expand a cell (or array) value into the output
%> arguments. Similar to deal(), but only accepts one input argument.
%> @param X Cell or matrix vector to be distributed to varargout
function [varargout] = cellexpand(X)
if ismatrix(X)
X = num2cell(X);
end
assert(iscell(X));
assert(isvector(X));
assert(length(X) == nargout);
varargout = X;
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment