Remove the discontinuity from tan(x) where odd multiples of pi/2
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Giuseppe
il 20 Mar 2014
Risposto: Lateef Adewale Kareem
il 12 Apr 2016
Hi i have the function;
f=tan(x)
where
x=linspace(-2pi,2pi,200)
I was wondering if you would know how to remove disconuity of the function which is odd multiples of pi/2.
I was thinking using the rem(x, 2) ==0 function and f(_) = NaN but i dont know how to structure it.
By the way it is for when i plot it, so there are no vertical lines (the disconuity which is all odd multiples of pi/2).
0 Commenti
Risposta accettata
Star Strider
il 20 Mar 2014
Modificato: Star Strider
il 20 Mar 2014
I suggest:
x=linspace(-2*pi,2*pi,200);
f=tan(x);
f(diff([0 f]) < 0) = NaN;
Più risposte (1)
Lateef Adewale Kareem
il 12 Apr 2016
x=linspace(-2*pi,2*pi,200); f=tan(x); f(abs(diff([0 f])) > 15) = NaN;
0 Commenti
Vedere anche
Categorie
Scopri di più su Logical in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!