How can I get a better simplification of my results
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
El Vapor
am 24 Jun. 2020
Kommentiert: Walter Roberson
am 23 Dez. 2023
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
0 Kommentare
Akzeptierte Antwort
Takumi
am 24 Jun. 2020
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 Kommentare
Ahmet Anil
am 23 Dez. 2023
Whats your purpose at that lists?
assume([m,k],'positive');
s_sign = sign(s); % signum
assume([m,k],'clear')
Walter Roberson
am 23 Dez. 2023
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
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Number Theory finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!