当前位置:网站首页>Examples of bubble sorting and matrix element screening in MATLAB
Examples of bubble sorting and matrix element screening in MATLAB
2022-06-30 14:51:00 【Tongxuan Shangjing programmer】
Problem description : Input matrix A=[23,45,87,13,5,98,102,46,48,38,69], The matrix A Middle energy quilt 3 The number of integer division is sorted from small to large and output in matrix form .
clc;clear;
A=[23,45,87,13,5,98,102,46,48,38,69];
B=A(rem(A,3)==0);
N=size(B,2);
for i=1:N
for j=1:N-i
if B(j)>B(j+1)
temp=B(j);
B(j)=B(j+1);
B(j+1)=temp;
end
end
end
disp(B);
边栏推荐
- How many questions can you answer for the interview of Mechanical Engineer?
- Sum of squares of two pointers
- In situ merging of two arrays with two pointers
- [geek challenge 2019] PHP problem solving record
- Distributed -- openresty+lua+redis
- 1133: output family and friends string
- [extensive reading of papers] a delicious recipe analysis framework for exploring multi modal recipes with variable attributes
- Lost connection to the flow server (0 retries remaining): |Out of retries, exiting! Error reporting solution (flow)
- V3 03_ Getting started
- PHP recursive multi-level classification, infinite classification
猜你喜欢
Error $(...) size is not a function
CCF sequence segmentation (Full Score code + problem solving idea) 201509 -1
CCF call auction (full mark code + problem solving ideas + skill summary) 201412 - 3
Ctfshow getting started with the web (ThinkPHP topic)
【BUUCTF】 Have Fun
Svn password forgetting solution
CCF adjacent number pairs (Full Score code + problem solving ideas + skill summary) 201409-1
Sum of CCF digits (full mark code + problem solving idea) 201512-1
How to realize selective screen recording for EV screen recording
CCF Z-scan (full mark code + problem solving ideas) 201412-2
随机推荐
Att & CK red team evaluation field (I)
CCF string matching (Full Score code + problem solving ideas + skill summary) March 3, 2014
The kth largest element in the sorted array
Location of dichotomy
Maximum area of islands searched
立式加工中心的数控加工对刀具使用基本要求
V3 03_ Getting started
How to realize selective screen recording for EV screen recording
Component communication mode
C language & the difference between the address pointed to and the address pointed to by the pointer
Pseudocode writing specification
After the MySQL service on the local computer is started and stopped, some services will automatically stop when they are not used by other services or programs
Text matching - [naacl 2022] GPL
Vue returns to the previous page without refreshing the page / Vue caches the page
左旋梯形螺纹的编程
@PathVariable
Win10 backup backup shows that creating a shared protection point on the shadow failed
Win10 one click Reset win10 to solve all system bugs without deleting any files and Applications
Laravel8 custom log directory, rename
Repair of incorrect deletion of win10 boot entry