开发者

What does padColor(:,:,1) mean in MatLab?

>> padColor = [1 1 1];        %# RGB triple for pad color
padColor = reshape(padColor,1开发者_如何转开发,1,3);  
>> padColor

padColor(:,:,1) =

     1


padColor(:,:,2) =

     1


padColor(:,:,3) =

     1

What does padColor(:,:,1) mean here?


After reshaping, padColor is a 1-by-1-by-3 array. Since the size of the first two dimensions is 1, padColor(:,:,1), which means padColor("all","all",1) is equivalent to padColor(1,1,1). In other words, padColor(:,:,1) is the element you find in the first row, first column, first 'z-slice' of padArray.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜