how to take logarithm of a functional form in matlab?

3 vues (au cours des 30 derniers jours)
Tanvir Kaisar
Tanvir Kaisar le 10 Nov 2016
Commenté : Tanvir Kaisar le 11 Nov 2016
I have defined a function- >>f=inline('x*y','x','y') Now when i take log of this- >>logarithm=inline(log(f(x,y)),'x','y') Matlab simply shows log(x.*y) HOW CAN I GET THE ANSWER "logx+logy" instead?

Réponse acceptée

Walter Roberson
Walter Roberson le 10 Nov 2016
You might be able to do it with the symbolic toolbox, though I would have to experiment to figure out how messy it is.
You should not be writing any new inline() unless you need backwards compatibility with something already written. Anonymous functions have replaced inline()
  2 commentaires
Walter Roberson
Walter Roberson le 10 Nov 2016
syms x y positive
expand( log(x*y))
Tanvir Kaisar
Tanvir Kaisar le 11 Nov 2016
It worked! Thank u! :)

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Function Creation dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by