将两个对象(一个图表和一个算法)并排放在单列文章中

将两个对象(一个图表和一个算法)并排放在单列文章中

我有一篇单列文章,并且有一个算法和一个图表,排列如下: 在此处输入图片描述

我只是想知道我能做这样的事情吗:

在此处输入图片描述

欢迎任何解决方案。非常感谢。

这是我的算法:

\begin{algorithm}
\caption{Iterative GM-estimator}
\begin{algorithmic} 
\STATE Input($\mathbf{X};\mathbf{y}$)
\STATE $k = 0; \epsilon=10^{-5};$
\STATE Initialize($\mathbf{Q}^{(k)};\mathbf{w}^{(k)};s^{(k)};\delta^{(k)};\mathbf{w};k_{max};$)
\WHILE {$k<k_{max}$ and $\delta^{(k)}>\epsilon$}

    \STATE $\mathbf{a}^{(k+1)} = \left( \mathbf{X}^H \mathbf{Q}^k \mathbf{X} \right)^{-1}\mathbf{X}^H \mathbf{Q}^k \mathbf{y}$
    \STATE $\mathbf{y}^{(k+1)} = \mathbf{Xa}^{(k+1)}$
    \STATE $\mathbf{r_S}^{(k+1)} = (\mathbf{y}-\mathbf{y}^{(k+1)})/(s^{(k)}\mathbf{w})$
    \STATE $\mathbf{Q}^{(k+1)} = q(\mathbf{r_S}^{(k+1)})$;
    \STATE $s^{(k+1)} = s(\mathbf{r_S}^{(k+1)})$;
    \STATE $\delta^{(k+1)} = \mathbf{X}^{(k+1)}-\mathbf{X}^{(k)}$;
    \STATE $k = k+1$;
\ENDWHILE
\end{algorithmic}
\label{algo_gm}
\end{algorithm}

这是我的包裹:

\documentclass[preprint,12pt,3p]{elsarticle}    

%\newcommand{\subparagraph}{}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{array}
\usepackage{bm}% bold math
\usepackage{booktabs}
\usepackage{graphicx}% Include figure files
\usepackage{dcolumn}% Align table columns on decimal point
\usepackage{eqparbox}
\usepackage{epstopdf}
\usepackage{graphicx}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{siunitx}
\usepackage[percent]{overpic}
\usepackage{titlesec}
\usepackage{float}
\usepackage{etoolbox}
\usepackage{multicol,lipsum}
\usepackage{multirow}
\usepackage{makecell}
\usepackage{xcolor}
\usepackage{dcolumn}
\usepackage{tabu}
\usepackage{gensymb}
\usepackage{tikz}
\DeclareMathOperator{\sgn}{sgn}
\DeclareMathOperator{\diag}{diag}


\journal{European Journal of Radiology}

答案1

Minipages 可以做到这一点:

\documentclass[preprint,12pt,3p]{elsarticle}    

%\newcommand{\subparagraph}{}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{array}
\usepackage{bm}% bold math
\usepackage{booktabs}
\usepackage{graphicx}% Include figure files
\usepackage{dcolumn}% Align table columns on decimal point
\usepackage{eqparbox}
\usepackage{epstopdf}
%\usepackage{graphicx}
%\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{siunitx}
\usepackage[percent]{overpic}
\usepackage{titlesec}
\usepackage{float}
\usepackage{etoolbox}
\usepackage{multicol,lipsum}
\usepackage{multirow}
\usepackage{makecell}
\usepackage{xcolor}
\usepackage{dcolumn}
\usepackage{tabu}
\usepackage{gensymb}
\usepackage{tikz}
\DeclareMathOperator{\sgn}{sgn}
\DeclareMathOperator{\diag}{diag}

\usepackage{caption}


\journal{European Journal of Radiology}

\begin{document}


\begin{minipage}{.5\textwidth}
\begin{algorithm}[H]
\caption{Iterative GM-estimator}
\begin{algorithmic} 
\STATE Input($\mathbf{X};\mathbf{y}$)
\STATE $k = 0; \epsilon=10^{-5};$
\STATE Initialize($\mathbf{Q}^{(k)};\mathbf{w}^{(k)};s^{(k)};\delta^{(k)};\mathbf{w};k_{max};$)
\WHILE {$k<k_{max}$ and $\delta^{(k)}>\epsilon$}

    \STATE $\mathbf{a}^{(k+1)} = \left( \mathbf{X}^H \mathbf{Q}^k \mathbf{X} \right)^{-1}\mathbf{X}^H \mathbf{Q}^k \mathbf{y}$
    \STATE $\mathbf{y}^{(k+1)} = \mathbf{Xa}^{(k+1)}$
    \STATE $\mathbf{r_S}^{(k+1)} = (\mathbf{y}-\mathbf{y}^{(k+1)})/(s^{(k)}\mathbf{w})$
    \STATE $\mathbf{Q}^{(k+1)} = q(\mathbf{r_S}^{(k+1)})$;
    \STATE $s^{(k+1)} = s(\mathbf{r_S}^{(k+1)})$;
    \STATE $\delta^{(k+1)} = \mathbf{X}^{(k+1)}-\mathbf{X}^{(k)}$;
    \STATE $k = k+1$;
\ENDWHILE
\end{algorithmic}
\label{algo_gm}
\end{algorithm}
\end{minipage}
\begin{minipage}{.5\textwidth}
\includegraphics[width=\textwidth]{example-image}
\captionof{figure}{heading}
\end{minipage}

\end{document}

在此处输入图片描述

相关内容