Message Boards Message Boards

0
|
4296 Views
|
4 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Empty plot of piecewise function?

Posted 3 years ago

Hi, I am trying to write up a ladder function, I use Piecewise:

f[x]=Piecewise{{1.5, {-6<x<-5.8}}}

where this is the first step of the ladder. Then adding a second step:

f[x]=Piecewise{{1.5, {-6<x<-5.8}}, {-1.5, {-5.6<x<-5.4}}}

But the plots are empty. Is this a problem with the intervals?

Thanks

POSTED BY: Ser Man
4 Replies

Do you know the function Floor and friends? Is it this, what you want?

Plot[Floor[x], {x, 0, 10}, Exclusions -> None]

enter image description here

POSTED BY: Henrik Schachner

Too many curly braces. Try this:

f[x] = Piecewise[{{1.5, -6 < x < -5.8}}];
Plot[f[x], {x, -6.5, -5.5}]
POSTED BY: Gianluca Gorni
Posted 3 years ago

Thanks for that, it show now the function, but the plot is still blank.

POSTED BY: Ser Man
Posted 3 years ago

Please check your code. There is no [ ] following Piecewise.

POSTED BY: Rohit Namjoshi
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