% script to write particular matrix to csv file with P2 and P1 and rows and
% columns, respectively
function y = writeMatrixToCSV(matrix, csvName, P2, P1) 
    y = NaN(length(matrix(:,1))+1, length(matrix(1,:))+1);
    y(2:end, 2:end) = matrix;
    y(1,2:end) = P2; % 1st row, all other columns equal the drive powers in P2 (increase 1:end)
    y(2:end,1) = P1; % 1st col, all other rows equal the drive powers in P1 (increase 1:end)
    writematrix(y, csvName);
end