当前位置:网站首页>matlab获取原数组在排序后数组中的位置
matlab获取原数组在排序后数组中的位置
2022-07-19 16:31:00 【A-Chin】
A = [-1 -5 3 0 9 7 16 4];
B = sort(A);
[~, I] = ismember(A, B);
数组I中就是原数组A在排序后数组B中的位置。
B(I)就是原数组A。
>> A = [-1 -5 3 0 9 7 16 4]
A =
-1 -5 3 0 9 7 16 4
>> B = sort(A)
B =
-5 -1 0 3 4 7 9 16
>> [~, I] = ismember(A, B)
I =
2 1 4 3 7 6 8 5
>> B(I)
ans =
-1 -5 3 0 9 7 16 4
边栏推荐
- 大屏:页面在不同比例屏幕的显示适配与字体随屏幕改变而改变(字体随屏幕分辨率改变自适应的问题)
- kubernates-1.24.2 (最新版) + containerd + nexus 尝鲜
- Software testing and application final review
- 跟着苹果不赚钱,2万亿“果链”弃“果”拥“特”
- 食腐秃鹫还是啄木鸟?如何正确理解做空
- Oracle 19c迁移遇到大容量lob表怎么办?
- 教你使用CANN将照片一键转换成卡通风格
- 信通院《分布式存储发展白皮书(2022年)》发布:华云数据参与编制 为产业发展提速换挡
- 光大银行分布式实战:国内最大缴费平台的数据库架构转型
- 多线程FTP项目(4)—— Mysql数据库 + FTP
猜你喜欢
XSS(跨站脚本攻击)漏洞理解
信通院《分布式存储发展白皮书(2022年)》发布:华云数据参与编制 为产业发展提速换挡
go-fastDFS 分布式文件系统搭建(实现梳理)
Implementation scheme of importing thinkphp6 million xlsx tables into the database
项目经验总结——送给测试岗做项目的朋友们
PG的表和索引的膨胀(Table & Index Bloat)
Thinkphp6百万级xlsx表格导入数据库的实现方案
MATLAB实现LMDI分解方法(含零值处理)
Oracle数据库迁移,还担心执行计划改变吗?
Browser view MD file strongly recommends markdown viewer
随机推荐
运行selenium remotedriver时出现与NativeConstructorAccessorImpl.newInstance0错误的SessionNotCreatedException错误
2022年理财产品都有哪些种类?适合新手的是哪个?
怎么设置数据库的报警
软件测试面试101问(附答案)
物联网芯片的协议之Lora及其调制
error: redefinition of
国内开源的一款超好用 Redis 可视化工具,高颜值 UI,真香!!
华云数据荣获可持续技术创新杰出贡献企业
How to choose an open source automated testing framework? You must know these 9 open source tools
Interviewer: what are the three cache update strategies of redis & MySQL?
若依框架-表单按照字段合计,按照某个字段排序
趣店罗敏,预制“韭菜”?
Solution of webdriver click login failure
光大银行分布式实战:国内最大缴费平台的数据库架构转型
CPU reads and writes to memory
Summary of project experience - send it to the friends of the testing post who are doing the project
新茶饮,开始“打群架”
压价、博弈、苦等,2022年VC/PE赶着排队退出
FlinkCDC2.0利用FlinkSQL采集MySQL
How to set database alarms