Message Boards Message Boards

0
|
3444 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Table Function generating setraw message

Posted 4 years ago

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

Attachments:
POSTED BY: Mitchell Sandlin

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

POSTED BY: Henrik Schachner
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract