title: How to get constructor values in another class in matlab?
body: <p>I am developmenting a software using App Designer in Matlab.
  First, the user input some values in Edit Texts, in App Designer. After this, I send this values to a constructor class called Class_TNT. So, I am trying conect this constructor with another class that I created, called Class_Load (that class have some functions to calculate some parameters). But the Class_Load get the default values of constructor class.
  It's crazy because when I use the breakpoint in constructor class, all parameters has the values that user input in App Designer.
  Can you help me?
  Kind regards,
  Ana Reis</p>
  <p>Here, the public properties in App Designer</p>
  <pre class="lang-matlab prettyprint-override"><code>    properties (Access = public)
          plate = [];
          tnt = [];
      end
  </code></pre>
  <p>Here, the code in Run Button, in App Designer</p>
  <pre class="lang-matlab prettyprint-override"><code>    function RunButton_GeneralPushed(app, event)
              % Avaliating parameters
              [sup, type_sup, type, nonlinear, negative] = app.Avaliating...
                  (app.SupportPlate.Value, app.SupportMembrane.Value, ...
                  app.TypeExplosion.SelectedObject.Text,...
                  app.NonlinearAnalisys.SelectedObject.Text, ...
                  app.NegativePhase.SelectedObject.Text);
              
              % Sending values to constructor method
              app.plate = Class_Plate...
                  (sup, type_sup, app.app_a.Value, app.app_beta.Value, ...
                  app.app_h.Value, app.app_nu.Value, app.app_E.Value, ...
                  app.app_rho.Value, nonlinear, app.TimeAnalysis.Value);
              
              app.tnt = Class_TNT...
                  (app.app_W.Value, app.app_Z.Value, type, negative);
  </code></pre>
  <p>Here, the constructor Class_TNT</p>
  <pre class="lang-matlab prettyprint-override"><code>classdef Class_TNT
      properties (SetAccess = public, GetAccess = public)
          Z = 0;
          W = 0;
          type = 0;
          negative = 0;
      end
      
      methods
          function tnt = Class_TNT(W, Z, type, negative, varargin)
              if (nargin &gt; 0)
                  tnt.W            = W;
                  tnt.Z            = Z;
                  tnt.type         = type;
                  tnt.negative     = negative;
              else
                  tnt.W            = 129.45;
                  tnt.Z            = 27.7;
                  tnt.type         = 1;
                  tnt.negative     = 1;                
              end
          end
      end
  end
  </code></pre>
  <p>And here, the Class_Load (not totally)</p>
  <pre class="lang-matlab prettyprint-override"><code>classdef Class_Load &lt; Class_TNT
      properties (SetAccess = public, GetAccess = public)
         td              = 0;
      end
      
      methods
          function blast = Class_Load(W, Z, type, negative)
              blast = blast@Class_TNT();
              if (nargin &gt; 0)
                  blast.W           = W;
                  blast.Z           = Z;
                  blast.type        = type;
                  blast.negative    = negative;
              end
              blast.td            = blast.Positive_Time();
          end
      end
      
      methods
          function td = Positive_Time(blast)
              Z       = blast.Z;
              W       = blast.W;
              type    = blast.type;
              
              switch type
                  case 1
                     td = 0.001 * ( 2.2064 * Z^3 - 0.3363 * Z^2 - ...
                              0.5644 * Z + 0.3756 ) * ( W^(1/3) );
                  case 2
                     td = 0.001 * ( 4.2668 * Z^3 - 1.9736 * Z^2 + ...
                              0.132 * Z + 0.2145 ) * ( W^(1/3) );                    
              end
              
          end
      end
  end
  </code></pre>