search
HomeCommon ProblemWhat is the function of function max

What is the function of function max

Jul 26, 2019 am 11:56 AM
function

Function The max function is used to find the largest element of a vector or matrix, or the maximum value among several specified values.

What is the function of function max

There are three forms commonly used in high-level programming languages ​​such as MATLAB: max(A), max(A,B), max(A,[],dim). (Recommended learning: PHP video tutorial)

Function The max function is used to find the maximum element of a vector or matrix, or the maximum value among several specified values. There are three commonly used forms:

(1) max(A):

The input parameter A can be a vector or matrix. If it is a vector, all values ​​in the vector will be returned. The maximum value of the element; if it is a matrix, a row vector is returned, and each element in the vector is the maximum value of each column element of the matrix.

(2) max(A,B):

Compare the sizes of corresponding elements in A and B. A and B can be matrices or vectors, and the sizes must be the same , returns a matrix or vector composed of the larger elements in A and B. In addition, one of A and B can also be a scalar, and the matrix or vector obtained after comparing with the scalar is returned.

(3) max(A,[],dim):

Returns the maximum value of the dim dimension in A.

Usage

If the parameter in the MAX function is an incorrect value or text that cannot be converted to a number, an error will be generated. If the argument is an array or reference, only the numbers in the array or reference will be evaluated. Blank cells, logical values, or text in arrays or references are ignored. If logical values ​​and text cannot be ignored, use the MAXA function instead.

If the argument does not contain a number, the function MAX returns 0.

Example 1: If A1:A5 contains the numbers 10, 7, 9, 27 and 2, then:

MAX(A1:A5) is equal to 27

MAX(A1 :A5,30) is equal to 30

Example 2: If A1=71, A2=83, A3=76, A4=49, A5=92, A6=88, A7=96.

The formula "=MAX(A1:A7)" returns 96.

Example 3: When calculating class hours, if there are less than 60 people in a teaching class, it will be calculated as 60 people. If there are more than 60 people, the class hours will be increased by 0.006 for every more than 1 person.

The formula is =1 MAX(A1-60,0)*0.006

For more PHP related technical articles, please visit the PHP Graphic Tutorial column to learn!

The above is the detailed content of What is the function of function max. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft