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 CenterFile Exchange에서 Language Fundamentals에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by