How to convert the equation to MATLab code
87 次查看(过去 30 天)
显示 更早的评论
Help converting
回答(9 个)
Walter Roberson
2020-7-19
编辑:Walter Roberson
2020-7-19
- 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
- e to a power is coded as exp() the power
- division is the ./ operator with the / operator being more like multiplying by the pseudo-inverse
- powers other than e to something, should be the .^ (element at a time) or ^ (matrix power through generalized inner product) operators.
- 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 ^
0 个评论
akram mehenni
2022-2-2
𝐸5 = 𝛼. 𝐸3 . √𝐸4
1 个评论
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
2022-8-12
编辑:Walter Roberson
2022-8-15
How can I convert
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1098375/image.jpeg)
this equation to MATLAB ?
1 个评论
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)
Vishwajeet
2022-11-29
how can i convert Cu dTu/ dt = F − αTu − γ (Tu − Td) to matlab code?
1 个评论
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
2023-7-22
Please, your support is needed, thank you![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1440073/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1440073/image.png)
4 个评论
Walter Roberson
2023-7-23
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1440653/image.png)
would be
kummerU(1/2, 5/4, tau_0.^4 ./ (32 .* log(2).^2 .* sigma_k2.^2))
This might require the Symbolic Mathematics Toolbox
Om prakash Meena
2023-9-13
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1481021/image.png)
1 个评论
Walter Roberson
2023-9-13
I would offer the same comments as I did for https://www.mathworks.com/matlabcentral/answers/455413-how-to-convert-the-equation-to-matlab-code#answer_467841
BUI
2023-11-5
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1530092/image.png)
Help me convert this fuction please
1 个评论
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 ...
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Numbers and Precision 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!