필터 지우기
필터 지우기

How can I get a better simplification of my results

조회 수: 5 (최근 30일)
El Vapor
El Vapor 2020년 6월 24일
댓글: Walter Roberson 2023년 12월 23일
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에서 Symbolic Math Toolbox에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by