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

2 ビュー (過去 30 日間)
Gursheen
Gursheen 2014 年 3 月 3 日
回答済み: DEEPANSHU TRIVEDI 2021 年 11 月 18 日
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
  2 件のコメント
Gursheen
Gursheen 2014 年 3 月 21 日
sir why has the number 8 been fixed? please specify what does 8,5,2 specify here as in 5,2 must be rows and columns then what does 8 signify?
Image Analyst
Image Analyst 2014 年 3 月 21 日
See my answer in your duplicate question: here.

サインインしてコメントする。


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

カテゴリ

Help Center および File ExchangeImage Filtering and Enhancement についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by