Cellular automata are frequently used to model dynamics of spatial systems.This work shows how a so-called structural adjoint sensitivity analysis may be applied to such systems. It is assumed that the cellular automaton has a continuous state, a spatiotemporal input, and is characterized by one scalar objective function specified, for example, in a given optimization or parameter optimization problem. With this analysis, it is possible to calculate efficiently a gradient of the objective function in a space of the spatiotemporal input of the automata.As an example, a model of tumor growth with an introduced spatiotemporal irradiation signal is analysed.