write a function is1234() that takes a numeric vector or matrix as an input and returns whether it contains the numbers 1,2,3,4 in any order in matlab using while loops in matlab
main.m
functionresult = is1234(input)if nargin < 1 error('Input argument is required');
end% Convert input to a single vector input = input(:);
% Define target numbers target = [1, 2, 3, 4];
i = 1;
found_nums = zeros(1, 4);
whilei <= numel(input) && ~all(found_nums)
current_num = input(i);
idx = find(target == current_num);
% If the number is one of the target numbersif ~isempty(idx)
found_nums(idx) = 1;
endi = i + 1;
end
result = all(found_nums);
end