フィルターのクリア

How to get the decimal values using solve in MATLAB

9 ビュー (過去 30 日間)
Khoa Nguyen
Khoa Nguyen 2023 年 2 月 27 日
コメント済み: Walter Roberson 2023 年 2 月 27 日
So I am using solve in MATLAB to solve an inequation in MATLAB, to find the syms trough_rot_speed, here are the code
syms trough_rot_speed;
assume(trough_rot_speed,'positive')
A_equation = (sind(Alpha_deg-Beta_deg)/cosd(Beta_deg))*((a*trough_rot_speed^2)/9.8);
solution = solve( sqrt(pi^2+1)> A_equation> 1.15,trough_rot_speed,'ReturnConditions', true);
All the values are known except trough_rot_speed, I access the results by the following code
solution.conditions
But I get the value in fraction, like this:
How do I get it in decimal values, for example: x < 203.442....
  1 件のコメント
Walter Roberson
Walter Roberson 2023 年 2 月 27 日
solution = solve( sqrt(pi^2+1)> A_equation> 1.15,trough_rot_speed,'ReturnConditions', true);
Chaining relative comparisons does not work for numeric values, and does not work reliably for solve(). The only place it works reliably is piecewise(). You should rewrite as two conditions joined with &

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

回答 (1 件)

KSSV
KSSV 2023 年 2 月 27 日
Read about vpasolve, double.
  3 件のコメント
Khoa Nguyen
Khoa Nguyen 2023 年 2 月 27 日
Thank you, I use vpa(solution.conditions) and the problem is solved!
KSSV
KSSV 2023 年 2 月 27 日
@Khoa Nguyen thanks is accepting/ voting the answer. :)

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

カテゴリ

Help Center および File ExchangeAssumptions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by