So just add a third dimension
m=rand(5,5) % Create sample data.
% Now we want three numbers at each location insted of 1.
% So add a dimension with 2 more planes
blankPlane = zeros(size(m))
m = cat(3, m, blankPlane, blankPlane)
% Assign a 1x3 row vector to the 1,1 location
rowVector = [1 2 3] % Create row vector.
m(1,1,:) = rowVector;
% Let's do it again at the 3,3 location.
rowVector = [10 20 30] % Create row vector.
m(3,3,:) = rowVector
You might have t in plane 1 m(:,:,1), theta might be in plane 2 m(:,:,2), and you might have phi in plane 3 m(:,:,3), or however you want to do it.