Skip to content
Snippets Groups Projects
Commit ccb6a420 authored by leprob001's avatar leprob001
Browse files

Added vendor folder to lib folder.

It includes a function created by MATLAB to flatten a complex cell array.
parent 2b2263a7
No related branches found
No related tags found
No related merge requests found
function C = flatten(A)
%
% C1 = flatten({{1 {2 3}} {4 5} 6})
% C2 = flatten({{'a' {'b','c'}} {'d' 'e'} 'f'})
%
% Outputs:
% C1 =
% [1] [2] [3] [4] [5] [6]
% C2 =
% 'a' 'b' 'c' 'd' 'e' 'f'
%
% Copyright 2010 The MathWorks, Inc.
C = {};
for i=1:numel(A)
if(~iscell(A{i}))
C = [C,A{i}];
else
Ctemp = flatten(A{i});
C = [C,Ctemp{:}];
end
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment