Brace indexing is not supported for variables of this type.

3 ビュー (過去 30 日間)
muhammad choudhry
muhammad choudhry 2021 年 4 月 22 日
コメント済み: muhammad choudhry 2021 年 4 月 22 日
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 件のコメント
muhammad choudhry
muhammad choudhry 2021 年 4 月 22 日
Thanks alot!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by