2. Installation Instructions

2.1. Installing QGen

2.1.1. Windows

To install QGen on Windows simply double-click the setup executable qgen-<version>-x86[_64]-windows-bin.exe and follow the instructions to select an installation directory. In the remainder of this guide the chosen installation directory will be refered to as $QGEN_INSTALL.

This will enable you to use QGen from the Windows command line, however it is much more convenient to use QGen from the MATLAB environment.

To use QGen from your MATLAB environment, please follow the setup process in Setting up QGen in MATLAB.

2.1.2. Linux

To install QGen on Linux extract the archive qgen-<version>-<platform>-bin.tar.gz to a temporary location and run the doinstall script located in the extracted directory.

The script will guide you through the installation process and will ask you to specify the desired installation directory which will be referred to as $QGEN_INSTALL in the remainder of this guide.

To use QGen outside of the MATLAB environment, add the QGen executables location to the PATH environment variable by appending the following line to the file ~/.bashrc or ~/.zshrc depending on which shell is in use:

export PATH=$QGEN_INSTALL/bin:$PATH

However it is much more convenient to use QGen from the MATLAB environment. To do so, please follow the setup process in Setting up QGen in MATLAB.

2.2. Setting up QGen in MATLAB

QGen provides MATLAB scripts and menus allowing to invoke the toolset directly from the MATLAB/Simulink environment.

To setup QGen for usage within MATLAB, please use the following steps:

  1. Start MATLAB.

  2. Ensure that a compiler is set for Simulink using the mex-setup command. This is needed by QGen because it relies on the loadlibrary command that requires a valid compiler to be defined in MATLAB.

  3. Run the following command:

    >> run $QGEN_INSTALL/qgen_install.m
    

    OR

    navigate to the QGen installation directory $QGEN_INSTALL in the MATLAB graphical browser, right-click the script qgen_install.m and click Run.

After completing the above steps, you will be able to use QGen from your MATLAB environment as explained in the remainder of this guide.

2.3. Uninstalling QGen

To uninstall QGen, first perform the following steps to remove it from the MATLAB environment:

  1. Start MATLAB.

  2. Run the following command:

    >> qgen_uninstall
    

    OR

    navigate to the QGen installation directory $QGEN_INSTALL in the MATLAB graphical browser, right-click the script qgen_uninstall.m and click Run.

Then depending on your operating system, use the following steps to completely remove all QGen files.

2.3.1. Windows

  1. Navigate to the QGen installation directory.

  2. Execute uninstall-qgen-<version>.exe and follow the steps.

2.3.2. Linux

  1. Run the following command in your system shell:

    rm -r $QGEN_INSTALL
    
  2. If there are any, remove references to $QGEN_INSTALL from your shell startup files ~/.bashrc or ~/.zshrc.