time | Calls | line |
|---|
| | 193 | function codedSize = GetCodedDimensions(sz)
|
| | 194 | % Returns a coded size vector from a cell array represent size.
|
| | 195 | % The returned value is suitable to check if an array's size matched the declared size.
|
| | 196 | % E.g. (2,:) => (2, -1)
|
< 0.001 | 4 | 197 | if isempty(sz)
|
| | 198 | codedSize = [];
|
| | 199 | return;
|
< 0.001 | 4 | 200 | end
|
| | 201 |
|
< 0.001 | 4 | 202 | indices = "";
|
< 0.001 | 4 | 203 | for i=1:numel(sz)
|
< 0.001 | 8 | 204 | switch class(sz{i})
|
< 0.001 | 8 | 205 | case 'uint64'
|
< 0.001 | 8 | 206 | indices(i) = string(sz{i});
|
| | 207 | case 'char'
|
| | 208 | indices(i) = "-1";
|
< 0.001 | 8 | 209 | end
|
< 0.001 | 8 | 210 | end
|
| | 211 |
|
< 0.001 | 4 | 212 | indices = join(indices, ',');
|
< 0.001 | 4 | 213 | indices = insertAfter(indices,0,"[");
|
< 0.001 | 4 | 214 | indices = append(indices,"]");
|
< 0.001 | 4 | 215 | codedSize = eval(indices);
|
< 0.001 | 4 | 216 | end
|
Other subfunctions in this file are not included in this listing.