I did not find an answer to this here, if however I overlooked it, please guide me and I will delete this post.
So here is the question: I am trying to draw a numbered grid with 88 elements as a 8x11 matrix. The node labeling is a bit tricky, as there are four groups of node labels I need. Let's say the node labels are A,B,C and D. Each letter has a unique set of indices that I want to assign it to. These sets follow a certain pattern that I would define externally, e.g. in Matlab, and they might look like this:
group_A = [12 23 34 45 56 67 78 89]
Is there a way to compare the current iteration number with the entries of these arrays and only use the corresponding label if it appears in these arrays?
The label should then appear in the line above the counter, which is why there is a line break.
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[node distance=0cm]
\foreach \i in {0,...,10}
\foreach \j in {0,...,7}
{\pgfmathtruncatemacro{\label}{11*\j+\i+1}
\node (\i*\j+\i) [rectangle, draw=black, align=center, minimum width=1cm] at (1*\i,-1*\j) {\\(\label)};}
\end{tikzpicture}
\end{document}
Right now it looks like this and is missing the labels. Basically, I am looking for an equivalent of Matlabs ismember(a,b) function.


