|
From: | Ben Abbott |
Subject: | Re: e in octave |
Date: | Fri, 07 Nov 2008 23:23:48 -0500 |
On Nov 7, 2008, at 11:06 PM, james mcskimming wrote:
i've always accepted that e=exp(1) is a constant available in Octavejust like pi and others. But i wrote code using e as a constant only todiscover it didn't work when a friend tried to run it on Matlab.I've never used Matlab but assumed there would be compatability at sucha basic level.Is there a reason why? and other than defining the variable e=exp(1) incode for Matlab, is there a better way? thx Jas
Octave tries to be compatible with Matlab, but also includes some conveniences and/or capabilities which are absent in Matlab. If you require that your code be compatible with both, then you have a two (more) options.
(1) Don't use the predefined variable "e" in Octave. (2) Write a trivial Matlab function to mimc the behavior of Octave. function result = e() result = exp(1); end Ben
[Prev in Thread] | Current Thread | [Next in Thread] |