Skip to content

Commit ce3d92a

Browse files
committed
[matlab] Add validate filter function
1 parent 7725f45 commit ce3d92a

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

+nix/Utils.m

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,25 @@
8181
retObj = objConstructor(handle);
8282
end;
8383
end;
84+
85+
% -----------------------------------------------------------
86+
% nix.Filter helper functions
87+
% -----------------------------------------------------------
88+
89+
function err = valid_filter(filter, val)
90+
err = '';
91+
if (~isa(filter, 'nix.Filter'))
92+
err = 'Valid nix.Filter required';
93+
return
94+
end
95+
96+
% Currently matlab will crash, if anything other than
97+
% a cell array is handed over to a nix.Filter.ids.
98+
if (filter == nix.Filter.ids && ~iscell(val))
99+
err = 'nix.Filter.ids requires a cell array';
100+
return
101+
end
102+
end
84103

85104
end;
86105
end

0 commit comments

Comments
 (0)