Bonjour,
J'essayes d'écrire le programme suivant mais il y a une erreur Invalid index et je ne vois pas où elle est et comment faire pour qu'elle n'y soit plus.
-->A=[3200,7680,12800,19200,36000,32 000,28800,8400,3840,1600];
-->Yref=[3200,10880,23680,42880,78880,1 10880,139680,148080,151920,153 520];
-->L=ceil(max(Yref)/2);
-->i=1; B=A(1); C=[0,0,0,0,0,0,0,0,0,0];
-->for i=[1:10], if B+A(i+1)>L then C(i)=1, B=0;
-->elseif B+A(i+1)<=L then B=B+A(i+1); end;
-->end;
C =
0. 0. 0. 1. 0. 0. 0. 0. 0. 0.
!--error 21
Invalid index.
Merci pour votre aide
-----