is possible to update parameter function ?
Mostrar comentarios más antiguos
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
Respuestas (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 comentario
shamal
el 24 de Jun. de 2023
Categorías
Más información sobre Read, Write, and Modify Image en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!