# matlab algorithm question

조회 수: 1(최근 30일)
James 2011년 7월 21일
The below link shows an algorithm I want to try and use and I have a few questions about.
Firstly, I am assuming that when i=0, the first frame of a video is titled caltrain000.
for i = 0:30
imgINumber = i;
imgPNumber = i+2;
I also want to know what the below code does? Because when I try and run the code with my own video frames I get the error - "Index exceeds matrix dimensions".
imgI = imgI(:,1:352);
imgP = imgP(:,1:352);

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

### 답변(2개)

D 2011년 7월 21일
In regard to your second question,
a = a(:,1:3)
redefines a to be all rows of the current matrix, but only columns 1 through 3.
So, say
a = [ 1 2 3 4 5 6; 7 8 9 10 11 12; 13 14 15 16 17 18];
then you get
>> a = a(:,1:3)
a =
1 2 3
7 8 9
13 14 15
##### 댓글 수: 0표시숨기기 이전 댓글 수: -1

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

Fangjun Jiang 2011년 7월 21일
When i=0, imgIFile='./caltrain/gray/caltrain000.ras'
The operation is like crop an image. All rows are selected, but only column 1 to 352 (pixel?) are selected.
##### 댓글 수: 2표시숨기기 이전 댓글 수: 1
Fangjun Jiang 2011년 7월 21일
No idea. I guess it might be related to the size of the image.

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

### 범주

Find more on Video Formats and Interfaces in Help Center and File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by