Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Predictable result but with Error message' topicStudent Support Forum > General > Archives > "Predictable result but with Error message"

Next Comment >Help | Reply To Topic
Author Comment/Response
Igor
06/16/13 12:53pm

Hi,
That simple code ....
******
c = {1, 8, 3, 4, 5, 6};
f[x_] = c[[IntegerPart[x/2]]];
Plot[f[x], {x, 2, 12}]
******
...works correctly, and gives predictable result. But there is one warning message:
"Part::pspec: "Part specification IntegerPart[x/2] is neither an integer nor a list of integers. "

I suppose that code is writen uncorrectly. Could you tell me what should I change for WarningMessageLESS :) result?

URL: ,

Subject (listing for 'Predictable result but with Error message')
Author Date Posted
Predictable result but with Error message Igor 06/16/13 12:53pm
Re: Predictable result but with Error message jf 06/16/13 1:09pm
Re: Re: Predictable result but with Error message Igor 06/16/13 2:44pm
Re: Predictable result but with Error message [... Igor 06/16/13 4:03pm
Next Comment >Help | Reply To Topic