arguments fonctions appelées
Bonjour,
j'essaye de faire un test au niveau de mon algorithme :
Code:
1 2
|
if Nbr_Veh_voie_orig(nbv+1) == 0 |
Voilà ma fonction (Nbr_Veh_voie_orig) :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
function Nbr_Veh_voie_orig(v)
global config;
nbvh = 0;
m = numel(config.ListeOrigine);
for j=1:m
n = numel(config.ListeTroncon{j}.ListeVehTroncon);
if n > 0
for i=1:n
Veh = config.ListeTroncon{j}.ListeVehTroncon{i};
veh_voie = Veh.GetVoieActuelle();
if v == veh_voie
nbvh = nbvh + 1;
end
end
end
nbvh;
return;
end
nbvh;
return;
end |
Et j'ai un message d'erreur :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
??? Error using ==> Nbr_Veh_voie_orig
Too many output arguments.
Error in ==> GenererVehicule at 16
if Nbr_Veh_voie_orig(nbv+1) == 0
Error in ==> LancerSimulation at 8
GenererVehicule(t);
Error in ==> main at 43
LancerSimulation(Horizon,decalage); |
Pourtant j'ai un seul argument à donner