필터 지우기
필터 지우기

what does (:,:,:,x) mean in matlab?

조회 수: 7 (최근 30일)
Sneheet
Sneheet 2014년 3월 20일
답변: Frank 2014년 3월 20일
obj = mmreader('rhinos.avi');
vid = read(obj);
frames = obj.NumberOfFrames;
ST='.jpg';
for x = 1:frames
Sx=num2str(x);
Strc=strcat(Sx,ST);
Vid=vid(:,:,:,x)
imwrite(Vid,Strc);
end
In the above code what does vid(:,:,:,x) mean?

답변 (1개)

Frank
Frank 2014년 3월 20일
vid is a four-dimension matrix. vid = vid(:,:,:,:).
And if you specify anyone of the four dimensions, it indicates a 3-dimension matrix.
For example:
a = [1 1 1; 1 1 1; 1 1 1;]
a is a 3*3 matrix, if you specify any of the two dimensions for example a(:,1), then it's a one dimension matrix, i.e. an array [1 1 1]'.

카테고리

Help CenterFile Exchange에서 Linear Algebra에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by