Newbie question

조회 수: 2 (최근 30일)
Tom
Tom 2011년 11월 12일
Hi - just started using Matlab.
I've got this array of values: - Nvalues =
1.3138 5.0076 3.2438 3.2438 0.7919 4.4857 2.7220 6.4158
and I need to make another array from those values using this formula: -
5+20*log((sqrt(2*pi*Nvalues))/tanh(sqrt(2*pi*Nvalues)))
but when I put in that formula it just gives me one value - 34.9308. What I want is a new array of values - the first based on the above equation, where the two Nvalues in the equation are both the first one in the list, the 2nd based on the above equation, where the two Nvalues are both the 2nd one in the list, and so on.
How do I do this?
Thanks

채택된 답변

Fangjun Jiang
Fangjun Jiang 2011년 11월 13일
5+20*log((sqrt(2*pi*Nvalues))./tanh(sqrt(2*pi*Nvalues)))
Notice './' instead of '/'.
help rdivide
./ Right array divide. A./B denotes element-by-element division. A and B must have the same dimensions unless one is a scalar. A scalar can be divided with anything.
  댓글 수: 1
Tom
Tom 2011년 11월 13일
Thanks!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by