No BSD License  

Highlights from
xLOGy

3.0

3.0 | 1 rating Rate this file 1 Download (last 30 days) File Size: 958 Bytes File ID: #9116

xLOGy

by Jasper Menger

 

23 Nov 2005 (Updated 15 Nov 2006)

Generalized logarithm

| Watch this File

File Information
Description

XLOGY - Logarithm

XLOGY(X,Y) returns the N for which X ^ N = Y.

XLOGY is defined as LOG(Y) elementswise divided by LOG(X).

N is defined as one for all elements where X equals one, and also for elements where X and Y are equal.

The log of X = 0 for any Y is defined as Inf.

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
23 Nov 2005 urs (us) schwarz

could the engine not simply read

ix=x~=1&y~=1&x~=y;
N=log(y(ix))./log(x(ix));

us

23 Nov 2005 urs (us) schwarz

could the engine not simply read

ix=x~=1&y~=1&x~=y;
N=zeros(size(ix));
N(ix)=log(y(ix))./log(x(ix));

us

25 Nov 2005 Jasper Menger

You're absolutely right. I've just submitted an update.

09 Nov 2006 John D'Errico

The documentation and the help both suggest that xlogy(1,y) is defined as 1. This makes no sense, and it is also inconsistent with the code itself, since xlogy(1,y) actually returns 0 in this code.

Perhaps a better choice for xlogy(1,y) should be +/- inf., depending on the magnitude of y, with xlogy(1,1) == 0.

Please login to add a comment or rating.
Updates
28 Nov 2005

Usefull suggestion by Urs Schwarz.

15 Nov 2006

Useful user comment

Tag Activity for this File
Tag Applied By Date/Time
log logarithm generalized Jasper Menger 22 Oct 2008 08:07:21

Contact us at files@mathworks.com