用latex分别实现MATLAB代码,spss代码,C语言代码的输入代码
时间: 2024-04-14 08:18:48 浏览: 195
MATLAB代码:
\begin{lstlisting}[language=Matlab]
% This is a MATLAB code example
x = [1, 2, 3, 4, 5];
y = [2, 4, 6, 8, 10];
plot(x, y);
xlabel('X Axis');
ylabel('Y Axis');
title('Plot of X vs Y');
\end{lstlisting}
SPSS代码:
\begin{lstlisting}[language=SPSS]
/* This is an SPSS code example */
GET FILE='C:\Users\user\Desktop\data.sav'.
FREQUENCIES var1 var2 var3.
CROSSTABS
/TABLES=var1 BY var2 BY var3
/FORMAT=AVALUE TABLES
/CELLS=COUNT ROW COLUMN TOTAL
/STATISTICS=CHISQ PHI COEFF
/COUNT ROUND CELL.
\end{lstlisting}
C语言代码:
\begin{lstlisting}[language=C]
// This is a C code example
#include <stdio.h>
int main()
{
int num1 = 5, num2 = 10, sum;
sum = num1 + num2;
printf("The sum of %d and %d is %d", num1, num2, sum);
return 0;
}
\end{lstlisting}
阅读全文