필터 지우기
필터 지우기

writing long equation with correct answer

조회 수: 1 (최근 30일)
Abdullah Sultan
Abdullah Sultan 2021년 12월 13일
댓글: Abdullah Sultan 2021년 12월 14일
Hello everyone, this is not hw ;) I'm self-learner. I'ev faced this equation but couldn't get the final answer correctly. the final answer is 55, but I have different answers. I will attach the equation and my trails. Apology for my low level in english :'(
my trails:
n=10;
fn= [(1/sqrt(5))].* [(1+sqrt(5)/(2)).^n - (1-sqrt(5)/(2).^n)]
fn = 812.0928
and this one
fn= 1/sqrt(5).* (1+sqrt(5)/(2).^n - (1-sqrt(5)/(2).^n))
fn = 0.0020

채택된 답변

Chunru
Chunru 2021년 12월 13일
Note that in matlab "( )" are very different from "[ ]":
n=10;
fn= 1/sqrt(5) * ( ( (1+sqrt(5)) / 2 )^n - (1-sqrt(5)/2).^n )
fn = 55.0036
  댓글 수: 4
Abdullah Sultan
Abdullah Sultan 2021년 12월 13일
thank you so much , I still watching videos and reading books, I hope to impove
Abdullah Sultan
Abdullah Sultan 2021년 12월 14일
just to understand matlab proccess, why in the first (1+sqrt(5)) part we should put () more than the second part (1-sqrt(5)/2) even though they are the same side
to be more clear I make the () bold to mention why here we should make more () the other side
fn= 1/sqrt(5) * ( ( (1+sqrt(5)) / 2 )^n - (1-sqrt(5)/2).^n )

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

추가 답변 (1개)

Walter Roberson
Walter Roberson 2021년 12월 13일
fn= [(1/sqrt(5))].* [(1+sqrt(5)/(2)).^n - (1-sqrt(5)/(2).^n)]
Notice that in the first sub-expression it is the 1+ expression that is being raised to n, but in the second sub-expression, it is only the 2 that is being raised to the n.
  댓글 수: 1
Abdullah Sultan
Abdullah Sultan 2021년 12월 14일
thank you for drawing my attention to this point.

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

카테고리

Help CenterFile Exchange에서 Scope Variables and Generate Names에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by