is possible to update parameter function ?
Afficher commentaires plus anciens
i do an example :
function xx(g)
for g=1:1000
//do something
end
end
Main
xx(g);
fprint(" %d ",g);
end
>ans
1 2 3 4 5 6 7 8 9 10
in main i call function xx and i want to read the value of g updated every cycle
Réponses (1)
call the function xx inside the Main function using a loop. This would repeatedly call the function xx and update the value of g for reach iteration .and/or cycle
% // Main
Main
function Main() % Main function
for g = 1:1000
xx(g);
end
end
function xx(g) % // parameter function
% //do something
fprintf(" %d ",g);
end
1 commentaire
shamal
le 24 Juin 2023
Catégories
En savoir plus sur Read, Write, and Modify Image 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!