is possible to update parameter function ?
Mostra commenti meno recenti
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
Risposte (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 Commento
shamal
il 24 Giu 2023
Categorie
Scopri di più su Read, Write, and Modify Image in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!