フィルターのクリア

Is this function write correct: -((exp(-x)​*cos(y)+2*​x)/(exp(-x​)*sin(y)))

1 回表示 (過去 30 日間)
Tomas Schnierer
Tomas Schnierer 2017 年 1 月 5 日
回答済み: Star Strider 2017 年 1 月 6 日
Is this function write correct: -((exp(-x)*cos(y)+2*x)/(exp(-x)*sin(y))) function is: -(e^(-x)*cos(y)+2x)/(e(-x)*sin(y))). Thanks
  1 件のコメント
Jan
Jan 2017 年 1 月 5 日
What does "e(-x)" mean? Did you forget a ^ ?

サインインしてコメントする。

回答 (3 件)

Martin MacKinnon
Martin MacKinnon 2017 年 1 月 5 日
I'm guessing are you asking if the function on the left hand side is the MATLAB version of the function on the right hand side? If so, it appears to be correct - although the function on the right has one extra bracket.
  1 件のコメント
Tomas Schnierer
Tomas Schnierer 2017 年 1 月 5 日
Yeah, Matlab function is on the left side

サインインしてコメントする。


Jan
Jan 2017 年 1 月 5 日
編集済み: Jan 2017 年 1 月 5 日
It depends on what "x" and "y" are. If they are scalars and the "e(-x)" should be a "e^(-x)", the only difference between the formula and the code is going from e^x to exp(x). And then, yes, this is correct.
Do you have any reasons for doubts?

Star Strider
Star Strider 2017 年 1 月 6 日
It is, but it’s always best to vectorise it:
f = @(x,y) -((exp(-x).*cos(y)+2*x)./(exp(-x).*sin(y)));
See the documentation for Array vs. Matrix Operations for details.
Also, see the documentation for meshgrid (and ndgrid) as well), if you want to evaluate it most efficiently for a range of values for ‘x’ and ‘y’.

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by