[Machine Learning] Octave Basic Operations
You can do baisc math:
5+6 32-8 1/2 2^3 1 == 2 % ans = 0 means false 1 ~=1 % 1 not equals to 2. ans = 1 means true 1 && 0 1 || 0 xor(1, 0)
Change the output:
PS1('>> ')
Semicolon:
If you don't use semicolon, it prints the output, if you add semicolon, it doesn't print output:
disp(a): print value:
a=pi; disp(sprintf('2 decimals: %0.2f', a)) # 2 decimals: 3.14
Format:
Matrix / Vector:
Step increasment:
v = 1:0.2:2 # a row vector start from 1, each element increase by 0.2 until 2
if step is 1:
v = 1:6 # from 1 to 6
2by3 matrix with all 1:
ones(2,3) """ ans = 1 1 1 1 1 1 """
c = 2*ones(2,3)
"""
c =
2 2 2
2 2 2
"""
w = zeros(1,3) w= rand(3,3) # uniform distribution between zero and one. w = randn(3,3) # Gaussian distribution with mean zero and variance or standard deviation equal to one
More complex matrix:
w = -6 + sqrt(10)*(randn(1, 10000));
hist(w)
hist(w, 50)
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具
2018-08-17 [React] Build a slide deck with mdx-deck using Markdown + React
2018-08-17 [React] Spread Component Props in JSX with React
2017-08-17 [React] Create component variations in React with styled-components and "extend"
2017-08-17 [React] Animate your user interface in React with styled-components and "keyframes"
2017-08-17 [Angular] Update FormArray with patchValue
2016-08-17 [Webpack] Use the Webpack Dashboard to Monitor Webpack Operations
2016-08-17 [RxJS] AsyncSubject