Compare two attempts to exchange sensor channels

Two MATLAB scripts attempt to exchange the columns of displacement measurements. Each row represents one test, and each column represents one sensor channel. All measurements are in millimetres. The arrays initially contain identical data:


MATLAB
P = [4 11; 7 15; 9 18];
Q = P;

P(:,[1 2]) = P(:,[2 1]);

Q(:,1) = Q(:,2);
Q(:,2) = Q(:,1);


Determine the final value of P(2,2) in millimetres, the final value of Q(2,2) in millimetres, and the number of distinct original first-channel values (4, 7, and 9) that remain anywhere in the final Q. Enter all three answers as exact integers.

Your answers

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Modifying Arrays Questions: