Initial Commit

This commit is contained in:
2026-09-15 15:24:03 -04:00
commit 4dc7086e7e
605 changed files with 101380 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
function n = strlength (s)
%STRLENGTH Number of characters in each element of text (MATLAB R2016b+).
%
% An owuitools compatibility shim; see contains.m for the policy.
% MATLAB returns a double array shaped like its input, and 0 for the
% empty string. With char input it counts the characters, which is what
% `numel` does here - the difference only shows up for cell input.
if (nargin < 1)
error ('strlength: not enough input arguments');
end
if (ischar (s))
n = numel (s);
return;
end
c = owuitools_text_cell (s, 'strlength', 'str');
n = zeros (size (c));
for k = 1:numel (c)
n(k) = numel (c{k});
end
end