
Python for MATLAB Development: Extend MATLAB with 300,000+ Modules from the Python Package Index
Albert Danial
Résumé
MATLAB can run Python code!
Python for MATLAB Development shows you how to enhance MATLAB with Python solutions to a vast array of computational problems in science, engineering, optimization, statistics, finance, and simulation.
MATLAB can run Python code!
Python for MATLAB Development shows you how to enhance MATLAB with Python solutions to a vast array of computational problems in science, engineering, optimization, statistics, finance, and simulation. It is three books in one:
-
A thorough Python tutorial that leverages your existing MATLAB knowledge with a comprehensive collection of MATLAB/Python equivalent expressions
-
A reference guide to setting up and managing a Python environment that integrates cleanly with MATLAB
-
A collection of recipes that demonstrate Python solutions invoked directly from MATLAB
This book shows how to call Python functions to enhance MATLAB's capabilities. Specifically, you'll see how Python helps MATLAB:
- Run faster with numba
- Distribute work to a compute cluster with dask
- Find symbolic solutions to integrals, derivatives, and series summations with SymPy
- Overlay data on maps with Cartopy
- Solve mixed-integer linear programming problems with PuLP
- Interact with Redis via pyredis, PostgreSQL via psycopg2, and MongoDB via pymongo
- Read and write file formats that are not natively understood by MATLAB, such as SQLite, YAML, and ini
Who This Book Is For
MATLAB developers who are new to Python and other developers with some prior experience with MATLAB, R, IDL, or Mathematica.
Part I - Learning Python through MATLAB comparisons
Chapter 2: Installation Goal: Create a working Python installation on the computer with MATLAB * Downloads * Post-Install Checkout * ipython, IDE's * Python and MATLAB Versions Used in This Book
Chapter 3: Language Basics Goal: Learn the basic mechanics of Python * Assignment * Printing * Indentation * Indexing * `for` Loops * `while` Loops * `if` Statements * Functions * Comments * Line Continuation * Exceptions * Modules and Packages
Chapter 4: Data Containers Goal: Learn about lists, dictionaries, etc, and how these compare to MATLAB matrices and cell arrays * NumPy Arrays * Strings * Python Lists and MATLAB Cell Arrays * Python Tuples * Python Sets and MATLAB Set Operations * Python Dictionaries and MATLAB Maps * Structured Data * Tables * Caveat: ```=`' copies a reference for non-scalars!
Chapter 5: Date and Time Goal: Learn about measuring, storing, and converting temporal values. * Time * Dates * Timezones * Time Conversions to and from `datetime` Objects
Chapter 6: Input and Output Goal: Learn about reading and writing data, with emphasis on numeric data and scientific file formats like HDF and NetCDF. * Reading and Writing Text Files * Reading and Writing Binary Files * Reading and Writing Pickle Files * Reading and Writing `.mat` files * Command Line Input * Interactive Input * Receiving and Sending over a Network * Interacting with Databases
Chapter 7: Interacting with the File System Goal: Show how Python manages file system operations. * Reading Directory Contents * Finding Files * Deleting Files * Creating Directories * Deleting Directories * Walking Directory Trees
Chapter 8: Interacting with the Operating System and External Executables Goal: Show how to make system calls in Python and how these differ from MATLAB. * Reading, setting environment variables * Calling External Executables * Inspecting the Process Table and Process Resources
Part II - MATLAB with Python
Chapter 9: MATLAB/Python Integration Goal: Show how to make system calls in Python and how these differ from MATLAB. * MATLAB's `py` Module * System calls and File I/O * TCP/IP Exchange
Chapter 10: Object Oriented ProgrammingGoal: Demonstrate Python's OO semantics compared to MATLAB * Classes * Custom Exceptions * Performance Implications
Chapter 11: NumPy and SciPy Goal: Introduce Python's numeric and scientific computing capability. This is by far the largest chapter in the book. * NumPy Arrays * Linear Algebra * Sparse Matrices * Interpolation * Curve Fitting * Statistics * Finding Roots * Optimization * Differential Equations * Symbolic Mathematics * Unit Systems
Chapter 12: Plotting Goal: Demonstrate how publication-quality plots are produced in Python alongside MATLAB equivalents * Point and Line Plots * Area Plots * Animations * Plotting on Maps * 3D Plots * Making plots in batch mode
Chapter 13: Tables and DataframesGoal: Show Pandas dataframes in comparison to MATLAB tables (and how the former pre-dates the latter by five years) * Loading tables from files * Table summaries * Cleaning data * Creating tables programmatically * Sorting rows * Table subsets * Iterating over rows * Pivot tables * Adding columns * Deleting columns * Joins across tables
Chapter 14: High Performance ComputingGoal: Demonstrate techniques for profiling Python code and making computationally intensive Python code run faster. Significant performance advantages over MATLAB are shown. * Paths to faster Python code * Reference Problems * Reference Hardware and OS * Baseline performance * Profiling Python Code * Vectorization * Cython * Pythran * Numba * Linking to C, C++, Fortran * Distributed memory parallel processing
Chapter 15: `py` Module ExamplesGoal: A collection of examples that show how Python enables the core MATLAB product to perform tasks that would either require a Toolbox or less-vetted code from the MathWorks' user contributed FileExchange. * Read a YAML File * Write a YAML File * Compute Laplace Transforms * Interact with Redis * Units * Propagate a satellite's orbit * Controls * Plotting on maps
Chapter 16: Language Warts Goal: Identify MATLAB and Python language 'features' that often cause beginners grief. * Dangerous language features * MATLAB * Python * Common Errors
Al has used MATLAB since 1990 and Python since 2006 for algorithm prototyping, earth science data processing, spacecraft mission planning, optimization, visualization, and countless utilities that simplify daily engineering work.
Caractéristiques techniques
PAPIER | |
Éditeur(s) | Apress |
Auteur(s) | Albert Danial |
Parution | 11/04/2022 |
Nb. de pages | 700 |
EAN13 | 9781484272220 |
Avantages Eyrolles.com
Consultez aussi
- Les meilleures ventes en Graphisme & Photo
- Les meilleures ventes en Informatique
- Les meilleures ventes en Construction
- Les meilleures ventes en Entreprise & Droit
- Les meilleures ventes en Sciences
- Les meilleures ventes en Littérature
- Les meilleures ventes en Arts & Loisirs
- Les meilleures ventes en Vie pratique
- Les meilleures ventes en Voyage et Tourisme
- Les meilleures ventes en BD et Jeunesse