What is the problem with this code:
y = {-1, 0, 1}
Plot[x/y, {x, 1, 10}, Exclusions -> y == 0]
Why it is showing a division by zero problem
What is the problem with this code:
y = {-1, 0, 1}
Plot[x/y, {x, 1, 10}, Exclusions -> y == 0]
Why it is showing a division by zero problem
I believe it is because Plot first evaluates its argument.
Try:
y = {-1, 0, 1}
y= DeleteCases[y,0]
Plot[x/y, {x, 1, 10}]
What if I have something like this and I want to remove the asymptotes:
y = {-1,0,1}
Plot[A[x,y]/B[x,y],{x,0,1}]
Sould I use Exclusions->{B[x,y]!=0} or DeleteCases[B[x,y],0] or something else?
The main problem is that Exclusions → vector==0 wil never happen! So try not to put y as a vector.
just plot
{A[x,-1]/B[x,-1],A[x,0]/B[x,0],A[x,1]/B[x,1]}
and then provide an exclusion like B[x,0] == 0
For every value of y, I have a different curve with an asymptote, so I must add an exclusion {B[x,-1]==0,B[x,0] == 0,B[x,1]==1} but the value of x in each exclusion will make a discontinuity on the other 2 curves also , then now I got rid of the asymptotes but as a result I will have 3 curves that each one of them contains two white spots inside of them. Do you agree ?
You could make 3 plots separately and then combine them using the function Show.
I’m not sure what the exact problem is that you’re looking at… which might complicate things…
I want to plot the following 7 curves without their asymptotes:
\[Gamma] = {-0.99, -0.9, -0.5, 0, 0.5, 0.9, 0.99}
f[\[Lambda]_, \[Gamma]_] := (1 - 5 \[Lambda] + 4 \[Gamma]*\[Lambda]) (
77 \[Lambda]^2 -
76 \[Gamma] \[Lambda]^2 + (10 \[Lambda] -
8 \[Gamma] \[Lambda]) (1 - 5 \[Lambda] +
4 \[Gamma] \[Lambda]))/(
2 - (10 \[Lambda] - 8 \[Gamma] \[Lambda]) (2 - 5 \[Lambda] +
4 \[Gamma] \[Lambda]))
Plot[f[\[Lambda], \[Gamma]], {\[Lambda], 0, 1}, PlotRange -> {0, 20},
Frame -> True]