title: If the input expression contains a symbolic variable, use the VPA function instead?
body: <p>Im tring to substract the diagonal values with <code>eigval</code> and store the new value in the matrix <code>Diagonal</code>:</p>
  
  <pre><code>   CovarianceMatrix=[8 -3 1;2 1 0;3 4 5];
     Col=3;
     Row=3;
     store=1;
      syms eigval;
  
     for loop1= Col:-1:1
      Rw=1;
      syms eigval;
      for loop2= 1:Row
          if Rw==loop1
              Diagonal= (CovarianceMatrix(Rw,loop1)-eigval);
               Fix_Diagonal_2(loop2,store)=sym(Diagonal);
          else
              Diagonal= CovarianceMatrix(Rw,loop1);
              Fix_Diagonal_2(loop2,store)=Diagonal;
          end
  
          Rw=Rw+1;
          loop1=loop1-1;
  
          if loop1==0
               loop1=3;
          end
  
      end
      store=store+1;
  
  end
  </code></pre>
  
  <p>But because I'm using a symbolic variable it gives an error:</p>
  
  <pre><code>      The following error occurred converting from sym to double:
        Error using mupadmex
        Error in MuPAD command: DOUBLE cannot convert the input expression into a double
        array.
  
        If the input expression contains a symbolic variable, use the VPA function      
        instead.
  </code></pre>
  
  <p>How can I solve this? I would like to copy the new substracted value into the diagonal matrix.</p>