Skip to content

Instantly share code, notes, and snippets.

View GeorgySk's full-sized avatar

Georgy Skorobogatov GeorgySk

  • Spain, Barcelona
View GitHub Profile
@GeorgySk
GeorgySk / call_matlab.py
Last active April 24, 2018 09:17
Example of how to call MATLAB function from Python and get output
"""
For installation see:
https://uk.mathworks.com/help/matlab/matlab_external/install-the-matlab-engine-for-python.html
In order to install matlab.engine in non-default location,
e.g. conda environment, see:
https://uk.mathworks.com/help/matlab/matlab_external/install-matlab-engine-api-for-python-in-nondefault-locations.html
(My advice is to install it to a base environment,
installing to different environments seems to be buggy)
If this doesn't work, try `pip install -e .` from *matlabroot\extern\engines\python*
@GeorgySk
GeorgySk / stereographic.py
Last active April 23, 2018 13:43
stereographic projections; convert longitude and latitude to meters;
from typing import (Union,
Optional,
Tuple)
import numpy as np
def projection(latitudes: np.ndarray,
longitudes: np.ndarray,
*,