背景
- Python での数値計算コードが合っているかどうか, Octave でリファレンスを記述して確かめたい.
- Octave での結果を Python 側に持ってきて matplotlib とかでプロットしたい.
- numpy/scipy では提供されていない関数 or Octave のほうが処理が早い関数を呼びたい.
Python から Octave スクリプトを呼ぶ oct2py があります.
インストール
pip install oct2py
でいけます. Pure python なので Windows でもそのままインストールできます.
Octave 側の svd 関数など呼ぶサンプル
ありがとうございます.
OctaveMagic
Jupyter notebook で, inline で magic コマンド(?)として Octave とインタラクトできます.
計算結果の比較
python と Octave での数値計算の結果を比較したい場合,
numpy.testing
あたりを使うのがよいでしょうか.