def myfn2(x): if x<0: return 1 else: return -1 plot(myfn2(x),x,-3,3,figsize=3,color="red")
The graph is only displayed as -1. Why?
| 1 | initial version |
def myfn2(x): if x<0: return 1 else: return -1 plot(myfn2(x),x,-3,3,figsize=3,color="red")
The graph is only displayed as -1. Why?
def myfn2(x): if x<0: return 1 else: return -1 plot(myfn2(x),x,-3,3,figsize=3,color="red")
The graph is only displayed as -1. Why?
def myfn2(x): if x<0: return 1 else: return -1 plot(myfn2(x),x,-3,3,figsize=3,color="red")
The graph is only displayed as -1. Why?
I'm trying to plot the following.
def myfn2(x):
if x<0:
return 1
else:
return -1
return -1
plot(myfn2(x),x,-3,3,figsize=3,color="red")
The graph is only displayed as -1. Why?
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.