cantera/ext/matlab_xunit/+xunit/+utils/stringToCellArray.m
Ray Speth bac65b26a1 Added machinery for unit testing of the Matlab toolbox
Unit tests are written using the Matlab xUnit Test Framework
2012-03-13 17:32:10 +00:00

14 lines
408 B
Matlab

function c = stringToCellArray(s)
%stringToCellArray Convert string with newlines to cell array of strings.
% C = stringToCellArray(S) converts the input string S to a cell array of
% strings, breaking up S at new lines.
% Steven L. Eddins
% Copyright 2009 The MathWorks, Inc.
if isempty(s)
c = cell(0, 1);
else
c = textscan(s, '%s', 'Delimiter', '\n', 'Whitespace', '');
c = c{1};
end