Array indices must be positive integers or logical values.
Afficher commentaires plus anciens
Hi,
I am getting the error using the code given below, can anyone help me please. I have negative values in the graph as well I think that is why it happening but I do not know how to resolve this problem.
Code:
close all; clear all; clc;
a=readmatrix('perf_7.ods');
x=a(:,10);
y=a(:,4);
for k=1:length(x)
plot(x(k),y(k),'x','LineWidth',0.5);
hold on
plot(x(1:k),y(1:k),'x','LineWidth',0.5);
drawnow
xlim([0 6])
ylim([0 0.8])
F(i)= getframe(gcf);
pause(0.1)
end
video = VideoWriter ('Graph.avi','Uncompressed AVI')
open(video)
writeVideo(video,F);
close(video)
Error:
Array indices must be positive integers or logical values.
Error in Graph_ani1 (line 16)
F(i)= getframe(gcf);
1 commentaire
Weixin Wang
le 20 Avr 2021
You index variable seems to be 'k', not 'i'.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Image Preview and Device Configuration dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!