title: Matlab - OOP variables not updating to list
body: <p>I am trying to plot movement of dots using object oriented. I generate dots at initial position, then add their position to a vector and give them properties.There is a 1000x1000 grid as a background.</p>
  
  <pre><code>uav1 = uavclass([10,10,10]);
  uav2 = uavclass([-10,-10,-10]);
  uav3 = uavclass([20,20,20]);
  uav4 = uavclass([-20,-20,-20]);
  uav5 = uavclass([30,30,30]);
  XY = [];
  XY(:,1) = [uav1.position(1),uav2.position(1),uav3.position(1),uav4.position(1),...
      uav5.position(1),];
  XY(:,2) = [uav1.position(2),uav2.position(2),uav3.position(2),uav4.position(2),...
      uav5.position(2),];
  
  UAVs = plot(XY(:,1), XY(:,2), ...
          'Marker', '.', ...
          'Color', 'r', ...
          'LineStyle', 'none', ...
          'MarkerSize', 8);
  </code></pre>
  
  <p>When i go to plot however using </p>
  
  <pre><code>while uav2.charge &gt; 25
      uav2.position(1) = uav2.position(1) + uav2.maxHorizSpeed;
      uav2.position(2) = uav2.position(2) + uav2.maxHorizSpeed;
      uav2.position(2)
      uav2.charge = uav2.charge - 1;
      pause(0.5)
      set(UAVs, 'XData', XY(:,1), 'YData', XY(:,2));
  end
  drawnow
  </code></pre>
  
  <p>it does not plot. The value of uav2.position increases, but it does not increase in the vector XY and no movement happens.
  The class is</p>
  
  <pre><code>classdef uavclass
      properties
          position = [0,0,0]
          charge = 100;
          destination = [0,0,0];
          maxVertClimb = 2;
          maxHorizSpeed = 5;
          sensorRange = 25;
          unloadingTime = 60;
          safeDistance = 5;
          chargingTime = 300;
          minCruiseAlt = 20;
          maxCruiseAlt = 70;
      end
      methods
          function uav = uavclass(pos)
              uav.position = pos;
          end
      end
  end
  </code></pre>