필터 지우기
필터 지우기

confusion in cat command

조회 수: 2 (최근 30일)
ABTJ
ABTJ 2019년 4월 14일
댓글: ABTJ 2019년 4월 14일
I am reading matlab online documentation for fliplr command and there and i came across a command 'cat'
It is used for concatenation.
First argument of cat command specifes dimension along which concatenation. example if first argument is 1 ,matrices are concatenaated along coulmns and if first argumetn is 2, matrices will be concatenated along rows. But what if first argument is 3 as in this scenario
I am confused how it is acting as shown in current scenario in attached photo. What will be contents of A ? and what is the meaning of highligted lines?

채택된 답변

Image Analyst
Image Analyst 2019년 4월 14일
3 means the 2-D arrays are being stacked along the 3rd dimension. To visualize, imagine that the arrays are gray scale images in the x-y plane. Now you use cat() to stack them vertically along the third, Z, dimension. See image below, and attached demo script.
Capture.PNG
The 3-D image above would represent a color image.
Another case could be where you have lots of images, like slices from a CT or MRI scan. These images, stacked along the 3rd dimension would represent a volumetric images.
If the number were 4, then it could mean that you're stacking 3-D (color) images along the 4th dimension (representing time) to create a movie.
Does that explain it sufficiently to you?
  댓글 수: 1
ABTJ
ABTJ 2019년 4월 14일
Awesome dear sir

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

추가 답변 (1개)

madhan ravi
madhan ravi 2019년 4월 14일
3 represents that the contents of A concatenated in 3rd dimension hence creating a 3D matrix.
  댓글 수: 2
Stephen23
Stephen23 2019년 4월 14일
편집: Stephen23 2019년 4월 14일
And multi-dimensional arrays are NOT just limited to 3D arrays!
To learn more about multi-dimensional arrays read the MATLAB documentation:
madhan ravi
madhan ravi 2019년 4월 14일
Indeed, thank you Stephen.

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

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

제품


릴리스

R2015a

Community Treasure Hunt

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

Start Hunting!

Translated by