what is the correct way to write this expression in matlab?

1 回表示 (過去 30 日間)
Anuradha
Anuradha 2023 年 1 月 24 日
コメント済み: Star Strider 2023 年 1 月 25 日
f=sqrt((1/(L*C)-(R.^2)/((4*C).^2))); correct way to write the expression in matlab?
  1 件のコメント
Dyuman Joshi
Dyuman Joshi 2023 年 1 月 24 日
We don't know, because we don't know the reference for the expression.
Please give more information or provide reference formula.

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

回答 (2 件)

Star Strider
Star Strider 2023 年 1 月 24 日
If ‘R’, ‘L’, and ‘C’ are all arrays of the same size, use element-wise operations in every multiplication, division, and exponentiation operation —
f = sqrt((1./(L.*C)-(R.^2)./((4*C).^2)));
See Array vs. Matrix Operations for details.
.
  2 件のコメント
Anuradha
Anuradha 2023 年 1 月 25 日
Yes this is correct. Thank you man.
Star Strider
Star Strider 2023 年 1 月 25 日
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.

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


Jiri Hajek
Jiri Hajek 2023 年 1 月 24 日
移動済み: Image Analyst 2023 年 1 月 24 日
We can only see, if the expression is written corretly to allow evaluation by MATLAB:
L=1;
C=2;
R=3;
f=sqrt((1/(L*C)-(R.^2)/((4*C).^2)))
f = 0.5995

カテゴリ

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