3 %> @brief Generates code containing values of certain
object properties
5 %> Property names cna be specified with dots. In
this case, properties will be
6 %> accessed within objects that are properties themselves.
9 %> @param props Cell of
property names with optional comments
10 %> @arg Format 1: {
'property name',
'comment; ...}
11 %> @arg Format 2: {'property name
', ...}
12 %> @param flag_alt=0 Alternative format to just paste on the properties section of code file
13 function s = code_props(obj, props, flag_alt)
20 flag_comments = n ~= numel(props);
22 s_indent = iif(flag_alt, ' ', '');
23 s_comment = iif(flag_alt, '%>
', '%
');
24 s_o = iif(flag_alt, '', 'o.
');
29 s = cat(2, s, s_indent, s_comment, ' ', props{i, 2}, 10);
31 s_p = iif(flag_comments, props{i, 1}, props{i});
32 ss = regexp(s_p, '\.
', 'split
');
37 s = cat(2, s, s_indent, s_o, s_p, ' =
', convert_to_str(p), ';
', 10);