Answer:
The implementation was done with 5 lines of codes given below
Explanation:
mag_force(6, [1 2 3], [-2 0 1], [1 0 0])
function Force = mag_force(q, v, B, u)
F = q .* cross(v, B);
Force = dot(F, u);
end %This brings an end to the program
% This display ans = 12 on the MATLAB command window
% indicating a right implementation