0
0

More than 3 years have passed since last update.

Python から Octave スクリプトを呼ぶ oct2py のメモ

Posted at

背景

  • 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 あたりを使うのがよいでしょうか.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0