필터 지우기
필터 지우기

Simple calculations?

조회 수: 5 (최근 30일)
Lizan
Lizan 2011년 5월 20일
댓글: Steven Lord 2020년 9월 6일
I would like to find dn1/dn2 in matlab and I have two vectors n1 and n2.
How can I find dn1/dn2 the simplest way? Are there any inbuilt functions for these kind of calculations?

채택된 답변

Andy
Andy 2011년 5월 20일
Perhaps you're looking for
res = diff(n1)./diff(n2); %?
  댓글 수: 1
Lizan
Lizan 2011년 5월 20일
Yes, the function diff works since DIFF(X), for a vector X, is [X(2)-X(1) X(3)-X(2) ... X(n)-X(n-1)].
Many thanks!
I knew it was simple.

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

추가 답변 (3개)

Jan
Jan 2011년 5월 20일
Do you want to calculate the derivative of one vector according to the other? Do you expect the result to be a matrix? Or are you looking for the GRADIENT command?

Adetunji
Adetunji 2012년 1월 19일
x =90 91 92 93 94 95 96 97 98 99 100 y=54 55 54 54 57 57 63 56 57 56 56
am trying to compute the gradient of the above in matlab..any idea?

Jackelin Estrada
Jackelin Estrada 2020년 9월 5일
D= 9 6/12 + 7×5^3+2
  댓글 수: 2
Jackelin Estrada
Jackelin Estrada 2020년 9월 5일
in matlab
Steven Lord
Steven Lord 2020년 9월 6일
It's not clear to me how this relates to the original question. Please post this (with a lot more information about what you're trying to do) as its own question, not as an answer on an existing question.

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

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by