MATLAB: Writing an equation that needs some kind of specific sum, hard task guys

forloopMATLABsumsums

So i have a formula that goes: U = THE SUM OF (Si^2*L1)/2EA
Now this S"i" is my formulas names already made. So S1, S2, and so on to S16 exists.
I want Matlab to calculate U = (S1^2*L1)/2EA + (S2^2*L1)/2EA … AND SO ON TO S16 so i can get my "U"

Best Answer

U = sum([S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11, S12, S13, S14, S15, S16].^2) .* L ./ (2 .* E .* A)