The end operator must be used within an array index expression.

4 ビュー (過去 30 日間)
muhammad choudhry
muhammad choudhry 2021 年 4 月 21 日
コメント済み: Stephan 2021 年 4 月 21 日
Hi,
I am reading every 600th frame from the video by using the end operator but I am getting this error here.
Code:
v = VideoReader('DSC_1191.MOV');
frame = read(v,[600:600:end]);
Error:
The end operator must be used within an array index expression.
Error in Spec_Frame (line 3)
frame = read(v,[600:600:end]);

採用された回答

Stephan
Stephan 2021 年 4 月 21 日
See the original question - i fixed the error.
frame = read(v,[600:600:end]);
will not work in this case.

その他の回答 (1 件)

Steven Lord
Steven Lord 2021 年 4 月 21 日
In this case read is a function, not a variable. Attempting to "index" into the function with end won't work. I would probably replace end with v.NumFrames.
  1 件のコメント
Stephan
Stephan 2021 年 4 月 21 日
Thank you for the clarification.

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by