A displacement vector stores readings in millimetres. Execute the following MATLAB commands in order:
d = [4.2 7.8 11.4 15.0 18.6]; d([2 4]) = []; d(end+1) = 22.2; d(2) = d(end-1) - d(2);
What is the final value of d(2)? Answer in millimetres, to one decimal place.
Unlock full course notes by signing up
Insert and correct a temperature-log row
A temperature log stores one test per row and two sensor readings per test, in degrees Celsius. An engineer inserts a missing test and then corrects selected readings using these MATLAB statements:
Complete the table with every entry of the final array T. Enter exact integers in degrees Celsius.
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:
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.
Recalculate linear positions after growth
An ordinary numeric MATLAB array stores voltages in volts. The commands below execute in order:
What value is stored in y?
Preserve test identities during deletion
A pressure matrix has three sensor rows and five test columns. All entries are in kilopascals.
Remove original test columns 2 and 4, preserve the order of the other tests, and append a new final test column containing 61, 62, and 63 kPa for sensors 1, 2, and 3 respectively. Which command sequence produces the required result? Each sequence starts from the original D above.