On 06/02/17 07:17, Nicholas Jankowski wrote:

> On Mon, Feb 6, 2017 at 8:59 AM, NVS Abhilash <

[hidden email]> 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 `@sym/subsasgn` in this case. We could document it as a

"gotcha" in "help symfun": pull request welcome.

Actually, perhaps `@sym/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

https://github.com/cbm755/octsympy/issuescheers,

Colin

_______________________________________________

Help-octave mailing list

[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave