Assume that you have taken data across the surface of a sample, for example sheet resistance. The data is stored in a Nx3 matrix, where the columns are: [X,Y,data]. Assume that the lower-left corner of the sample is (X,Y) = (0,0), and the upper right corner of the sample is (X,Y) = (3,3), and the data is taken only at integers between 0:3 (4x4 or max of 16 locations across the sample).
The goal is to find the simplest way to take the data and construct a 2-dimensional matrix, where the data at (0,0) is in the lower-left and the data at (3,3) is in the upper right. Any locations with no data specified should end up as NaN in the final matrix. If any location is listed twice in the data, the LAST value (the one with the highest row index) should be used. It is possible that there is no data (i.e. data = []);
For example, if the input data is:
data = [ 0 0 5 1 1 2 2 2 7 3 3 8 1 1 6 ];
Then the output should be:
output = [ NaN NaN NaN 8 NaN NaN 7 NaN NaN 6 NaN NaN 5 NaN NaN NaN ];
I had no idea that the function isequalwithequalnans exists. That makes me wonder how many functional variants of isequal exist.
656 Solvers
Back to basics 18 - justification
155 Solvers
Solve the set of simultaneous linear equations
220 Solvers
Make an awesome ramp for a tiny motorcycle stuntman
342 Solvers
How many days does the cat take to climb out of the hole?
58 Solvers