Table Function generating setraw message

Hi;

In the function that I am using x is undefined at value 3 (see attached). To circumvent the problem of x being undefined, I created a piecewise function defining x at value 3 to be zero and subsequently created a table using the piecewise function. When the table executes, I am receiving the message
“Set::setraw: Cannot assign to raw object 3.`.” and do not understand why. Is there anything I need to do to get rid of the message or just live with it?

Another unrelated question - how can I past code from a notebook into this forum. All of my pasting using Ctrl V (from windows) looks awful.

Thanks,

Mitch Sandlin

TableQuestion.nb (3.83 KB)

Hello Mitch,

the problem comes from your second condition in Piecewise: Instead of x=3 it should read x==3. But you do not need this condition anyway, because the default will hold then. Alternatively you can define your function like so:

f[x_] := (x^2 - 9)/(x - 3)
f[3] = 0;
f[3.] = 0.0;

I do not know what your problem with pasting code here is - did you click the “Code Sample” icon before?

Regards – Henrik