Please explain the concept of zeros for images...the code is [m n]=size(image); image1=zeros(8,m,n);

2 次查看(过去 30 天)
Please explain the coding for the above syntax

回答(3 个)

Walter Roberson
Walter Roberson 2014-3-3
zeros() just returns a matrix the given size, with all of the values in the matrix set to 0. For example, zeros(3,5) would be the same as
[0 0 0 0 0; 0 0 0 0 0; 0 0 0 0 0]

Azzi Abdelmalek
Azzi Abdelmalek 2014-3-3
image1=zeros(8,5,2)
This line of code allows to pre allocate memory for a matrix 8x5x2, to be used after. you can fill your matrix with other values then zero, and make the process faster

DEEPANSHU TRIVEDI
DEEPANSHU TRIVEDI 2021-11-18
A= [2 3 5; 4 6 5]
a= size(A,1);

类别

Help CenterFile Exchange 中查找有关 Image Filtering and Enhancement 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by