How to convert the equation to MATLab code

回答 (9 件)

Walter Roberson
Walter Roberson 2020 年 7 月 19 日
編集済み: Walter Roberson 2020 年 7 月 19 日

1 投票

  1. MATLAB has no implied multiplication. All multiplication must be explicit with either the .* (corresponding elements, which is usually the desired operation) or * (inner product) operators
  2. e to a power is coded as exp() the power
  3. division is the ./ operator with the / operator being more like multiplying by the pseudo-inverse
  4. powers other than e to something, should be the .^ (element at a time) or ^ (matrix power through generalized inner product) operators.
  5. square root is usually most clear and efficient using sqrt() but .^0.5 or nthroot() can be used, and sometimes sqrtm() or ^0.5 are appropriate
For the kinds of equations that are shown here, use .* and ./ and .^ instead of * and / and ^
akram mehenni
akram mehenni 2022 年 2 月 2 日

0 投票

𝐸5 = 𝛼. 𝐸3 . √𝐸4

1 件のコメント

Walter Roberson
Walter Roberson 2022 年 2 月 2 日
The equations that were posted have no E3, E4, or E5, so this does not appear to be an answer to the question that was put. How are people to understand this as a solution to the question ?

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

Marwa Hameed
Marwa Hameed 2022 年 8 月 12 日
編集済み: Walter Roberson 2022 年 8 月 15 日

0 投票

How can I convert
this equation to MATLAB ?

1 件のコメント

Walter Roberson
Walter Roberson 2022 年 8 月 15 日
Caution: you have variable names Q_min and Q_max but you are integrating with respect to log(Q) so Q_min and Q_max are limits on log(Q) not limits on Q.
Integrating with respect to a function instead of a variable is always tricky.
Pi = sym(pi);
syms a_0 E G_fi(Q) Q_max Q_min R sigma_Born T log_Q
eqn = sigma_Born == 4*Pi*a_0^2/(T/R) * int(G_fi(exp(log_Q))/(E/R), log_Q, Q_min, Q_max)
eqn = 

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

Vishwajeet
Vishwajeet 2022 年 11 月 29 日

0 投票

how can i convert Cu dTu/ dt = F αTu − γ (Tu − Td) to matlab code?

1 件のコメント

Steven Lord
Steven Lord 2022 年 11 月 29 日
See the documentation for the ODE solvers. I'd start with ode45 and the pages listed under Topics at the end of that page.

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

HA
HA 2023 年 7 月 22 日

0 投票

Please, your support is needed, thank you

4 件のコメント

Walter Roberson
Walter Roberson 2023 年 7 月 22 日
You need to be clearer on the notation. Is a constant? Is one of the Modified Bessel Functions? U looks like it might be a function with multiple parameters, but which one? Looking at the parameters I would tend to speculate that U might be notation having to do with a hypergeometric function
Anyhow, what you need to know is that in MATLAB the natural log function is named log and that would be written as log(2).^2 . Also note that MATLAB has absolutely no implied multiplication, so be sure to put in every multiplication operator .
HA
HA 2023 年 7 月 23 日
@Walter Roberson, yes τ0 a constant(FWHM) transform limited,K0 modified Bessel function and U is hypergeometric. I am asking for last part which I can not get: [1/2 , 5/4, τ0.^4/32In.^(2)σk2] how to implemet those commas in in the equation and write them in Matlab? Many thanks for you
Walter Roberson
Walter Roberson 2023 年 7 月 23 日
would be
kummerU(1/2, 5/4, tau_0.^4 ./ (32 .* log(2).^2 .* sigma_k2.^2))
This might require the Symbolic Mathematics Toolbox
HA
HA 2023 年 7 月 23 日
Thank you

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

BUI
BUI 2023 年 11 月 5 日

0 投票

Help me convert this fuction please

1 件のコメント

Walter Roberson
Walter Roberson 2023 年 11 月 5 日
"A function can be recovered from its Fourier series, under suitable conditions. When this is possible, the Fourier series provides the inversion formula: "
and look at the formula there. Now let lambda = -1/P ...

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

Essodokinam
Essodokinam 2024 年 1 月 31 日

0 投票

Hi everybody, I need you help for converting these function in matlab:

カテゴリ

ヘルプ センター および File ExchangeMathematics についてさらに検索

質問済み:

2019 年 4 月 10 日

回答済み:

2024 年 1 月 31 日

Community Treasure Hunt

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

Start Hunting!

Translated by