필터 지우기
필터 지우기

Trying to write a series: 2n+1

조회 수: 2 (최근 30일)
steve guy
steve guy 2013년 2월 18일
I'm trying to write a 2n+1 series that starts at the number 2 and goes for 30 terms. How can I do this?
  댓글 수: 2
José-Luis
José-Luis 2013년 2월 18일
편집: José-Luis 2013년 2월 18일
This sounds an awful lot like homework. What have you tried so far? Please read the Getting started part of the documentation.
How about a loop?
doc for;
Jan
Jan 2013년 2월 18일
It would work without a FOR loop also, if it works at all. Usually "n" is a natural number in problems related to series. But there is no natural number n such that 2*n+1 equals 2.

댓글을 달려면 로그인하십시오.

채택된 답변

Youssef  Khmou
Youssef Khmou 2013년 2월 18일
hi, try this :
% Sol1 : vectorized
serie1=2*[2:30]+1; figure, plot(serie1);
% Sol2 : loop
for x=2:30
serie2(x)=2*x+1;
end
serie2(1)=[]; figure, plot(serie2)
  댓글 수: 2
Jan
Jan 2013년 2월 18일
Please, Youssef, do not post full answers for homework questions. Thanks.
Youssef  Khmou
Youssef Khmou 2013년 2월 18일
Alright Jan !

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by