Brace indexing is not supported for variables of this type.

3 次查看(过去 30 天)
Hi,
Can anyone guide me, how to correct this error please. Below is the code.
Code:
imgFile = dir('*.jpg') ;
imageNames = length(imgFile)
outputVideo = VideoWriter('test.avi');
outputVideo.FrameRate = 2;
open(outputVideo)
for ii = 1:length(imageNames)
img = imread(imageNames{ii});
writeVideo(outputVideo,img)
end
close(outputVideo)
Error:
Brace indexing is not supported for variables of this type.
Error in ImaVid_Seq (line 12)
img = imread(imageNames{ii});

采纳的回答

Matt J
Matt J 2021-4-22
imageNames = {imgFile.name}
  5 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Convert Image Type 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by