Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- prompt = 'Enter numbers: ';
- x = [0 0 0 0 0]
- for i = 1:5
- x(i) = input(prompt);
- end
- y =[0 0 0 0 0]
- for j = 1:5
- y(j) = randi(42)
- end
- count = 0;
- for k = 1:5
- if y(k) == x(k)
- count = count + 1;
- end
- end
- fprintf('Count = %d\n', count);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement