This page shows how to setup Matlab with user Python install (e.g. Anaconda Python) on Linux, Mac or Windows.
Install Python for Matlab
Matlab is designed to work with specific Python versions for each Matlab version.
Matlab will not specifically tell you when you’re using an incompatible Python version, but you may get unstable operation or errors.
In general, we recommend for Python ↔ Matlab interfacing:
The usual course instructor was unexpectedly out of town, and they thought I would be an ideal fit for their RF systems engineering lab course.
I have a lifelong experience base in all aspects of RF systems design, so I thought I would turn this into a live learning opportunity for the students as well.
I did precisely zero preparation for the course.
Upon arriving, I introduced myself as someone who had made a career in RF systems design before college.
I said that I wanted to show them how I had to teach myself things as a formally educated engineering student, and we’d learn together the topic at hand.
We used intelligently chosen web searches, some of which turned into dead ends.
We looked at data sheets of commercial products to get a sense of what performance was reasonable for the RF subsystem we were designing.
Then we set about to model the device, including
and other KPI.
The point of this self-induced exercise was, we should not be intimidated by something we haven’t done before, or haven’t done recently.
We shouldn’t be afraid to say I don’t know, in fact this is an asset of experience, to know the boundaries of one’s engineering competence.
How I approach potential engineering contracts is that I say I will try to find someone with expertise in the needed area.
Maybe it will be me, but if not I can help direct the prospective client to the needed expert.
That shows authentic confidence and competence in one’s practice area, and that one isn’t overreaching to get extra income that quarter.
We build all our Fortran projects using the CMake build system.
We are increasingly using Meson as well as CMake as Fortran support in Meson is growing rapidly (due in part to our code contributions).
The most important aspects of a build system are generation speed and build speed.
Regardless of team size, for non-trivial projects in any compiled language, build speed can be a significant pain point.
Even for medium projects, the seconds lost repeatedly building add up to annoyance and lost productivity for developers.
In this regard, CMake and Meson are among the fastest generators, while SCons and Autotools are among the slowest.
Ninja is known to be generally faster than GNU Make, particularly for the case where only a few out of very many files need to be rebuilt.
This is the usual case for developers.
So as long as the generator works with Ninja, you can get fast builds.
Meson generates Ninja build files.
Meson 0.50 massively increased support for Fortran compilers and features, so check out Meson again if it didn’t work for you on Fortran previously.
using Meson vs. CMake
Meson is a Python ≥ 3.5 program without external dependencies.
It’s easy to run the latest development snapshot (master Git branch) as a result.
git clone https://github.com/mesonbuild/meson
pip install -e .
Since Meson generates Ninja build files, you will need to
With Meson, the code build process goes like:
Fortran has a long legacy of preprocessing systems, reaching back at least to the 1970s when C was not yet widely known.
I would argue that modern Fortran ≥ 2008 has eliminated most preprocessors use cases.
It’s usually much cleaner and quicker (build/runtime) to use Fortran submodule to switch functionality such as
MKL vs. Atlas vs. Netlib Lapack
using CMake, for example.
Numerous Python preprocessors have arisen (and sunk) along with the usual C/C++-based preprocessors.
The only thing we use preprocessors for is very simple single-line statements, where adding a submodule would be significantly more cumbersome than a one-liner preprocessor statement.
Historically, very elaborate Fortran preprocessors were developed such that they nearly became a language unto themselves.
CMake by default searches for shared libs before static libs.
Sometimes a project needs to specifically link external or internal static libs, even if shared libs are present.
A simple cross-platform way to do this is to include in CMakeLists.txt, before any find_library() or find_package():
Reading RINEX files in Python or other languages historically required compiling or buying complex software.
Several years ago, we created the
Python 3 program and library to be used with RINEX OBS and NAV files, including Hatanaka compressed files or other compression wrappers like ZIP.
Version 1.9 of GeoRINEX added the ability to read only every N seconds from a RINEX file with option georinex.load(..., interval=).
This greatly speeds up reading where coarser time intervals than the RINEX file provides is needed.
GeoRINEX uses performance-oriented techniques to read RINEX files at speeds approaching compiled languages, using Pure Python + Numpy and Xarray for metadata rich results.
If you use GNSS and RINEX in your work, you will probably like
for Python 3.