Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % MATLAB COMPARE N-dimensional CELL array elements with one other element
- function cellsEq = celleq(cels,rhs)
- s = size(cels);
- cels = reshape(cels,[],1);
- cellsEq = cell(size(prod(s),1));
- for i = 1:prod(s)
- cellsEq{i} = strcmp(cels{i},rhs);
- end
- cellsEq = reshape(cellsEq,s);
- end
- % EDIT: Found a much more complete version: http://www.mathworks.com/matlabcentral/fileexchange/27542-compare-nested-cell---struct-arrays-recursively/content/celleq.m
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement