Syntax help: Linearly spaced vector and simple algebra

조회 수: 1 (최근 30일)
zizo
zizo 2011년 6월 13일
How i write this in MATLAB
t=1790 to 2000
p(t)=197,273,000/(1+e-0.0313(t-1913.25)

채택된 답변

Laura Proctor
Laura Proctor 2011년 6월 13일
t = 1790:2000;
p = 197273000./(1+exp(1)-.0313*(t-1913.25));
  댓글 수: 1
Walter Roberson
Walter Roberson 2011년 6월 13일
That does not do what zizo asked: it will not create p(1790) to p(2000)

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

추가 답변 (1개)

Walter Roberson
Walter Roberson 2011년 6월 13일
Hints:
  1. e is coded as exp(1) if you are talking about the base of the natural logarithms.
  2. you need a multiplication symbol before your final '('
  3. you need to have the same number of ')' as you have '('
  4. commas are not permitted as thousand groupings in numbers
  5. http://www.mathworks.com/help/techdoc/ref/for.html
  6. are you really using e as a single constant, or does your original formula have e raised to some power? If it does have e raised to a power, see http://www.mathworks.com/help/techdoc/ref/exp.html

카테고리

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

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by