0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Oct2PyとMATLAB

Posted at

✅ Oct2Py でできること
• Python から Octave 関数や .m ファイル を呼び出せる
• NumPy 配列と Octave 配列を自動変換してくれる
• グラフ描画 (plot など) も Octave 側で実行可能
• 簡単な数値計算や信号処理ならほぼ問題なく動作

from oct2py import octave
import numpy as np

x = np.linspace(0, 2*np.pi, 100)
y = octave.sin(x) # Octaveのsin関数を呼ぶ
print(y[:5])

⚠️ 制約・注意点
1. MATLAB 完全互換ではない
• Octave 自体が MATLAB のサブセット互換なので、最新の MATLAB 専用関数(特に Simulink, DSP System Toolbox, Deep Learning Toolbox など)は非対応。
2. パフォーマンス
• Python と Octave の間でデータをやり取りするので、大きな配列を頻繁にやりとりすると遅くなる。
3. 依存環境
• GNU Octave を別途インストールしておく必要がある。
• Windows でも Linux でも使えるが、セットアップはやや面倒。
4. 安定性
• 基本的な数値演算や行列計算は安定しているが、Octave 側のエラーが Python 側に出にくい場合がある。

🏆 結論
• 線形代数・FFT・信号処理・最適化など 基礎的な数値演算や関数呼び出しはほぼ問題なく使える。
• ただし MATLAB 特有の高度なToolboxやSimulink依存の処理は不可。
• 小〜中規模の計算や既存の m-file 利用には十分実用的。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?