how to loop equations

5 ビュー (過去 30 日間)
grant w
grant w 2022 年 3 月 30 日
回答済み: Torsten 2022 年 3 月 30 日
im trying to loop the equation y=l is a amount of numbers and dhm is the number = to a vector . i dont know how to make the 1/Xn loop with adding and changing the varibles. i have part of the code set up but i dont want to go d_mm1+d_mm2. Any suggestions?
d_mm=[93.2,92.7,91.8,93.6,92.8,93.1,93.8,92.4,93.4,93.1]
l=10
for k= 1:1:l;
dhm=((l)/(1/d_mm(1,1))+
end

回答 (1 件)

Torsten
Torsten 2022 年 3 月 30 日
denominator = sum(1./dmm);
d = l/denominator;

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

製品


リリース

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by