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:
When, it is much simpler, the solution is just this:
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

采纳的回答

Takumi
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)
s = 
  2 个评论
Ahmet Anil
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
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)
s = 
So the assume() is there to have the sign() vanish

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Numbers and Precision 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by