Data extract from graph.
15 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Vikas Vasudevan
le 26 Juin 2019
Réponse apportée : Walter Roberson
le 26 Juin 2019
I have a plot I created in matlab using excel data. I would like my code to provide a Y value for the X value that I provide. Is this possible? Please note that i cannot look for the Y value, the code should automatically assign the Y value from the graph for provided X value.
Thanks for the Help.
0 commentaires
Réponse acceptée
Walter Roberson
le 26 Juin 2019
Providing that x is monotonic:
h = findobj(gca, '-property', 'XData');
hx = h.XData;
hy = h.YData;
[shx, idx] = sort(hx);
shy = hy(hx);
corresponding_y = interp1(shx, shy, given_x);
0 commentaires
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!