I have a large csv-file, which looks similar to the following:
My problem is related to a question previously posted and superbly answered by @gnovice. I am using the folling code to format the data.
data = csvread('datacsv.csv',1,0);
[rowVals, ~, rowIndex] = unique(data(:, 3));
[colVals, ~, colIndex] = unique(data(:, 1).');
A = accumarray([rowIndex colIndex], data(:, 2), [], @(x) x(1)); % Keeps the first value
A = [NaN colVals; rowVals A];
The output, however looks like:
It should ideally look like:
Whatis the part of the code that I have to adjust?


