How to sum specific value in 1:m ?

1 回表示 (過去 30 日間)
Mech
Mech 2014 年 6 月 10 日
回答済み: Mech 2014 年 6 月 11 日
  • m=1:2
  • b(m)=sum(sin(1:m)*b)
  • then the result
  • b(1)=sin(b)
  • b(2)=sin(b)+sin(2*b)
  • But I need
  • b(1)=sin(b)
  • b(2)=sin(b)+sin(3*b)
for n
  • b(n)=sin(b)+sin(3*b)+sin(5*b)+sin(7*b)...
  2 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2014 年 6 月 11 日
b(1)=sin(b)
what the variable b (in the left and the right expression) represent?
Mech
Mech 2014 年 6 月 11 日
編集済み: Mech 2014 年 6 月 11 日
  • thank bro.
  • I have just find solution
for m=1:5
f(m)=2*m-1
b(m)=sum(sin(f)*b)
end

サインインしてコメントする。

採用された回答

Mech
Mech 2014 年 6 月 11 日
for m=1:n
f(m)=2*m-1
b(m)=sum(sin(f)*b)
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLanguage Fundamentals についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by