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 loops in matlab
main.m
functionresult = is1234(input)ifisvector(input)
% Check if the array contains 1, 2, 3, 4 foundNumbers = zeros(1, 4);
fori = 1:numel(input)
num = input(i);
if num == 1 || num == 2 || num == 3 || num == 4 foundNumbers(num) = 1;
endend% If all numbers are foundif all(foundNumbers)
result = true;
else result = false;
endelse result = false; % Input is not a vectorendend