The end operator must be used within an array index expression.
Show older comments
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]);
Accepted Answer
More Answers (1)
Steven Lord
on 21 Apr 2021
2 votes
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 Comment
Stephan
on 21 Apr 2021
Thank you for the clarification.
Categories
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!