Multidimensional matrices can be converted to Matlab's input format using the ToMatlab package:
<< ToMatlab`
m = {{0, 0, 2 Sqrt[4 + n], 0, Sqrt[4 + n], 0, 0, 0, Sqrt[4 + n], 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 2 Sqrt[3 + n], 0, Sqrt[3 + n], 0, 0, 0, Sqrt[3 + n], 0, 0, 0, 0, 0, 0},
{2 Sqrt[4 + n], 0, 0, 0, 0, 0, Sqrt[3 + n], 0, 0, 0, Sqrt[3 + n], 0, 0, 0, 0, 0},
{0, 2 Sqrt[3 + n], 0, 0, 0, 0, 0, Sqrt[2 + n], 0, 0, 0, Sqrt[2 + n], 0, 0, 0, 0},
{Sqrt[4 + n], 0, 0, 0, 0, 0, 2 Sqrt[3 + n], 0, 0, 0, 0, 0, Sqrt[3 + n], 0, 0, 0},
{0, Sqrt[3 + n], 0, 0, 0, 0, 0, 2 Sqrt[2 + n], 0, 0, 0, 0, 0, Sqrt[2 + n], 0, 0},
{0, 0, Sqrt[3 + n], 0, 2 Sqrt[3 + n], 0, 0, 0, 0, 0, 0, 0, 0, 0, Sqrt[2 + n], 0},
{0, 0, 0, Sqrt[2 + n], 0, 2 Sqrt[2 + n], 0, 0, 0, 0, 0, 0, 0, 0, 0, Sqrt[1 + n]},
{Sqrt[4 + n], 0, 0, 0, 0, 0, 0, 0, 0, 0, 2 Sqrt[3 + n], 0, Sqrt[3 + n], 0, 0, 0},
{0, Sqrt[3 + n], 0, 0, 0, 0, 0, 0, 0, 0, 0, 2 Sqrt[2 + n], 0, Sqrt[2 + n], 0, 0},
{0, 0, Sqrt[3 + n], 0, 0, 0, 0, 0, 2 Sqrt[3 + n], 0, 0, 0, 0, 0, Sqrt[2 + n], 0},
{0, 0, 0, Sqrt[2 + n], 0, 0, 0, 0, 0, 2 Sqrt[2 + n], 0, 0, 0, 0, 0, Sqrt[1 + n]},
{0, 0, 0, 0, Sqrt[3 + n], 0, 0, 0, Sqrt[3 + n], 0, 0, 0, 0, 0, 2 Sqrt[2 + n], 0},
{0, 0, 0, 0, 0, Sqrt[2 + n], 0, 0, 0, Sqrt[2 + n], 0, 0, 0, 0, 0, 2 Sqrt[1 + n]},
{0, 0, 0, 0, 0, 0, Sqrt[2 + n], 0, 0, 0, Sqrt[2 + n], 0, 2 Sqrt[2 + n], 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, Sqrt[1 + n], 0, 0, 0, Sqrt[1 + n], 0,
2 Sqrt[1 + n], 0, 0}};
ToMatlab[m /. n -> 1, "a"]
(* copy/paste-able string output *)
ToMatlab[m, "m"]
(* copy/paste-able string output *)
Copying the output as "plain text" to the Matlab editor:
n=1;
a=[0,0,2.*5.^(1/2),0,5.^(1/2),0,0,0,5.^(1/2),0,0,0,0,0,0,0;0,0,0,4, ...
0,2,0,0,0,2,0,0,0,0,0,0;2.*5.^(1/2),0,0,0,0,0,2,0,0,0,2,0,0,0,0,0; ...
0,4,0,0,0,0,0,3.^(1/2),0,0,0,3.^(1/2),0,0,0,0;5.^(1/2),0,0,0,0,0, ...
4,0,0,0,0,0,2,0,0,0;0,2,0,0,0,0,0,2.*3.^(1/2),0,0,0,0,0,3.^(1/2), ...
0,0;0,0,2,0,4,0,0,0,0,0,0,0,0,0,3.^(1/2),0;0,0,0,3.^(1/2),0,2.* ...
3.^(1/2),0,0,0,0,0,0,0,0,0,2.^(1/2);5.^(1/2),0,0,0,0,0,0,0,0,0,4, ...
0,2,0,0,0;0,2,0,0,0,0,0,0,0,0,0,2.*3.^(1/2),0,3.^(1/2),0,0;0,0,2, ...
0,0,0,0,0,4,0,0,0,0,0,3.^(1/2),0;0,0,0,3.^(1/2),0,0,0,0,0,2.*3.^( ...
1/2),0,0,0,0,0,2.^(1/2);0,0,0,0,2,0,0,0,2,0,0,0,0,0,2.*3.^(1/2),0; ...
0,0,0,0,0,3.^(1/2),0,0,0,3.^(1/2),0,0,0,0,0,2.*2.^(1/2);0,0,0,0,0, ...
0,3.^(1/2),0,0,0,3.^(1/2),0,2.*3.^(1/2),0,0,0;0,0,0,0,0,0,0,2.^( ...
1/2),0,0,0,2.^(1/2),0,2.*2.^(1/2),0,0];
m=[0,0,2.*(4+n).^(1/2),0,(4+n).^(1/2),0,0,0,(4+n).^(1/2),0,0,0,0,0, ...
0,0;0,0,0,2.*(3+n).^(1/2),0,(3+n).^(1/2),0,0,0,(3+n).^(1/2),0,0,0, ...
0,0,0;2.*(4+n).^(1/2),0,0,0,0,0,(3+n).^(1/2),0,0,0,(3+n).^(1/2),0, ...
0,0,0,0;0,2.*(3+n).^(1/2),0,0,0,0,0,(2+n).^(1/2),0,0,0,(2+n).^( ...
1/2),0,0,0,0;(4+n).^(1/2),0,0,0,0,0,2.*(3+n).^(1/2),0,0,0,0,0,(3+ ...
n).^(1/2),0,0,0;0,(3+n).^(1/2),0,0,0,0,0,2.*(2+n).^(1/2),0,0,0,0, ...
0,(2+n).^(1/2),0,0;0,0,(3+n).^(1/2),0,2.*(3+n).^(1/2),0,0,0,0,0,0, ...
0,0,0,(2+n).^(1/2),0;0,0,0,(2+n).^(1/2),0,2.*(2+n).^(1/2),0,0,0,0, ...
0,0,0,0,0,(1+n).^(1/2);(4+n).^(1/2),0,0,0,0,0,0,0,0,0,2.*(3+n).^( ...
1/2),0,(3+n).^(1/2),0,0,0;0,(3+n).^(1/2),0,0,0,0,0,0,0,0,0,2.*(2+ ...
n).^(1/2),0,(2+n).^(1/2),0,0;0,0,(3+n).^(1/2),0,0,0,0,0,2.*(3+n) ...
.^(1/2),0,0,0,0,0,(2+n).^(1/2),0;0,0,0,(2+n).^(1/2),0,0,0,0,0,2.*( ...
2+n).^(1/2),0,0,0,0,0,(1+n).^(1/2);0,0,0,0,(3+n).^(1/2),0,0,0,(3+ ...
n).^(1/2),0,0,0,0,0,2.*(2+n).^(1/2),0;0,0,0,0,0,(2+n).^(1/2),0,0, ...
0,(2+n).^(1/2),0,0,0,0,0,2.*(1+n).^(1/2);0,0,0,0,0,0,(2+n).^(1/2), ...
0,0,0,(2+n).^(1/2),0,2.*(2+n).^(1/2),0,0,0;0,0,0,0,0,0,0,(1+n).^( ...
1/2),0,0,0,(1+n).^(1/2),0,2.*(1+n).^(1/2),0,0];
Now in the Matlab command window:
>>isequal(a,m)
ans =
1