Question: using matlab Create a matrix that contains some NaN values, e . g . : mat = 1 4 NaN 1 3 1 5 3

using matlab Create a matrix that contains some NaN values, e.g.:
mat =
14 NaN 1315
37 NaN 13
Write code that will replace the NaN constants with the median of the rest of the numbers in the matrix, e.g.:
mat =
14131315
371313
Be careful about this! Note that the median of the non-NaN values is 13 because the median of the sorted vector storing the numbers from the matrix, [3713131415], is 13.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!