//
// MATLAB Compiler: 2.2
// Date: Wed Mar 10 16:44:48 2004
// Arguments: "-B" "macro_default" "-O" "all" "-O" "fold_scalar_mxarrays:on"
// "-O" "fold_non_scalar_mxarrays:on" "-O" "optimize_integer_for_loops:on" "-O"
// "array_indexing:on" "-O" "optimize_conditionals:on" "-p" "-W" "main" "-L"
// "Cpp" "-t" "-T" "link:exe" "-h" "libmmfile.mlib" "-B" "sglcpp" "-p" "-W"
// "main" "-L" "Cpp" "-t" "-T" "link:exe" "-h" "libmmfile.mlib" "-W" "mainhg"
// "libmwsglm.mlib" "hier_community.m" "Default.m" "Stop_Simulation.m"
// "Call_SaveLoad_Fig.m" "SaveLoad_Fig.m" "SaveLoad.m" "Load_Population_Data.m"
// "Save_Population_Data.m" "Start_hier_community.m" "MyInline.m" "My_Eval.m"
// "isnumber.m" "Find_Var.m" "Change_Number_of_Populations.m"
// "Switch_Populations.m" "Store_Parameters.m" 
//
#include "Switch_Populations.hpp"
#include "Find_Var.hpp"
#include "cla.hpp"
#include "libmatlbm.hpp"
#include "libmmfile.hpp"
#include "mesh.hpp"
#include "title.hpp"
#include "xlabel.hpp"
#include "ylabel.hpp"

static mxChar _array1_[154] = { 'R', 'u', 'n', '-', 't', 'i', 'm', 'e', ' ',
                                'E', 'r', 'r', 'o', 'r', ':', ' ', 'F', 'i',
                                'l', 'e', ':', ' ', 'S', 'w', 'i', 't', 'c',
                                'h', '_', 'P', 'o', 'p', 'u', 'l', 'a', 't',
                                'i', 'o', 'n', 's', ' ', 'L', 'i', 'n', 'e',
                                ':', ' ', '1', ' ', 'C', 'o', 'l', 'u', 'm',
                                'n', ':', ' ', '1', ' ', 'T', 'h', 'e', ' ',
                                'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ',
                                '"', 'S', 'w', 'i', 't', 'c', 'h', '_', 'P',
                                'o', 'p', 'u', 'l', 'a', 't', 'i', 'o', 'n',
                                's', '"', ' ', 'w', 'a', 's', ' ', 'c', 'a',
                                'l', 'l', 'e', 'd', ' ', 'w', 'i', 't', 'h',
                                ' ', 'm', 'o', 'r', 'e', ' ', 't', 'h', 'a',
                                'n', ' ', 't', 'h', 'e', ' ', 'd', 'e', 'c',
                                'l', 'a', 'r', 'e', 'd', ' ', 'n', 'u', 'm',
                                'b', 'e', 'r', ' ', 'o', 'f', ' ', 'o', 'u',
                                't', 'p', 'u', 't', 's', ' ', '(', '0', ')',
                                '.' };
static mwArray _mxarray0_ = mclInitializeString(154, _array1_);

static mxChar _array3_[153] = { 'R', 'u', 'n', '-', 't', 'i', 'm', 'e', ' ',
                                'E', 'r', 'r', 'o', 'r', ':', ' ', 'F', 'i',
                                'l', 'e', ':', ' ', 'S', 'w', 'i', 't', 'c',
                                'h', '_', 'P', 'o', 'p', 'u', 'l', 'a', 't',
                                'i', 'o', 'n', 's', ' ', 'L', 'i', 'n', 'e',
                                ':', ' ', '1', ' ', 'C', 'o', 'l', 'u', 'm',
                                'n', ':', ' ', '1', ' ', 'T', 'h', 'e', ' ',
                                'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ',
                                '"', 'S', 'w', 'i', 't', 'c', 'h', '_', 'P',
                                'o', 'p', 'u', 'l', 'a', 't', 'i', 'o', 'n',
                                's', '"', ' ', 'w', 'a', 's', ' ', 'c', 'a',
                                'l', 'l', 'e', 'd', ' ', 'w', 'i', 't', 'h',
                                ' ', 'm', 'o', 'r', 'e', ' ', 't', 'h', 'a',
                                'n', ' ', 't', 'h', 'e', ' ', 'd', 'e', 'c',
                                'l', 'a', 'r', 'e', 'd', ' ', 'n', 'u', 'm',
                                'b', 'e', 'r', ' ', 'o', 'f', ' ', 'i', 'n',
                                'p', 'u', 't', 's', ' ', '(', '0', ')', '.' };
static mwArray _mxarray2_ = mclInitializeString(153, _array3_);

static mxChar _array5_[3] = { 'T', 'a', 'g' };
static mwArray _mxarray4_ = mclInitializeString(3, _array5_);

static mxChar _array7_[23] = { 'F', 'i', 'g', '_', 'm', 'u', 'l', 't',
                               'i', 'p', 'l', 'e', '_', 'p', 'o', 'p',
                               'u', 'l', 'a', 't', 'i', 'o', 'n' };
static mwArray _mxarray6_ = mclInitializeString(23, _array7_);

static mxChar _array9_[21] = { 'P', 'o', 'p', 'u', 'p', 'M', 'e',
                               'n', 'u', '_', 'p', 'o', 'p', 'u',
                               'l', 'a', 't', 'i', 'o', 'n', 's' };
static mwArray _mxarray8_ = mclInitializeString(21, _array9_);

static mxChar _array11_[11] = { 'E', 'd', 'i', 't', 'T', 'e',
                                'x', 't', '_', 'u', 'o' };
static mwArray _mxarray10_ = mclInitializeString(11, _array11_);

static mxChar _array13_[20] = { 'E', 'd', 'i', 't', 'T', 'e', 'x',
                                't', '_', 'g', 'r', 'o', 'w', 't',
                                'h', '_', 'r', 'a', 't', 'e' };
static mwArray _mxarray12_ = mclInitializeString(20, _array13_);

static mxChar _array15_[22] = { 'E', 'd', 'i', 't', 'T', 'e', 'x', 't',
                                '_', 'm', 'o', 'r', 'a', 'l', 'i', 't',
                                'y', '_', 'r', 'a', 't', 'e' };
static mwArray _mxarray14_ = mclInitializeString(22, _array15_);

static mxChar _array17_[26] = { 'E', 'd', 'i', 't', 'T', 'e', 'x', 't', '_',
                                'r', 'e', 'p', 'r', 'o', 'd', 'u', 'c', 't',
                                'i', 'o', 'n', '_', 'r', 'a', 't', 'e' };
static mwArray _mxarray16_ = mclInitializeString(26, _array17_);

static mxChar _array19_[15] = { 'E', 'd', 'i', 't', 'T', 'e', 'x', 't',
                                '_', 'i', 'n', 'f', 'l', 'o', 'w' };
static mwArray _mxarray18_ = mclInitializeString(15, _array19_);

static mxChar _array21_[26] = { 'E', 'd', 'i', 't', 'T', 'e', 'x', 't', '_',
                                'w', 'e', 'i', 'g', 'h', 'i', 'n', 'g', '_',
                                'f', 'u', 'n', 'c', 't', 'i', 'o', 'n' };
static mwArray _mxarray20_ = mclInitializeString(26, _array21_);

static mxChar _array23_[20] = { 'E', 'd', 'i', 't', 'T', 'e', 'x',
                                't', '_', 'P', 'r', 'o', 'b', 'a',
                                'b', 'i', 'l', 'i', 't', 'y' };
static mwArray _mxarray22_ = mclInitializeString(20, _array23_);

static mxChar _array25_[23] = { 'A', 'x', 'e', 's', '_', 'p', 'o', 'p',
                                'u', 'l', 'a', 't', 'i', 'o', 'n', '_',
                                'd', 'e', 'n', 's', 'i', 't', 'y' };
static mwArray _mxarray24_ = mclInitializeString(23, _array25_);

static mxChar _array27_[22] = { 'A', 'x', 'e', 's', '_', 'p', 'o', 'p',
                                'u', 'l', 'a', 't', 'i', 'o', 'n', '_',
                                'm', 'o', 'm', 'e', 'n', 't' };
static mwArray _mxarray26_ = mclInitializeString(22, _array27_);

static mxChar _array29_[5] = { 'V', 'a', 'l', 'u', 'e' };
static mwArray _mxarray28_ = mclInitializeString(5, _array29_);

static mxChar _array33_[2] = { 'u', 'o' };
static mxArray * _mxarray32_ = mclInitializeString(2, _array33_);

static mxChar _array35_[1] = { 'g' };
static mxArray * _mxarray34_ = mclInitializeString(1, _array35_);

static mxChar _array37_[1] = { 'm' };
static mxArray * _mxarray36_ = mclInitializeString(1, _array37_);

static mxChar _array39_[1] = { 'b' };
static mxArray * _mxarray38_ = mclInitializeString(1, _array39_);

static mxChar _array41_[1] = { 'c' };
static mxArray * _mxarray40_ = mclInitializeString(1, _array41_);

static mxChar _array43_[1] = { 'w' };
static mxArray * _mxarray42_ = mclInitializeString(1, _array43_);

static mxChar _array45_[3] = { 'g', 'a', 'm' };
static mxArray * _mxarray44_ = mclInitializeString(3, _array45_);

static mxArray * _array31_[7] = { _mxarray32_, _mxarray34_, _mxarray36_,
                                  _mxarray38_, _mxarray40_, _mxarray42_,
                                  _mxarray44_ };
static mwArray _mxarray30_ = mclInitializeCellVector(1, 7, _array31_);

static mxChar _array47_[8] = { 'U', 's', 'e', 'r', 'D', 'a', 't', 'a' };
static mwArray _mxarray46_ = mclInitializeString(8, _array47_);
static mwArray _mxarray48_ = mclInitializeDoubleVector(0, 0, (double *)NULL);
static mwArray _mxarray49_ = mclInitializeDouble(3.0);

static mxChar _array51_[6] = { 'S', 't', 'r', 'i', 'n', 'g' };
static mwArray _mxarray50_ = mclInitializeString(6, _array51_);
static mwArray _mxarray52_ = mclInitializeCharVector(0, 0, (mxChar *)NULL);
static mwArray _mxarray53_ = mclInitializeDouble(4.0);

static mxChar _array55_[6] = { 's', 't', 'r', 'i', 'n', 'g' };
static mwArray _mxarray54_ = mclInitializeString(6, _array55_);

static mxChar _array59_[1] = { 'x' };
static mxArray * _mxarray58_ = mclInitializeString(1, _array59_);

static mxChar _array61_[1] = { 'y' };
static mxArray * _mxarray60_ = mclInitializeString(1, _array61_);

static mxArray * _array57_[2] = { _mxarray58_, _mxarray60_ };
static mwArray _mxarray56_ = mclInitializeCellVector(1, 2, _array57_);
static mwArray _mxarray62_ = mclInitializeString(1, _array59_);
static mwArray _mxarray63_ = mclInitializeDouble(1.0);
static mwArray _mxarray64_ = mclInitializeDouble(2.0);

static mxChar _array66_[1] = { 't' };
static mwArray _mxarray65_ = mclInitializeString(1, _array66_);

static mxChar _array68_[11] = { 'P', 'o', 'p', 'u', 'l', 'a',
                                't', 'i', 'o', 'n', ' ' };
static mwArray _mxarray67_ = mclInitializeString(11, _array68_);

static mxChar _array70_[21] = { ':', ' ', ' ', 'P', 'o', 'p', 'u',
                                'l', 'a', 't', 'i', 'o', 'n', ' ',
                                'D', 'e', 'n', 's', 'i', 't', 'y' };
static mwArray _mxarray69_ = mclInitializeString(21, _array70_);

static mxChar _array72_[5] = { 'C', 'o', 'l', 'o', 'r' };
static mwArray _mxarray71_ = mclInitializeString(5, _array72_);

static mxChar _array74_[4] = { 'b', 'l', 'u', 'e' };
static mwArray _mxarray73_ = mclInitializeString(4, _array74_);

static mxChar _array76_[8] = { 'F', 'o', 'n', 't', 'S', 'i', 'z', 'e' };
static mwArray _mxarray75_ = mclInitializeString(8, _array76_);
static mwArray _mxarray77_ = mclInitializeDouble(10.0);

static mxChar _array79_[5] = { 'U', 'n', 'i', 't', 's' };
static mwArray _mxarray78_ = mclInitializeString(5, _array79_);

static mxChar _array81_[10] = { 'n', 'o', 'r', 'm', 'a',
                                'l', 'i', 'z', 'e', 'd' };
static mwArray _mxarray80_ = mclInitializeString(10, _array81_);

static mxChar _array83_[20] = { ':', ' ', ' ', 'P', 'o', 'p', 'u',
                                'l', 'a', 't', 'i', 'o', 'n', ' ',
                                'M', 'o', 'm', 'e', 'n', 't' };
static mwArray _mxarray82_ = mclInitializeString(20, _array83_);

void InitializeModule_Switch_Populations() {
}

void TerminateModule_Switch_Populations() {
    mxDestroyArray(_mxarray60_);
    mxDestroyArray(_mxarray58_);
    mxDestroyArray(_mxarray44_);
    mxDestroyArray(_mxarray42_);
    mxDestroyArray(_mxarray40_);
    mxDestroyArray(_mxarray38_);
    mxDestroyArray(_mxarray36_);
    mxDestroyArray(_mxarray34_);
    mxDestroyArray(_mxarray32_);
}

static void MSwitch_Populations();

_mexLocalFunctionTable _local_function_table_Switch_Populations
  = { 0, (mexFunctionTableEntry *)NULL };

//
// The function "Switch_Populations" contains the normal interface for the
// "Switch_Populations" M-function from file
// "C:\shu\hier_community_exe\Switch_Populations.m" (lines 1-84). This function
// processes any input arguments and passes them to the implementation version
// of the function, appearing above.
//
void Switch_Populations() {
    MSwitch_Populations();
}

//
// The function "mlxSwitch_Populations" contains the feval interface for the
// "Switch_Populations" M-function from file
// "C:\shu\hier_community_exe\Switch_Populations.m" (lines 1-84). The feval
// function calls the implementation version of Switch_Populations through this
// function. This function processes any input arguments and passes them to the
// implementation version of the function, appearing above.
//
void mlxSwitch_Populations(int nlhs,
                           mxArray * plhs[],
                           int nrhs,
                           mxArray * prhs[]) {
    MW_BEGIN_MLX();
    {
        if (nlhs > 0) {
            error(_mxarray0_);
        }
        if (nrhs > 0) {
            error(_mxarray2_);
        }
        MSwitch_Populations();
    }
    MW_END_MLX();
}

//
// The function "MSwitch_Populations" is the implementation version of the
// "Switch_Populations" M-function from file
// "C:\shu\hier_community_exe\Switch_Populations.m" (lines 1-84). It contains
// the actual compiled code for that M-function. It is a static function and
// must only be called from one of the interface functions, appearing below.
//
//
// function Switch_Populations
//
static void MSwitch_Populations() {
    mwLocalFunctionTable save_local_function_table_
      (&_local_function_table_Switch_Populations);
    mwArray Ptotal(mclGetUninitializedArray());
    mwArray u(mclGetUninitializedArray());
    mwArray t(mclGetUninitializedArray());
    mwArray x(mclGetUninitializedArray());
    mwArray hierarchy(mclGetUninitializedArray());
    mwArray w_pos(mclGetUninitializedArray());
    mwArray w_var(mclGetUninitializedArray());
    mwArray w_f(mclGetUninitializedArray());
    mwArray ans(mclGetUninitializedArray());
    mwArray value(mclGetUninitializedArray());
    mwArray i(mclGetUninitializedArray());
    mwArray L(mclGetUninitializedArray());
    mwArray parameters(mclGetUninitializedArray());
    mwArray parameters_str(mclGetUninitializedArray());
    mwArray handles(mclGetUninitializedArray());
    mwArray current_population(mclGetUninitializedArray());
    mwArray axes_moment_handle(mclGetUninitializedArray());
    mwArray axes_density_handle(mclGetUninitializedArray());
    mwArray probability_handle(mclGetUninitializedArray());
    mwArray weighing_function_handle(mclGetUninitializedArray());
    mwArray inflow_handle(mclGetUninitializedArray());
    mwArray reproduction_rate_handle(mclGetUninitializedArray());
    mwArray morality_rate_handle(mclGetUninitializedArray());
    mwArray growth_rate_handle(mclGetUninitializedArray());
    mwArray uo_handle(mclGetUninitializedArray());
    mwArray populations_handle(mclGetUninitializedArray());
    mwArray multiple_population_handle(mclGetUninitializedArray());
    //
    // 
    // multiple_population_handle = findobj('Tag','Fig_multiple_population');
    //
    multiple_population_handle = findobj(mwVarargin(_mxarray4_, _mxarray6_));
    //
    // populations_handle = findobj(multiple_population_handle,'Tag','PopupMenu_populations');
    //
    populations_handle
      = findobj(
          mwVarargin(
            mwVv(multiple_population_handle, "multiple_population_handle"),
            _mxarray4_,
            _mxarray8_));
    //
    // uo_handle = findobj(multiple_population_handle,'Tag','EditText_uo');
    //
    uo_handle
      = findobj(
          mwVarargin(
            mwVv(multiple_population_handle, "multiple_population_handle"),
            _mxarray4_,
            _mxarray10_));
    //
    // growth_rate_handle = findobj(multiple_population_handle,'Tag','EditText_growth_rate');
    //
    growth_rate_handle
      = findobj(
          mwVarargin(
            mwVv(multiple_population_handle, "multiple_population_handle"),
            _mxarray4_,
            _mxarray12_));
    //
    // morality_rate_handle = findobj(multiple_population_handle,'Tag','EditText_morality_rate');
    //
    morality_rate_handle
      = findobj(
          mwVarargin(
            mwVv(multiple_population_handle, "multiple_population_handle"),
            _mxarray4_,
            _mxarray14_));
    //
    // reproduction_rate_handle = findobj(multiple_population_handle,'Tag','EditText_reproduction_rate');
    //
    reproduction_rate_handle
      = findobj(
          mwVarargin(
            mwVv(multiple_population_handle, "multiple_population_handle"),
            _mxarray4_,
            _mxarray16_));
    //
    // inflow_handle = findobj(multiple_population_handle,'Tag','EditText_inflow');
    //
    inflow_handle
      = findobj(
          mwVarargin(
            mwVv(multiple_population_handle, "multiple_population_handle"),
            _mxarray4_,
            _mxarray18_));
    //
    // weighing_function_handle = findobj(multiple_population_handle,'Tag','EditText_weighing_function');
    //
    weighing_function_handle
      = findobj(
          mwVarargin(
            mwVv(multiple_population_handle, "multiple_population_handle"),
            _mxarray4_,
            _mxarray20_));
    //
    // probability_handle=findobj(multiple_population_handle,'Tag','EditText_Probability');
    //
    probability_handle
      = findobj(
          mwVarargin(
            mwVv(multiple_population_handle, "multiple_population_handle"),
            _mxarray4_,
            _mxarray22_));
    //
    // axes_density_handle = findobj(multiple_population_handle,'Tag','Axes_population_density');
    //
    axes_density_handle
      = findobj(
          mwVarargin(
            mwVv(multiple_population_handle, "multiple_population_handle"),
            _mxarray4_,
            _mxarray24_));
    //
    // axes_moment_handle = findobj(multiple_population_handle,'Tag','Axes_population_moment');
    //
    axes_moment_handle
      = findobj(
          mwVarargin(
            mwVv(multiple_population_handle, "multiple_population_handle"),
            _mxarray4_,
            _mxarray26_));
    //
    // 
    // current_population = get(populations_handle,'Value');
    //
    current_population
      = Nget(
          1,
          mwVarargin(
            mwVv(populations_handle, "populations_handle"), _mxarray28_));
    //
    // 
    // handles = [uo_handle,growth_rate_handle,morality_rate_handle,reproduction_rate_handle,...
    //
    handles
      = horzcat(
          mwVarargin(
            mwVv(uo_handle, "uo_handle"),
            mwVv(growth_rate_handle, "growth_rate_handle"),
            mwVv(morality_rate_handle, "morality_rate_handle"),
            mwVv(reproduction_rate_handle, "reproduction_rate_handle"),
            mwVv(inflow_handle, "inflow_handle"),
            mwVv(weighing_function_handle, "weighing_function_handle"),
            mwVv(probability_handle, "probability_handle")));
    //
    // inflow_handle,weighing_function_handle,probability_handle];
    // 
    // parameters_str = {'uo','g','m','b','c','w','gam'};
    //
    parameters_str = _mxarray30_;
    //
    // 
    // parameters = get(multiple_population_handle,'UserData');
    //
    parameters
      = Nget(
          1,
          mwVarargin(
            mwVv(multiple_population_handle, "multiple_population_handle"),
            _mxarray46_));
    //
    // 
    // L = length(handles);
    //
    L = mclLengthInt(mwVv(handles, "handles"));
    //
    // 
    // for i = 1:L
    //
    {
        int v_(mclForIntStart(1));
        int e_(mclForIntEnd(mwVv(L, "L")));
        if (v_ > e_) {
            i = _mxarray48_;
        } else {
            //
            // value = getfield(parameters{3}(current_population),parameters_str{i});
            // 
            // if(~isempty(value))
            // set(handles(i),'String',num2str(value));
            // else
            // set(handles(i),'String','');
            // end
            // 
            // end
            //
            for (; ; ) {
                value
                  = feval(
                      mwValueVarargout(),
                      mlxGetfield,
                      mwVarargin(
                        mwVe(
                          mwVsv(parameters, "parameters").cell(_mxarray49_)(
                            mwVsv(current_population, "current_population"))),
                        mwVe(
                          mwVsv(parameters_str, "parameters_str").cell(v_))));
                if (mclNotBool(mwVe(isempty(mwVv(value, "value"))))) {
                    ans.EqAns(
                      Nset(
                        0,
                        mwVarargin(
                          mwVe(mclIntArrayRef(mwVsv(handles, "handles"), v_)),
                          _mxarray50_,
                          mwVe(num2str(mwVv(value, "value"))))));
                } else {
                    ans.EqAns(
                      Nset(
                        0,
                        mwVarargin(
                          mwVe(mclIntArrayRef(mwVsv(handles, "handles"), v_)),
                          _mxarray50_,
                          _mxarray52_)));
                }
                if (v_ == e_) {
                    break;
                }
                ++v_;
            }
            i = v_;
        }
    }
    //
    // 
    // 
    // if (~isempty(parameters{4}))
    //
    if (mclNotBool(
          mwVe(
            feval(
              mwValueVarargout(),
              mlxIsempty,
              mwVarargin(
                mwVe(mwVsv(parameters, "parameters").cell(_mxarray53_))))))) {
        //
        // 
        // w_f=get(handles(6),'string');
        //
        w_f
          = Nget(
              1,
              mwVarargin(
                mwVe(mclIntArrayRef(mwVsv(handles, "handles"), 6)),
                _mxarray54_));
        //
        // [w_var,w_pos] = Find_Var(w_f,{'x','y'});
        //
        w_var = Find_Var(&w_pos, mwVv(w_f, "w_f"), _mxarray56_);
        //
        // hierarchy=any(strcmp('x',w_var));
        //
        hierarchy = any(mwVe(strcmp(_mxarray62_, mwVv(w_var, "w_var"))));
        //
        // 
        // x = parameters{4}{1};
        //
        x = mwVsv(parameters, "parameters").cell(_mxarray53_).cell(_mxarray63_);
        //
        // t = parameters{4}{2};
        //
        t = mwVsv(parameters, "parameters").cell(_mxarray53_).cell(_mxarray64_);
        //
        // u = parameters{4}{3};
        //
        u = mwVsv(parameters, "parameters").cell(_mxarray53_).cell(_mxarray49_);
        //
        // Ptotal = parameters{4}{4};
        //
        Ptotal
          = mwVsv(parameters, "parameters").cell(_mxarray53_).cell(
              _mxarray53_);
        //
        // 
        // if(current_population<=length(u))
        //
        if (mclLeBool(
              mwVv(current_population, "current_population"),
              mclLengthInt(mwVv(u, "u")))) {
            //
            // 
            // axes(axes_density_handle);
            //
            ans.EqAns(
              Naxes(
                0,
                mwVarargin(mwVv(axes_density_handle, "axes_density_handle"))));
            //
            // cla;
            //
            ans.EqAns(Ncla(0, mwVarargin()));
            //
            // mesh(x,t,u{current_population})
            //
            ans.EqPrintAns(
              Nmesh(
                0,
                mwVarargin(
                  mwVv(x, "x"),
                  mwVv(t, "t"),
                  mwVe(
                    mwVsv(u, "u").cell(
                      mwVsv(current_population, "current_population"))))));
            //
            // xlabel('x');
            //
            ans.EqAns(Nxlabel(0, _mxarray62_, mwVarargin()));
            //
            // ylabel('t');
            //
            ans.EqAns(Nylabel(0, _mxarray65_, mwVarargin()));
            //
            // title(['Population ',num2str(current_population),':  Population Density'],...
            //
            ans.EqAns(
              Ntitle(
                0,
                horzcat(
                  mwVarargin(
                    _mxarray67_,
                    mwVe(
                      num2str(mwVv(current_population, "current_population"))),
                    _mxarray69_)),
                mwVarargin(
                  _mxarray71_,
                  _mxarray73_,
                  _mxarray75_,
                  _mxarray77_,
                  _mxarray78_,
                  _mxarray80_)));
            //
            // 'Color','blue','FontSize',10,'Units','normalized');
            // set(axes_density_handle,'Tag','Axes_population_density');
            //
            ans.EqAns(
              Nset(
                0,
                mwVarargin(
                  mwVv(axes_density_handle, "axes_density_handle"),
                  _mxarray4_,
                  _mxarray24_)));
            //
            // 
            // if (hierarchy)
            //
            if (tobool(mwVv(hierarchy, "hierarchy"))) {
                //
                // axes(axes_moment_handle);
                //
                ans.EqAns(
                  Naxes(
                    0,
                    mwVarargin(
                      mwVv(axes_moment_handle, "axes_moment_handle"))));
                //
                // cla; 
                //
                ans.EqAns(Ncla(0, mwVarargin()));
                //
                // mesh(x,t,Ptotal{current_population})
                //
                ans.EqPrintAns(
                  Nmesh(
                    0,
                    mwVarargin(
                      mwVv(x, "x"),
                      mwVv(t, "t"),
                      mwVe(
                        mwVsv(Ptotal, "Ptotal").cell(
                          mwVsv(current_population, "current_population"))))));
                //
                // xlabel('x');
                //
                ans.EqAns(Nxlabel(0, _mxarray62_, mwVarargin()));
                //
                // ylabel('t');
                //
                ans.EqAns(Nylabel(0, _mxarray65_, mwVarargin()));
            //
            // else
            //
            } else {
                //
                // axes(axes_moment_handle);
                //
                ans.EqAns(
                  Naxes(
                    0,
                    mwVarargin(
                      mwVv(axes_moment_handle, "axes_moment_handle"))));
                //
                // cla;
                //
                ans.EqAns(Ncla(0, mwVarargin()));
                //
                // plot(t,Ptotal{current_population}(:,1));
                //
                ans.EqAns(
                  Nplot(
                    0,
                    mwVarargin(
                      mwVv(t, "t"),
                      mwVe(
                        mwVsv(Ptotal, "Ptotal").cell(
                          mwVsv(current_population, "current_population"))(
                          colon(), _mxarray63_)))));
                //
                // xlabel('t');
                //
                ans.EqAns(Nxlabel(0, _mxarray65_, mwVarargin()));
            //
            // end
            //
            }
            //
            // title(['Population ',num2str(current_population),':  Population Moment'],...
            //
            ans.EqAns(
              Ntitle(
                0,
                horzcat(
                  mwVarargin(
                    _mxarray67_,
                    mwVe(
                      num2str(mwVv(current_population, "current_population"))),
                    _mxarray82_)),
                mwVarargin(
                  _mxarray71_,
                  _mxarray73_,
                  _mxarray75_,
                  _mxarray77_,
                  _mxarray78_,
                  _mxarray80_)));
            //
            // 'Color','blue','FontSize',10,'Units','normalized');
            // set(axes_moment_handle,'Tag','Axes_population_moment');
            //
            ans.EqAns(
              Nset(
                0,
                mwVarargin(
                  mwVv(axes_moment_handle, "axes_moment_handle"),
                  _mxarray4_,
                  _mxarray26_)));
        //
        // 
        // end
        //
        }
    //
    // 
    // end
    //
    }
    //
    // 
    // 
    // 
    // 
    // 
    //
}
