Bonjour
Je veux stocker des valeurs d'une boucle, ci après un exemple de code pour m'expliquer :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| a=[1 2 3]
b=[4 5 7]
D=[1:1:120]
Dobjectif=[] %% facultatif je peux ne pas initialiser
n=length(a)
m=length(b)
for i=1:n
for j=1:m
[sortie]=function(D,a(i),b(j));
a= find(sortie==0.403);
Dobjectif(i,j)=D(a);
end
end |
Pour la combinaison (a=1,b=4) je peux stocker ma première valeur D(a),par contre
en incrémentant (a=1,b=5) j'ai ce message:
Assignment has more non-singleton rhs dimensions than non-singleton subscripts
c'est un problème de d'indexage lors du stockage ,quelqu'un pourrait m'aider ?
Merci
Partager