This is a similar idea to other answers, implemented using the list features provided by etoolbox
.
I define three new user-level commands for configuring the logo.
\setmylogo{}
This command sets a comma-separated list of images as the current logo (to be used until further notice, if used outside a frame
environment). For example,
\setmylogo{logo1,logo2}
To clear the logos, you can use an empty argument i.e. \setmylogo{}
.
The second command is
\addlogoleft{}
This adds a comma-separated list of images to the left of the existing logo. For example, if the logo is logo1,logo2
, then
\addlogoleft{logo0}
will set the logo image list to logo0,logo1,logo2
.
Similarly
\addlogoright{}
adds a comma-separated list of images to the right of the existing logo.
Here's a complete example:
\documentclass{beamer}
\usetheme[height=9mm]{Rochester}
\usecolortheme{beaver}
\usepackage{tikz,etoolbox}
\title{The title}
\institute[Inst.]{The Institute}
\date{\today}
\newcommand*\mylogo{%
\renewcommand*\do[1]{\includegraphics[height=8mm]{##1}}%
\dolistloop\mylogolist}
\newcommand*\setmylogo[1]{%
\renewcommand*\mylogolist{}%
\forcsvlist{\listadd\mylogolist}{#1}}
\newcommand*\addlogoleft[1]{%
\global\let\oldmylogolist\mylogolist
\renewcommand*\mylogolist{}%
\forcsvlist{\listadd\mylogolist}{#1}%
\forcsvlist{\listeadd\mylogolist}{\oldmylogolist}}
\newcommand*\addlogoright[1]{%
\forcsvlist{\listadd\mylogolist}{#1}}
\newcommand*\mylogolist{}
\begin{document}
\addtobeamertemplate{frametitle}{}{%
\begin{tikzpicture}[remember picture,overlay]
\node[anchor=north east,yshift=2pt] at (current page.north east) {\mylogo};
\end{tikzpicture}}
\begin{frame}{Motivation}
No tiger.
\end{frame}
\setmylogo{tiger}
\begin{frame}{Motivation}{A}
Lone tiger.
\end{frame}
\addlogoleft{tiger,example-image-a}
\begin{frame}{Mix}
Lone tiger with document.
\end{frame}
\addlogoright{example-image-b,example-image-c}
\begin{frame}{Mix}
Lone tiger with documents.
\end{frame}
\setmylogo{tiger,tiger,tiger,tiger}
\begin{frame}{Multiplication}
Lots of tigers.
\end{frame}
\setmylogo{}
\begin{frame}{None}
No tiger.
\end{frame}
\end{document}

EDIT
Since you apparently don't want anything quite this flexible but prefer to specify the logo for each frame on which it is required, here's a simplified version. In this case, just use \setmylogo{}
with a comma-separated list of images inside the relevant frame
environment:
\documentclass{beamer}
\usetheme[height=9mm]{Rochester}
\usecolortheme{beaver}
\usepackage{tikz,etoolbox}
\title{The title}
\institute[Inst.]{The Institute}
\date{\today}
\newcommand*\mylogo{%
\renewcommand*\do[1]{\includegraphics[height=8mm]{##1}}%
\tikz[remember picture, overlay]\node[anchor=north east, yshift=2pt] at (current page.north east) {\dolistloop\mylogolist};}
\newcommand*\setmylogo[1]{%
\renewcommand*\mylogolist{}%
\forcsvlist{\listadd\mylogolist}{#1}%
\mylogo}
\newcommand*\mylogolist{}
\begin{document}
\begin{frame}{Motivation}
No tiger.
\end{frame}
\begin{frame}{Motivation}{A}
\setmylogo{tiger}
Lone tiger.
\end{frame}
\begin{frame}{Mix}
\setmylogo{tiger,example-image-a}
Lone tiger with document.
\end{frame}
\begin{frame}{Mix}
\setmylogo{example-image-b,example-image-c}
Lone tiger with documents.
\end{frame}
\begin{frame}{Multiplication}
\setmylogo{tiger,tiger,tiger,tiger}
Lots of tigers.
\end{frame}
\begin{frame}{None}
No tiger.
\end{frame}
\end{document}
Notice that there is no need for \setmylogo{}
in the final frame as the standard default is no logo.

\documentclass{...}\usepackage{....}\begin{document}...\end{document}
. If possible, it should compile and have the minimum amount of code needed to illustrate your problem. This makes it much easier for people to troubleshoot your problem - and much more likely that they will! Here it would help to know how you are adding and placing your logo and to have something to start from.