How can I get a better simplification of my results
3 ビュー (過去 30 日間)
古いコメントを表示
I have been working on a program that gives me some results as a function of "k" and "m" (symbolic variables). However, this result is shown as this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/321589/image.png)
When, it is much simpler, the solution is just this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/321592/image.png)
How can I manage to make Matlab give me the result in a more digestible way? (I've already tried "simplify")
Thank you very much guys
0 件のコメント
採用された回答
Takumi
2020 年 6 月 24 日
syms k m
s = [-(3*10^(1/2)*(k*m)^(1/2))/(10*m);
(3*10^(1/2)*(k*m)^(1/2))/(10*m)];
assume([m,k],'positive');
s_sign = sign(s); % signum
assume([m,k],'clear') % reset assume
S = s.^2;
S = simplify(S);
s = s_sign.*sqrt(S)
2 件のコメント
Ahmet Anil
2023 年 12 月 23 日
Whats your purpose at that lists?
assume([m,k],'positive');
s_sign = sign(s); % signum
assume([m,k],'clear')
Walter Roberson
2023 年 12 月 23 日
syms k m
s = [-(3*10^(1/2)*(k*m)^(1/2))/(10*m);
(3*10^(1/2)*(k*m)^(1/2))/(10*m)];
s_sign = sign(s); % signum
S = s.^2;
S = simplify(S);
s = s_sign.*sqrt(S)
So the assume() is there to have the sign() vanish
その他の回答 (0 件)
参考
カテゴリ
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!