[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Octave Symbolic package: assign `nan` to symfun

From: Colin Macdonald
Subject: Re: Octave Symbolic package: assign `nan` to symfun
Date: Mon, 6 Feb 2017 12:28:55 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1

On 06/02/17 07:17, Nicholas Jankowski wrote:
On Mon, Feb 6, 2017 at 8:59 AM, NVS Abhilash <address@hidden> wrote:
I am using the symbolic package, I have installed `2.5.0` from the source
[1]. I get this error in Octave 4.3.0+
Is it a bug, or is it expected?

Whether or not it's expected, this is 'compatible' behavior.  In Matlab 2016b:

I think its a least somewhat expected. The same "problem" can be seen without the nan:

syms x
clear f     % (different behavior if f already exists)
f(x) = 7

The way to do this sort of thing is:

f(x) = sym(7)
f(x) = sym(nan)

I think there is not much we can do because Octave (and Matlab I expect) do not call address@hidden/subsasgn` in this case. We could document it as a "gotcha" in "help symfun": pull request welcome.

Actually, perhaps address@hidden/subindex` could detect when its passed a Symbol and say something like:

error ('are you perhaps trying to make a symfun from a non-sym rhs object? If so, try using "f(x) = sym(<rhs>)"')

If you're not sure how to do these patches, you could file a bug at


reply via email to

[Prev in Thread] Current Thread [Next in Thread]