我编写了一个算法,但是它很长,无法放在一页中,但我的问题是它不能分成两页...发生的情况是,算法的一部分出现在第一页,而其余部分消失了,如下图所示...有什么解决办法吗?
这是该算法的代码:
\begin{algorithm}
\caption{Calculating Score}\label{euclid}
\begin{algorithmic}[1]
\Procedure{CheckBetaamplitude}{}
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(1) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(2) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(3) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(4) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(5) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(6) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(7) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(8) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(9) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(10) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(11) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(12) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(13) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(14) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(15) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(16) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(17) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(18) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(19) \gets n/length()$
\State $score4 \gets Average(s)$
\EndProcedure
\end{algorithmic}
\end{algorithm}
答案1
干得好 :)
\begin{algorithm}
\caption{Calculating Score}\label{euclid}
\begin{algorithmic}[1]
\Procedure{CheckBetaamplitude}{}
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(1) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(2) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(3) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(4) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(5) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(6) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(7) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(8) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(9) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(10) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(11) \gets n/length()$
\EndProcedure
\algstore{myalg}
\end{algorithmic}
\end{algorithm}
\begin{algorithm}
\begin{algorithmic} [1]
\algrestore{myalg}
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(12) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(13) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(14) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(15) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(16) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(17) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(18) \gets n/length()$
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(19) \gets n/length()$
\State $score4 \gets Average(s)$
\end{algorithmic}
\end{algorithm}