How to sum specific value in 1:m ?

1 vue (au cours des 30 derniers jours)
Mech
Mech le 10 Juin 2014
Réponse apportée : Mech le 11 Juin 2014
  • 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 commentaires
Azzi Abdelmalek
Azzi Abdelmalek le 11 Juin 2014
b(1)=sin(b)
what the variable b (in the left and the right expression) represent?
Mech
Mech le 11 Juin 2014
Modifié(e) : Mech le 11 Juin 2014
  • thank bro.
  • I have just find solution
for m=1:5
f(m)=2*m-1
b(m)=sum(sin(f)*b)
end

Connectez-vous pour commenter.

Réponse acceptée

Mech
Mech le 11 Juin 2014
for m=1:n
f(m)=2*m-1
b(m)=sum(sin(f)*b)
end

Plus de réponses (0)

Catégories

En savoir plus sur Language Fundamentals dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by