title: How to write an 4-dimensional variable from CPLEX to Excel?
body: <p>I already read the other Topics About writing multidimensional Arrays from CPLEX to Excel, and tried the solution provided, but it did not work.</p>
  
  <p>In my case I have a 4-dimensional variable. So I build a 5-dimensional tuple and want it to be written in Excel. Running CPLEX, I get the error message "The element "Ausgabe" is not defined" and "the index for array "y#0 is out of range: 5". How can I fix the Problem?</p>
  
  <pre><code>.mod
   int nbSzenarien = ...;
   int nbStandorte = ...;
   int nbKunden = ...;
   int nbProdukte = ...;
  
   range S = 1..nbSzenarien;
   range J = 1..nbStandorte;
   range I = 1..nbKunden;
   range K = 1..nbProdukte;
  
   dvar float+ y[S][J][I][K];
  
  
  tuple Verteilung {
   int S; 
   int J; 
   int I; 
   int K; 
   float value;};
  
  {Verteilung} Ausgabe ={&lt;s,i,j,k, y[s,i,j,k]&gt;|s in S, i in I, j in J, k in K};
  </code></pre>
  
  <p>Thank you!</p>