1.

How would you simplify log(x^20) – log(x^13) – log(x^7)in MATLAB? (Assume x is defined as a string variable)(a) simplify(log(x^20)-log(x^13)–log(x^7));(b) log(x^20) – log(x^13) – log(x^7)(c) simplify(log(x^20)-log(x^13)–log(x^7),’IgnoreAnalyticConstraints’,true)(d) simplify(log(x^20)-log(x^13)–log(x^7))I have been asked this question in an interview for job.Question is from Algebra in section MATLAB Basics of MATLAB

Answer»

Correct option is (c) SIMPLIFY(log(x^20)-log(x^13)–log(x^7),’IgnoreAnalyticConstraints’,TRUE)

The explanation is: Option simplify(log(x^20)-log(x^13)–log(x^7),’IgnoreAnalyticConstraints’,true) would evaluate to 0. The cases are used to produce a GREATER simplified EXPRESSION for a polynomial. simplify(log(x^20)-log(x^13)–log(x^7)) does not give any different output but the expression itself. Option log(x^20) – log(x^13) – log(x^7) is incorrect since the powers should be represented as log(x^20) in MATLAB.



Discussion

No Comment Found

Related InterviewSolutions