don't display some part of a graph
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Mohammad Sadegh Nasirianfar
le 29 Mai 2022
Commenté : Mohammad Sadegh Nasirianfar
le 29 Mai 2022
I have plotted a graph with following code. I want to know how can I define that in the highlighted part in attachment that Ic > 2.6, it won't be displayed.
plot (Ic,depth)
set (gca, 'Ydir', 'reverse')
grid on
xlabel('I_c')
ylabel('Depth (m)')
0 commentaires
Réponse acceptée
KSSV
le 29 Mai 2022
idx = Ic > 26 ; %get indices of Ic which are greater than 26
depth(idx) = NaN ; % make those respective value nan
plot(Ic,depth) ; % now those values wont be displayed
3 commentaires
KSSV
le 29 Mai 2022
Yes.. Why not. Do that indexing before plotting the fourth subplot Or save the value into a different variable and plot.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!