当前位置:网站首页>Matlab相关函数知识点(三)-floor函数+点除运算符+矩阵索引规则
Matlab相关函数知识点(三)-floor函数+点除运算符+矩阵索引规则
2022-06-09 10:19:00 【python小白(下阶段小黑)】
floor函数
floor函数的作用是,对操作对象向下取整。
对数字操作
如果操作对象是数字,那么就返回小于这个数的最大整数(负数同样适用)
flo=floor(100.6) %% 返回100
flo=floor(0.01) %% 返回0
flo=floor(-100.6) %% 返回-110
对矩阵操作
如果操作对象是矩阵,那么就对矩阵内所有元素进行向下取整操作
ddd=[1.3,0.02,0.03
0.04,1.5,0.06
0.07,0.08,1.02];
flo=floor(ddd);
返回
flo =
1 0 0
0 1 0
0 0 1
./运算符
ddd=[1.3,0.02,0.03
0.04,0.05,0.06
0.07,0.08,0.09];
ddd0=ddd./0.03;
ddd1=ddd/0.03;
可以从结果看到,直接对矩阵进行除法和点除,得到的结果是一样的,可能有些场景是有区别的,大家使用的时候提前测试一下就好
矩阵索引规则
假设有一个矩阵
ddd=[1.3,0.02,0.03
0.04,0.05,0.06
0.07,0.08,0.09];
那么如下操作
ccc1=ddd(1:5)
返回的结果是`
ccc1 =1.3000 0.0400 0.0700 0.0200 0.0500
`
说明该操作是按照列顺序进行从第一个到第五个元素的取值操作
那下面的操作呢?
ccc1=ddd(1:2:6)
返回的结果是
ccc1 = 1.3000 0.0700 0.0500
说明该操作是每隔2个元素,按列顺序,从第一个元素取到第六个元素
边栏推荐
- 三拾壹- NodeJS簡單代理池(合) 之 MongoDB 鏈接數爆炸了
- How to realize face verification quickly and accurately?
- CTF WEB WP杂谈
- 叁拾叁- NodeJS简单代理池(估计完了吧)SuperAgent 使用 Proxy 的惨痛经历 及做事要细心
- Logout successful processor
- Apple wins us judge dismisses iPhone and iPad security defect class action
- [model deployment and business implementation] model transformation of AI framework deployment scheme
- 【光学】 基于matlab模拟光的双缝干涉附GUI
- Thirty two - nodejs simple proxy pool (is it finished?) The SuperAgent uses a timeout that is not a timeout
- 【模型部署与业务落地】AI 框架部署方案之模型转换
猜你喜欢

Redis的使用

Web SSH client shwifty

WebAssembly 2022调查来啦

Lua call principle demonstration (Lua stack)

每日一题-1232. 缀点成线

How many points can you get if the programmer's college entrance examination paper is exposed?

Forty five - regular expressions (? =pattern) and (?! pattern)

Iscc2022 challenge arena Misc
![[fruit recognition] fruit recognition based on morphology, including Matlab source code](/img/ea/dcc5a98759927a8cd01e39c4cbb724.png)
[fruit recognition] fruit recognition based on morphology, including Matlab source code

软件那些事
随机推荐
【 tgcalls】 suivi et débogage des gestionnaires d'appels 2
今日停更
三拾壹- NodeJS簡單代理池(合) 之 MongoDB 鏈接數爆炸了
华泰证券安全吗?我要开户
InfoQ 极客传媒 15 周年庆征文| 迁移 Eureka 到 Nacos 之双注册双订阅模式
What kind of digital collection platform is a good platform?
CTF WEB WP杂谈
golang_ 3_ structural morphology
Forty five - regular expressions (? =pattern) and (?! pattern)
MOF-53NPs负载抗菌药物分子万古霉素(MOF金属有机骨架负载蛋白多肽类药物)
You need to think about the following questions about the online help center
Jincang of the National People's Congress won the recognition of "key software enterprises encouraged by the state" again
Unemployment wave? Yuancosmos opens up new employment opportunities
论文阅读 (53):Universal Adversarial Perturbations
[image enhancement] image enhancement based on sparse representation and regularization with matlab code
关于在线帮助中心你需要思考以下几个问题
【Pyhton 实战】---- 批量【端午节】海报下载
Thirty one - the number of mongodb links in nodejs simple proxy pool (combined) exploded
dict中的部分指令与set中的差和交集与增减元素
4. 软件工程:航空行李托运费计算