Last active
August 29, 2015 13:57
-
-
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%> @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