LoginSignup
43
38

More than 5 years have passed since last update.

OctaveをMac OS X Yosemiteへインストール

Last updated at Posted at 2015-05-03

はじめに

Qiita初投稿です。最近、Courseraの機械学習のサイトを復習する機会があったので、1週間前に買ったMacBook ProにOctaveを入れてみました。(Mac超初心者)

Macの環境

  • MacOS X 10.10 Yosemite
  • homebrew, Xcode, Xcode Command Line Tools, Java8は入っているけど、ほぼまっさらな状態

準備

基本的にはここのサイトの手順に従って、必要なパッケージを入れます。

Octaveのインストール

先程のサイトの"After dependencies"の項目の最後、octaveのインストールで、以下のようなエラーが出ます。


$ brew install octave
Error: No available formula for octave 
Searching formulae...
Searching taps...
homebrew/science/octave     Caskroom/cask/octave    Caskroom/cask/octave

この場合、以下をtapしてください。


$ brew tap homebrew/science
==> Tapping Homebrew/science
Cloning into '/usr/local/Library/Taps/homebrew/homebrew-science'...
remote: Counting objects: 10385, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 10385 (delta 4), reused 0 (delta 0), pack-reused 10375
Receiving objects: 100% (10385/10385), 2.78 MiB | 1.29 MiB/s, done.
Resolving deltas: 100% (5798/5798), done.
Checking connectivity... done.
Tapped 488 formulae (514 files, 5.3M)

これでhomebrew/scienceがインストールできたので、その後に改めてoctaveをインストールします。インストールには少し時間がかかります。


$ brew install octave

最後に、octaveを起動します。


$ octave
No Java runtime present, requesting install.

Javaが無いよ。インストールするように怒られてしまいました。Java8は入っていても、Java6のインストールが必要のようです。
ここからダウンロードしてインストール後、改めてOctaveを起動すると、

$ octave
GNU Octave, version 3.8.2
Copyright (C) 2014 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "x86_64-apple-darwin14.1.0".

Additional information about Octave is available at http://www.octave.org.

Please contribute if you find this software useful.
For more information, visit http://www.octave.org/get-involved.html

Read http://www.octave.org/bugs.html to learn how to submit bug reports.
For information about changes from previous versions, type 'news'.

octave:1>

特に警告もなく、無事起動できました!
一応、動作確認しておきます。

octave:1> w = 10 + sqrt(10)*(randn(1,10000));
octave:2> hist(w)

スクリーンショット 2015-05-04 0.43.20.png

43
38
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
43
38