Matrix to Latex
Konvertiert Matlab
- und Octave-Matrizen oder -Vektoren in Latex-CodeBeispiele
Beispiel 1
Beispiel 2
Beispiel 3
Script
Script für Octave und Matlab
zum formatiren von Matriizen-Werten nach LaTeX.function s = mat2latex(A,dg)
s = '\begin{pmatrix} ';
[M,N] = size(A);
for m=1:M
for n=1:N
s = strcat(s, sprintf([' %0.' num2str(dg) 'f'], A(m,n)) );
if (n~=N)
s = strcat(s,' & ');
end
end
if (m~=M)
s = strcat(s,' \\ ');
end
end
s = strcat(s,' \end{pmatrix}');
s = '\begin{pmatrix} ';
[M,N] = size(A);
for m=1:M
for n=1:N
s = strcat(s, sprintf([' %0.' num2str(dg) 'f'], A(m,n)) );
if (n~=N)
s = strcat(s,' & ');
end
end
if (m~=M)
s = strcat(s,' \\ ');
end
end
s = strcat(s,' \end{pmatrix}');
Siehe auch LatexFormeln

There are no comments on this page. [Add comment]