Brace indexing is not supported for variables of this type.

2 vues (au cours des 30 derniers jours)
muhammad choudhry
muhammad choudhry le 22 Avr 2021
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});

Réponse acceptée

Matt J
Matt J le 22 Avr 2021
imageNames = {imgFile.name}
  5 commentaires
muhammad choudhry
muhammad choudhry le 22 Avr 2021
Thanks alot!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by