Basically, I would like to avoid this loop:
% Task (1)
[~,i] = ismember(A,B(:,1));
% Task (2) - Desired Output
for j = 1 : length(i)
if i(j)~=0
B_des_output(j,:) = B(i(j),:);
else
B_des_output(j,:) = [A(j) NaN];
end
end
% Result
>> B_des_output
3 5
4 8
9 7
1 NaN
5 7