search
HomeCommon ProblemHow to use zeros function in matlab

The zeros function in matlab is used to return a double class zero matrix. Its usage is: 1. Enter "B=zeros(5)" in the command line window and press the Enter key to generate a "5 *5" zero matrix; 2. Enter "B=zeros(3,4)" in the command line window and press the Enter key.

How to use zeros function in matlab

How to use the zeros function

The zeros function returns a double of m×n×p×... A function of a zero-like matrix.

The first step is to enter B=zeros(5) in the command line window and press the Enter key to see that a 5*5 zero matrix is ​​generated, as shown in the figure below:

How to use zeros function in matlab

The second step is to enter B=zeros(3,4) in the command line window and press Enter to generate a zero matrix with 3 rows and 4 columns, as shown in the figure below:

How to use zeros function in matlab

In the third step, enter the B=zeros([3 4]) format. Press the Enter key to see that the same zero matrix with 3 rows and 4 columns as above is generated, but the format is different. Same, as shown in the figure below:

How to use zeros function in matlab

In the fourth step, enter B=zeros(3,4,5,6) in the command line window and press the Enter key to see A 3*4*5*6 all-zero matrix is ​​generated, as shown in the figure below:

How to use zeros function in matlab

The fifth step is to create a new A variable and enter B=zeros(size(A )), press the Enter key to see that a zero matrix of the same size as the A matrix is ​​generated, as shown in the following figure:

How to use zeros function in matlab

The sixth step finally summarizes the zeros function There are mainly the following methods of use, as shown in the figure below:

How to use zeros function in matlab

For more related knowledge, please visit PHP Chinese website!

The above is the detailed content of How to use zeros function in matlab. 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

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.