【深度学习笔记】(一)Octave

【深度学习笔记】(一)Octave

介绍Octave

Octave是一种面向科学数学运算的原型语言,内置了强大的数学函数及图形展示工具。原型prototyping设计的意思是使用ovtave进行算法设计、实现、验证等过程。 推荐Octave快速实现算法原型


安装Octave

以mac为例:

1、安装Homebrew

/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

2、更新Homebrew

sudo ln -sf /Applications/Utilities/XQuartz.app/ /Applications/Utilities/X11.app
brew update && brew upgrade

3、安装Gcc

brew install gcc

4、安装Octave

brew install octave

5、验证安装成功

jasondeMacBook-Pro:~ jasonhu$ octave

GNU Octave, version 4.2.1
Copyright (C) 2017 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-darwin16.7.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、逻辑运算

octave:1> 1==3
ans = 0
octave:2> 1|0
ans = 1
octave:3> 1|3
ans = 1
octave:4> 4~=5
ans = 1
octave:5> 9>10
ans = 0
octave:6> 2&&0
ans = 0
octave:7>

2、线性代数运算

octave:7> b = [4;9;2]
b =
4
9
2

octave:8> A = [3 4 5;1 3 1;3 5 9]
A =
3 4 5
1 3 1
3 5 9

octave:9> x = A \ b
x =
-1.5000
4.0000
-1.5000

3、sin(x)函数图

octave:4> x = -10:0.1:10;
octave:5> y = sin(x);
octave:6> plot(x,y);title(“Simple 2-D Plot”);xlabel(“x”);ylabel(“sin(x)”);

sin(x)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值