ccc=strarr2cell(strarr,[rememt])
strarr : | stringarray | |
rememt : | if true, empty entries are removed |
ccc : | cell list with string entries |
clc; yyy={["c" "table" "space" "b" "a"];["ontop" "under" "between" ]}
cell2strarr(yyy); xxx=ans, strarr2cell(xxx)
cell2strarr(yyy); xxx=ans, strarr2cell(xxx,true) % no empty entries
cell2strarr(yyy); xxx=ans, strarr2cell(xxx,true); zzz=ans, permutevarargin(zzz{:}) % no empty entries
This function, strarr2cell
, converts a string array into a cell list of strings. It is part of the SolidGeometry library and was introduced in version 5.4. The function is designed to handle string arrays and optionally remove empty entries based on the input parameters.
rememt
parameter using the getfuncparams
function. If not provided, default to false.strarr
.ccc
with the same number of rows as strarr
.sl
.rememt
is true, remove empty strings from sl
using logical indexing.sl
to the corresponding position in the cell array ccc
.The function can be used as follows:
clc; yyy = {["c" "table" "space" "b" "a"]; ["ontop" "under" "between"]}; cell2strarr(yyy); xxx = ans; strarr2cell(xxx); cell2strarr(yyy); xxx = ans; strarr2cell(xxx, true); % no empty entries cell2strarr(yyy); xxx = ans; strarr2cell(xxx, true); zzz = ans; permutevarargin(zzz{:}); % no empty entriesAlgorithm explaination created using ChatGPT on 2025-08-19 00:56. (Please note: No guarantee for the correctness of this explanation)