Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Warning

Attention:

All scripts in this page are assuming that your current shell is Bash.

  • If you are using some other shell such as tcsh, you can switch to bash in your current session by typing "bash" in your terminal.
  • If you wish to switch permanently to Bash as your default shell here are some instructions:

In order to change your default shell at login from tcsh (or any other shell) to Bash, please execute the following command on a Linux server on the AFS network, such as a rhel6-64* node. (You will be prompted for your password during this process):

ypchsh -s /bin/bash

After that, close the terminal and open a new one. You will be using Bash as the default shell. 

You can check if all went well with the following command in a new Terminal window:

echo $SHELL

Anchor
matpva_top
matpva_top
Python with MATLAB

We can directly call Python library functionality from MATLAB or write Python programs that work with MATLAB.

For information on compatible Python versions, refer to the link: https://www.mathworks.com/support/requirements/python-compatibility.html


To check the Python version in MATLAB, use the following command:

Code Block
languagebash
>> pyenv

ans =

  PythonEnvironment with properties:

          Version: "3.8"
          Executable: "/usr/local/lcls/package/anaconda/envs/python3_env/bin/python"
          Library: "/usr/local/lcls/package/anaconda/envs/python3_env/lib/libpython3.8.so"
          Home: "/usr/local/lcls/package/anaconda/envs/python3_env"
          Status: NotLoaded
    ExecutionMode: InProcess
Note

The library conflicts between MATLAB's and Python's libraries can result in segmentation faults.

If the Python version in the MATLAB environment differs from the one in the Linux environment (the version used in DEV and PROD, you need to update the "startup.m" file located at "$TOOLS/matlab/toolbox/."

Code Block
languagebash
# A snippet of the file:

if strcmp(version('-release'),'2020a') | strcmp(version('-release'),'2022b') | strcmp(version('-release'),'2023a')
   % Setup Python Environment:
   package_top = getenv('PACKAGE_TOP');
   pyenv_path = [package_top '/anaconda/envs/python3_rhel7_env/bin/python'];
   pyenv('Version', pyenv_path,'ExecutionMode','InProcess');
%% Change default add-ons installation folder for Monkey Proof Code Checker
   theSettings = settings();
   theSettings.matlab.addons.InstallationFolder.TemporaryValue = [package_top '/matlab/2020a/SupportPackages'];
end


Anchor
matpva_top
matpva_top
matpva

  • matpva is a powerful extension that provides seamless integration between MATLAB and EPICS 7 through the Python P4P module.

...