Problem 1120. Visualization of experimental data across a surface
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 ];
Solution Stats
Problem Comments
-
1 Comment
I had no idea that the function isequalwithequalnans exists. That makes me wonder how many functional variants of isequal exist.
Solution Comments
Show commentsProblem Recent Solvers38
Suggested Problems
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15531 Solvers
-
1903 Solvers
-
Maximum running product for a string of numbers
2162 Solvers
-
733 Solvers
-
543 Solvers
More from this Author1
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!