How can I create a bigger matrix/array, having 200 zeros matrices in it?

조회 수: 2 (최근 30일)
Rida
Rida 2014년 4월 8일
댓글: dpb 2014년 4월 8일
I want to compute HSV histograms for 200 images, and for this purpose I have to initialize 200 zeros matrices for computing and saving the values in each zeros matrix. How can I do that in MATLAB? Thanks

답변 (2개)

Azzi Abdelmalek
Azzi Abdelmalek 2014년 4월 8일
َََA=arraufun(@(x) zeros(256),1:200,'un',0)

dpb
dpb 2014년 4월 8일
Presuming you fix the number of bins for each, just
h=zeros(200,nBins); % should do it
If you're going to use different sizes, you'd either use cell or perhaps nan instead of zeros to have the indicator missing value in an array.
I'd wonder if you couldn't, however, write the processing to not need all 200 of them in memory at the same time.
  댓글 수: 2
Rida
Rida 2014년 4월 8일
Kindly tell: what exactly am I suppose to pass in "nBins"? I have 3 channels for each of the 200 images(H,S,V),
dpb
dpb 2014년 4월 8일
It's the number of bins you're wanting...in this case I gather that would be 3.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by