Iterations outcome summation (accumulation).
Ältere Kommentare anzeigen
Hi MatLab Comunity
Evaluating the failure probability based on fatigue damage, I'd like to estimate the accumulated damage by summing the outcome damages from the iterations helding.
The code:
x = [4 7 9 11 6 8 13 5 0 2 1 23;14 3 8 0 2 9 7 2 12 17 4 5;0 1 3 4 0 0 7 8 2 5 4 1];
d = 0;
for j = 1:length(x)
n = 1.0;
pause(n)
d = d + x./sum(sum(x));
fprintf(' _____iteration No %d: d %d\n', d)
D = [n', j]
end
The code performs iteration estimating damage in each 1 of 12 columns, doing print in lines. My wish is to define the command to sum these resultants.
Hope hearing from you
1 Kommentar
Walter Roberson
am 1 Aug. 2022
Note that you could pre-compute x./sum(sum(x)) since you are not changing x inside the loop
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Weather and Atmospheric Science finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!