필터 지우기
필터 지우기

Reduce a certain kind of multiplication expression and square root expression

조회 수: 5 (최근 30일)
Kagome
Kagome 2011년 4월 29일
Multiplication by a division expression. x * (y / z) can be better expressed as (x*y) / z. But before returning this new expression, reduce it by calling the reduce function on it. Reduce it after you create it but before you return it.
I have to make a function that can do this but can't seem to figure it out. So far I have this within a function:
elseif strcmp(Operand2{2}, 'Div')
reduce(Operand2);
Result = {'Num', Operand1{2} * Operand2{2}};
I also need a part of a function that can do this, "Radical is a power, and the exponentof that power is a number >= 2: Create a new 'Pow' expression using the same base but with an exponent that has had 2 subtracted from it. Reduce this expression and return it." So far I have this within a separate function.
if strcmp(radical{1},'Pow')
reduce(radical);
Result = reduce(sqrt(radical{2}));
  댓글 수: 1
Walter Roberson
Walter Roberson 2011년 4월 29일
You do not appear to have asked a question about MATLAB?
You have not indicated what problem you are observing?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Whos에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by