Array indices must be positive integers or logical values.
古いコメントを表示
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 件のコメント
Weixin Wang
2021 年 4 月 20 日
You index variable seems to be 'k', not 'i'.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Image Preview and Device Configuration についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!