当前位置:网站首页>Average and maximum values of MATLAB matrix
Average and maximum values of MATLAB matrix
2022-06-30 14:50:00 【Tongxuan Shangjing programmer】
Understand by example :
Problem description : Find the matrix 【2,5,4,3;2,7,8,4;3,5,3,6】 The largest number in , And replace with the average of all the numbers of the matrix , Output the last matrix ;
clc;clear;
A=[2,5,4,3;2,7,8,4;3,5,3,6];
[x ,y]=find(A==max(max(A)));
A(x,y)=mean(A(:));
disp(A);Maximum : The biggest element to find is max(max(A)), Note that the two-dimensional matrix needs to write two max, Find the corresponding position find function .
The average : Find the average of the matrix mean(A(:)) ; Find that the mean value of each column of the matrix is mean(A,1); And finding the average of each column is mean(A,2).
边栏推荐
- 【BUUCTF】[GXYCTF2019]Ping Ping Ping1
- Finding the root of an integer by dichotomy
- V3 02——What‘s new in Chrome extensions
- Double pointer letter matching
- Working principle and fault treatment of cutting cylinder in CNC machining center
- Thoughts on the security of a PHP file name regular verification
- 高清机械原理 · 机械设计经典动图
- CCF string matching (Full Score code + problem solving ideas + skill summary) March 3, 2014
- Machine learning feature selection
- 左旋梯形螺纹的编程
猜你喜欢

【BUUCTF】 Have Fun

Sum of CCF digits (full mark code + problem solving idea) 201512-1

Win10 one click Reset win10 to solve all system bugs without deleting any files and Applications

Clear the route cache in Vue

Computer screenshot how to cut the mouse in
![[extensive reading of papers] multimodal attribute extraction](/img/ec/546c107ac0d31deded7ca94fdf0e2d.jpg)
[extensive reading of papers] multimodal attribute extraction

CCF access control system (Full Score code + problem solving idea) 201412-1

CCF image rotation (Full Score code + problem solving idea) 201503-01

August 24, 2021 deque queue and stack

ctfshow nodejs
随机推荐
Greedy two-dimensional array sorting
2021-05-12
Learn about data kinship JSON format design from sqlflow JSON format
文本匹配——【NAACL 2022】GPL
Lfi-rce without controllable documents
Pseudocode writing specification
Searching for single element in dichotomy
CCF date calculation (Full Score code + skill summary) February 2, 2015
val_ Loss decreases first and then increases or does not decrease but only increases
How to realize selective screen recording for EV screen recording
[extensive reading of papers] sentimental analysis of online reviews with a hierarchical attention network
Double pointer palindrome string
2021-08-05 leetcode notes
1133: output family and friends string
[extensive reading of papers] a delicious recipe analysis framework for exploring multi modal recipes with variable attributes
The difference between settimeout() and setinterval()
Double pointer letter matching
[untitled]
NoViableAltException([email protected][])
org. json. The jsonobject object is converted to JSON, and JSON adds new elements. The value is obtained according to the JSON key. And list object format string to jsonarray